Class LazyExpression<V extends IValue>
java.lang.Object
org.cyclops.integrateddynamics.api.evaluate.expression.VariableAdapter<V>
org.cyclops.integrateddynamics.core.evaluate.expression.LazyExpression<V>
- All Implemented Interfaces:
IExpression<V>,IVariable<V>,IVariableInvalidateListener
A generic expression with arbitrarily nested binary operations.
This is evaluated in a lazy manner.
-
Constructor Summary
ConstructorsConstructorDescriptionLazyExpression(int id, IOperator op, IVariable[] input, ILazyExpressionValueCache valueCache) -
Method Summary
Methods inherited from class org.cyclops.integrateddynamics.api.evaluate.expression.VariableAdapter
addInvalidationListener, removeInvalidationListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.cyclops.integrateddynamics.api.evaluate.variable.IVariable
addInvalidationListener, removeInvalidationListener
-
Constructor Details
-
LazyExpression
public LazyExpression(int id, IOperator op, IVariable[] input, ILazyExpressionValueCache valueCache)
-
-
Method Details
-
evaluate
- Specified by:
evaluatein interfaceIExpression<V extends IValue>- Returns:
- The current evaluation result of the input variables.
- Throws:
EvaluationException- When something went wrong while evaluating.
-
hasErrored
public boolean hasErrored()- Specified by:
hasErroredin interfaceIExpression<V extends IValue>- Returns:
- If this expression last evaluation resulted in an error.
-
getType
-
getValue
- Specified by:
getValuein interfaceIVariable<V extends IValue>- Returns:
- The current value of this variable.
- Throws:
EvaluationException- If something went wrong while evaluating
-
invalidate
public void invalidate()Description copied from interface:IVariableInvalidateListenerCalled when a variable was invalidated.- Specified by:
invalidatein interfaceIVariableInvalidateListener- Overrides:
invalidatein classVariableAdapter<V extends IValue>
-
getOperator
-
getInput
-