Class VariableConfigProvider
java.lang.Object
net.ssehub.easy.varModel.confModel.VariableConfigProvider
- Direct Known Subclasses:
NestedVarConfigProvider,ToplevelVarConfigProvider
Delegate for handling the value and state of a
IDecisionVariable.
This provider returns an own value and state for the associated IDecisionVariable.
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 -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidfreeze()Causes to freeze the current value.protected abstract voidfreeze(IFreezeSelector selector) Causes to freeze the current value.protected abstract ConfigurationReturn the configuration containing the relatedIDecisionVariable.protected abstract AbstractVariableReturns 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 booleanSpecifies 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 final voidunfreeze(IAssignmentState state) Unfreezes this variable to the givenstate.
-
Constructor Details
-
VariableConfigProvider
VariableConfigProvider()
-
-
Method Details
-
getValue
Returns the current value of thisIDecisionVariable.- Returns:
- the value (may be null)
-
setValue
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
Returns the assignment state of this variable.- Returns:
- the assignment state
-
freeze
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
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:
trueif the relatedIDecisionVariablecan have its ownIAssignmentState, otherwisefalse.
-
setState
Setter for theIAssignmentState, needed byCompoundVariables.- Parameters:
state- The newIAssignmentState, which should be set.
-
getDeclaration
Returns the declaration of the relatedIDecisionVariable.- Returns:
IConfigurationElement.getDeclaration().
-
getConfiguration
Return the configuration containing the relatedIDecisionVariable.- Returns:
IConfigurationElement.getConfiguration().
-