Package nz.org.riskscape.engine.rl
Interface RealizedExpression
- All Superinterfaces:
AutoCloseable
Represents an Expression that has been realized against a specific RiskScape type. Given an object that conforms to that type, this expression can be safely evaluated against it.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
close()
Destroy/release/abandon any resources associated with this expression.Evaluate this expression against the given objectdefault Object
evaluateValues
(Object... values) Convenience form ofevaluate(java.lang.Object)
for expressions that you know accept aStruct
input type.
-
Field Details
-
TRUE
-
-
Method Details
-
getInputType
Type getInputType()- Returns:
- the type that this expression was realized for
-
getResultType
Type getResultType()- Returns:
- the type that this expression yields
-
evaluate
Evaluate this expression against the given object
- Parameters:
input
- an object that must conform togetInputType()
- Returns:
- an object that must conform to
getResultType()
-
evaluateValues
Convenience form of
evaluate(java.lang.Object)
for expressions that you know accept aStruct
input type.This method will return
evaluate(Tuple.ofValues(getInputType().asStruct(), values)
-
getExpression
Expression getExpression()- Returns:
- the AST that this expression was realized from.
-
getDependencies
List<RealizedExpression> getDependencies()- Returns:
- any
RealizedExpression
s that are inputs in to this realized expression
-
close
default void close()Destroy/release/abandon any resources associated with this expression. Note that a realized expression should propagate closing to any dependencies, as the default implementation does.
See Javadoc
Realized
for more discussion on the life-cycle of executable objects like these.- Specified by:
close
in interfaceAutoCloseable
-