Class BasisVariable
- java.lang.Object
-
- net.ssehub.easy.varModel.confModel.DecisionVariable
-
- net.ssehub.easy.varModel.confModel.BasisVariable
-
- All Implemented Interfaces:
IConfigurationElement,IConfigurationVisitable,IDecisionVariable,IValueParent
class BasisVariable extends DecisionVariable
Class for variables which do not bear nested variables. Supported data types are:- BasisDatatype
- ConstraintType
- Enum
- OrderedEnum
- Reference
- Author:
- El-Sharkawy
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBasisVariable(IConfigurationElement parent, AbstractVariable varDeclaration, boolean isVisible, boolean isAttribute)Sole constructor for creatingIDecisionVariable's which do not contain nested Elements.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfreeze(java.lang.String nestedElement)Causes to freeze a nested value.IDecisionVariablegetNestedElement(int index)Returns the element specified byindex.intgetNestedElementsCount()Returns the number of nested elements.booleanremoveDerivedValues()Removes all (nested) values which are in stateAssignmentState.DERIVED, i.e., all values which are propagated bay the reasoner.voidsetValue(Value value, IAssignmentState state, IConfigurationElement nested)Changes the value of a nested variable.-
Methods inherited from class net.ssehub.easy.varModel.confModel.DecisionVariable
accept, enableWasAssignedForIsDefined, freeze, getAttribute, getAttributesCount, getConfigProvider, getConfiguration, getDeclaration, getInstantiatableType, getNestedDepth, getNestedElement, getParent, getPathForNestedElement, getQualifiedName, getResolutionPath, getState, getValue, hasNullValue, hasValue, isAttribute, isLocal, isNested, isVisible, notifyCreated, notifyWasAssigned, ownStateAllowed, setHistoryValue, setIndex, setState, setValue, setValue, toString, unfreeze, wasAssigned, wasCreated
-
-
-
-
Constructor Detail
-
BasisVariable
protected BasisVariable(IConfigurationElement parent, AbstractVariable varDeclaration, boolean isVisible, boolean isAttribute)
Sole constructor for creatingIDecisionVariable's which do not contain nested Elements.- Parameters:
parent- the parent this variable is part of, typically theConfigurationinstance, but in case of compounds also the containingDecisionVariablevarDeclaration- the variable declaration instantiated by this decisionisVisible- Specifies whether this variables is exported by an interface or not:- true: The variable is exported by an interface or there is no interface .
- false: There is an interface which does not export this variable .
isAttribute- whether this variable represents (a part of) an attribute or a variable
-
-
Method Detail
-
getNestedElementsCount
public int getNestedElementsCount()
Description copied from interface:IDecisionVariableReturns the number of nested elements. The return value should be 0 unless thisIDecisionVariableis a- Returns:
- An integer value greater or equal to 0.
-
getNestedElement
public IDecisionVariable getNestedElement(int index)
Description copied from interface:IDecisionVariableReturns the element specified byindex. [also req SAP]- Parameters:
index- a 0-based index specifying the element to be returned- Returns:
- the element
-
setValue
public void setValue(Value value, IAssignmentState state, IConfigurationElement nested) throws ConfigurationException
Description copied from interface:IConfigurationElementChanges the value of a nested variable.- Parameters:
value- the new valuestate- the new assignment statenested- the nested variable to be considered in the parent- Throws:
ConfigurationException- in case of type incompatibilities
-
freeze
public void freeze(java.lang.String nestedElement)
Description copied from interface:IConfigurationElementCauses to freeze a nested value.- Parameters:
nestedElement- The name of the nested Element, which should be frozen.
-
removeDerivedValues
public boolean removeDerivedValues()
Description copied from interface:IDecisionVariableRemoves all (nested) values which are in stateAssignmentState.DERIVED, i.e., all values which are propagated bay the reasoner. This will keep all user assignedAssignmentState.ASSIGNEDand frozenAssignmentState.FROZENvalues.- Returns:
- true if there was a change, false if the variable keeps unchanged.
-
-