Class ContainerItemConfigProvider
java.lang.Object
net.ssehub.easy.varModel.confModel.VariableConfigProvider
net.ssehub.easy.varModel.confModel.NestedVarConfigProvider
net.ssehub.easy.varModel.confModel.ContainerItemConfigProvider
VariableConfigProvider for nested variables of a ContainerVariable.- Author:
- El-Sharkawy
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intthis index is used to retrieve the correct sub value of the parentContainerVariable.private IAssignmentState -
Constructor Summary
ConstructorsConstructorDescriptionContainerItemConfigProvider(ContainerVariable parent, int index) Sole constructor for creating aVariableConfigProviderfor nested elements of a container. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidfreeze(IFreezeSelector selector) Causes to freeze the current value.protected AbstractVariableReturns the declaration of the relatedIDecisionVariable.protected ContainerVariableReturns theStructuredVariablewhich hold the relatedIDecisionVariablewhere this provider belongs to.protected IAssignmentStategetState()Returns the assignment state of this variable.protected ValuegetValue()Returns the current value of thisIDecisionVariable.protected voidsetHistoryValue(Value value, IAssignmentState state) Changes the value from value history.(package private) voidsetIndex(int newIndex) Setter for the index.protected voidsetState(IAssignmentState state) Setter for theIAssignmentState, needed byCompoundVariables.protected voidsetValue(Value value, IAssignmentState state) Changes the value (for incremental buildup).Methods inherited from class net.ssehub.easy.varModel.confModel.NestedVarConfigProvider
getConfiguration, isStateChangeAllowedMethods inherited from class net.ssehub.easy.varModel.confModel.VariableConfigProvider
freeze, unfreeze
-
Field Details
-
index
private int indexthis index is used to retrieve the correct sub value of the parentContainerVariable. -
state
-
-
Constructor Details
-
ContainerItemConfigProvider
ContainerItemConfigProvider(ContainerVariable parent, int index) Sole constructor for creating aVariableConfigProviderfor nested elements of a container.- Parameters:
parent- ACompoundVariablewhich will hold the nestedIDecisionVariablewhere this provider belongs to.index- Theindexof the nestedIDecisionVariableinside the prant.
-
-
Method Details
-
getValue
Description copied from class:VariableConfigProviderReturns the current value of thisIDecisionVariable.- Specified by:
getValuein classVariableConfigProvider- Returns:
- the value (may be null)
-
setValue
Description copied from class:VariableConfigProviderChanges the value (for incremental buildup).- Specified by:
setValuein classVariableConfigProvider- Parameters:
value- the value (may be null for incremental buildup)state- the related assignment state- Throws:
ConfigurationException- in case that the types ofVariableConfigProvider.getDeclaration()andvaluedo not comply
-
getState
Description copied from class:VariableConfigProviderReturns the assignment state of this variable.- Specified by:
getStatein classVariableConfigProvider- Returns:
- the assignment state
-
setState
Description copied from class:VariableConfigProviderSetter for theIAssignmentState, needed byCompoundVariables.- Specified by:
setStatein classVariableConfigProvider- Parameters:
state- The newIAssignmentState, which should be set.
-
getDeclaration
Description copied from class:VariableConfigProviderReturns the declaration of the relatedIDecisionVariable.- Specified by:
getDeclarationin classVariableConfigProvider- Returns:
IConfigurationElement.getDeclaration().
-
getParent
Description copied from class:NestedVarConfigProviderReturns theStructuredVariablewhich hold the relatedIDecisionVariablewhere this provider belongs to.- Overrides:
getParentin classNestedVarConfigProvider- Returns:
- The
StructuredVariablewhich hold the relatedIDecisionVariable.
-
setIndex
void setIndex(int newIndex) Setter for the index. Should only be used inside theContainerVariableclasses to adjust the index after one element as been removed from the list of nested elements.- Parameters:
newIndex- The new index of the related nestedIDecisionVariable. This value must be in the range (this is not checked): (0 <= newIndex < getParent().getNestedElementsCount())
-
setHistoryValue
Description copied from class:VariableConfigProviderChanges the value from value history.- Specified by:
setHistoryValuein classVariableConfigProvider- Parameters:
value- the value (may be null for incremental buildup)state- the related assignment state- Throws:
ConfigurationException- in case that the types ofVariableConfigProvider.getDeclaration()andvaluedo not comply
-
freeze
Description copied from class:VariableConfigProviderCauses to freeze the current value.- Specified by:
freezein classVariableConfigProvider- Parameters:
selector- determines which parts shall be frozen
-