Class VariableConfigProvider
- java.lang.Object
-
- net.ssehub.easy.varModel.confModel.VariableConfigProvider
-
- Direct Known Subclasses:
NestedVarConfigProvider,ToplevelVarConfigProvider
abstract class VariableConfigProvider extends java.lang.ObjectDelegate for handling the value and state of aIDecisionVariable. This provider returns an own value and state for the associatedIDecisionVariable. The value of this provider can be a nested value of a structured variable or an own value of a top level variable.- Author:
- El-Sharkawy
-
-
Constructor Summary
Constructors Constructor Description VariableConfigProvider()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidfreeze()Causes to freeze the current value.protected abstract voidfreeze(IFreezeSelector selector)Causes to freeze the current value.protected abstract ConfigurationgetConfiguration()Return the configuration containing the relatedIDecisionVariable.protected abstract AbstractVariablegetDeclaration()Returns the declaration of the relatedIDecisionVariable.protected abstract IAssignmentStategetState()Returns the assignment state of this variable.protected abstract ValuegetValue()Returns the current value of thisIDecisionVariable.protected abstract booleanisStateChangeAllowed()Specifies whether the relatedIDecisionVariablecan have its ownIAssignmentState.protected abstract voidsetHistoryValue(Value value, IAssignmentState state)Changes the value from value history.protected abstract voidsetState(IAssignmentState state)Setter for theIAssignmentState, needed byCompoundVariables.protected abstract voidsetValue(Value value, IAssignmentState state)Changes the value (for incremental buildup).protected voidunfreeze(IAssignmentState state)Unfreezes this variable to the givenstate.
-
-
-
Method Detail
-
getValue
protected abstract Value getValue()
Returns the current value of thisIDecisionVariable.- Returns:
- the value (may be null)
-
setValue
protected abstract void setValue(Value value, IAssignmentState state) throws ConfigurationException
Changes the value (for incremental buildup).- Parameters:
value- the value (may be null for incremental buildup)state- the related assignment state- Throws:
ConfigurationException- in case that the types ofgetDeclaration()andvaluedo not comply
-
setHistoryValue
protected abstract void setHistoryValue(Value value, IAssignmentState state) throws ConfigurationException
Changes the value from value history.- Parameters:
value- the value (may be null for incremental buildup)state- the related assignment state- Throws:
ConfigurationException- in case that the types ofgetDeclaration()andvaluedo not comply
-
getState
protected abstract IAssignmentState getState()
Returns the assignment state of this variable.- Returns:
- the assignment state
-
freeze
protected abstract void freeze(IFreezeSelector selector)
Causes to freeze the current value.- Parameters:
selector- determines which parts shall be frozen
-
freeze
protected final void freeze()
Causes to freeze the current value.
-
unfreeze
protected final void unfreeze(IAssignmentState state)
Unfreezes this variable to the givenstate.- Parameters:
state- the target state (must not beAssignmentState.FROZEN)
-
isStateChangeAllowed
protected abstract boolean isStateChangeAllowed()
Specifies whether the relatedIDecisionVariablecan have its ownIAssignmentState. In case of a nestedIDecisionVariableof aStructuredVariable, this is not supported.- Returns:
- true if the related
IDecisionVariablecan have its ownIAssignmentState, otherwise false.
-
setState
protected abstract void setState(IAssignmentState state)
Setter for theIAssignmentState, needed byCompoundVariables.- Parameters:
state- The newIAssignmentState, which should be set.
-
getDeclaration
protected abstract AbstractVariable getDeclaration()
Returns the declaration of the relatedIDecisionVariable.- Returns:
IConfigurationElement.getDeclaration().
-
getConfiguration
protected abstract Configuration getConfiguration()
Return the configuration containing the relatedIDecisionVariable.- Returns:
IConfigurationElement.getConfiguration().
-
-