Package de.monticore.values
Interface MCValueFunction
- All Superinterfaces:
MCValue
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A value that is an executable function.
-
Method Summary
Modifier and TypeMethodDescriptiondefault MCValueFunctiondefault MCValueFunctionUsed to pass the value to native Java classes and similar, e.g., collections.default booleancheckEqualityOperator(MCValue other) Technically, functions don't have an identity or the identity is (near) non-computable (depending on interpretation).default MCValuedefault booleandefault StringPrint the type of the MIValue in human-readable formdefault StringPrint the value in human-readable form
-
Method Details
-
execute
-
execute
-
isFunction
default boolean isFunction()- Specified by:
isFunctionin interfaceMCValue
-
asFunction
- Specified by:
asFunctionin interfaceMCValue
-
asNativeObject
Description copied from interface:MCValueUsed to pass the value to native Java classes and similar, e.g., collections.Note: not all values can have a native representation, as such, their native version is the MIValue itself.
- Specified by:
asNativeObjectin interfaceMCValue- Returns:
- The value as a Java native Object.
-
checkEqualityOperator
Technically, functions don't have an identity or the identity is (near) non-computable (depending on interpretation). But for simplicity of the MIValue interface, a somewhat reasonable implementation is given.- Specified by:
checkEqualityOperatorin interfaceMCValue- Parameters:
other- the value to check against this- Returns:
- whether they are the same function _pointer_
-
printType
Description copied from interface:MCValuePrint the type of the MIValue in human-readable form -
printValue
Description copied from interface:MCValuePrint the value in human-readable form- Specified by:
printValuein interfaceMCValue
-