Interface IVariable<V extends IValue>
- All Superinterfaces:
IVariableInvalidateListener
- All Known Subinterfaces:
IAspectVariable<V>
,IExpression<V>
,IPositionedVariable<V>
- All Known Implementing Classes:
LazyAspectVariable
,LazyExpression
,UpdatingAspectVariable
,Variable
,VariableAdapter
Facade through which a value can be retrieved.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addInvalidationListener
(IVariableInvalidateListener invalidateListener) Add a dependency relation.getType()
getValue()
Methods inherited from interface org.cyclops.integrateddynamics.api.evaluate.variable.IVariableInvalidateListener
invalidate
-
Method Details
-
getType
IValueType<V> getType()- Returns:
- The type of value this variable provides.
-
getValue
- Returns:
- The current value of this variable.
- Throws:
EvaluationException
- If something went wrong while evaluating
-
addInvalidationListener
Add a dependency relation. This makes it so that when this variable gets invalidated, the given listener/variables also becomes invalidated. This invalidation should happen recursively for variables. This listener will be removed after the first invalidation. If needed, the listener can be re-attached after that.- Parameters:
invalidateListener
- A listener for invalidations.
-