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

public interface IVariable<V extends IValue> extends IVariableInvalidateListener
Facade through which a value can be retrieved.
  • Method Details

    • getType

      IValueType<V> getType()
      Returns:
      The type of value this variable provides.
    • getValue

      V getValue() throws EvaluationException
      Returns:
      The current value of this variable.
      Throws:
      EvaluationException - If something went wrong while evaluating
    • addInvalidationListener

      void addInvalidationListener(IVariableInvalidateListener invalidateListener)
      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.