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 for variables which do not bear nested variables.
Supported data types are:
BasisDatatypeConstraintTypeEnumOrderedEnumReference
- Author:
- El-Sharkawy
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBasisVariable(IConfigurationElement parent, AbstractVariable varDeclaration, boolean isVisible, boolean isAttribute) Sole constructor for creatingIDecisionVariable's which do not contain nested Elements. -
Method Summary
Modifier and TypeMethodDescriptionvoidCauses to freeze a nested value.getNestedElement(int index) Returns the element specified byindex.intReturns the number of nested elements.booleanRemoves 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 Details
-
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 Details
-
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
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
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:
trueif there was a change,falseif the variable keeps unchanged.
-