Class AbstractDecisionVariableEvaluationAccessor
java.lang.Object
net.ssehub.easy.varModel.cstEvaluation.EvaluationAccessor
net.ssehub.easy.varModel.cstEvaluation.AbstractDecisionVariableEvaluationAccessor
- Direct Known Subclasses:
CompoundSlotAccessor,ContainerElementAccessor,IndexAccessor,VariableAccessor
An accessor based on a decision variable.
- Author:
- Holger Eichelberger
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbind(IDecisionVariable variable, EvaluationContext context) Binds this accessor.voidclear()Clears the accessor for reuse.Returns the value of a reference to the accessed element.Returns the underlying variable.booleanisLocal()Returns whether this accessor denotes a local variable.protected voidnotifyVariableChange(Value oldValue, IAssignmentState oldState, IValueChangeListener.ChangeKind kind) Notifies the underlying variable about a change.toString()Methods inherited from class net.ssehub.easy.varModel.cstEvaluation.EvaluationAccessor
addBoundContainerElement, addBoundContainerElement, bind, bindContainer, bindContainer, clearContainerElements, dereferenceIfNeeded, getBoundContainerElement, getBoundContainerElementCount, getContext, getDereferencedValue, getValue, getValue, isAssignable, isAssigned, isConstant, release, release, setValue, setValue, validateContext
-
Field Details
-
variable
-
-
Constructor Details
-
AbstractDecisionVariableEvaluationAccessor
AbstractDecisionVariableEvaluationAccessor()
-
-
Method Details
-
bind
protected AbstractDecisionVariableEvaluationAccessor bind(IDecisionVariable variable, EvaluationContext context) Binds this accessor.- Parameters:
variable- the underlying variablecontext- the evaluation context- Returns:
- this (builder pattern)
-
clear
public void clear()Description copied from class:EvaluationAccessorClears the accessor for reuse.- Overrides:
clearin classEvaluationAccessor
-
getVariable
Description copied from class:EvaluationAccessorReturns the underlying variable.- Specified by:
getVariablein classEvaluationAccessor- Returns:
- the underlying variable (may be null)
-
notifyVariableChange
protected void notifyVariableChange(Value oldValue, IAssignmentState oldState, IValueChangeListener.ChangeKind kind) Notifies the underlying variable about a change.- Parameters:
oldValue- the value before the change (may be null)oldState- the old state ofvariablebefore the changekind- the change kind
-
getReferenceValue
Description copied from class:EvaluationAccessorReturns the value of a reference to the accessed element.- Specified by:
getReferenceValuein classEvaluationAccessor- Returns:
- the value (may be null if undefined)
-
toString
-
isLocal
public boolean isLocal()Returns whether this accessor denotes a local variable.- Returns:
trueif it is a local variable,falseelse
-