Class AbstractDecisionVariableEvaluationAccessor
- java.lang.Object
-
- net.ssehub.easy.varModel.cstEvaluation.EvaluationAccessor
-
- net.ssehub.easy.varModel.cstEvaluation.AbstractDecisionVariableEvaluationAccessor
-
- Direct Known Subclasses:
CompoundSlotAccessor,ContainerElementAccessor,IndexAccessor,VariableAccessor
abstract class AbstractDecisionVariableEvaluationAccessor extends EvaluationAccessor
An accessor based on a decision variable.- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private IDecisionVariablevariable
-
Constructor Summary
Constructors Constructor Description AbstractDecisionVariableEvaluationAccessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected AbstractDecisionVariableEvaluationAccessorbind(IDecisionVariable variable, EvaluationContext context)Binds this accessor.voidclear()Clears the accessor for reuse.ValuegetReferenceValue()Returns the value of a reference to the accessed element.IDecisionVariablegetVariable()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.java.lang.StringtoString()-
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 Detail
-
variable
private IDecisionVariable variable
-
-
Method Detail
-
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
public IDecisionVariable 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
public Value 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
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
isLocal
public boolean isLocal()
Returns whether this accessor denotes a local variable.- Returns:
trueif it is a local variable,falseelse
-
-