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 Details

    • BasisVariable

      protected BasisVariable(IConfigurationElement parent, AbstractVariable varDeclaration, boolean isVisible, boolean isAttribute)
      Sole constructor for creating IDecisionVariable's which do not contain nested Elements.
      Parameters:
      parent - the parent this variable is part of, typically the Configuration instance, but in case of compounds also the containing DecisionVariable
      varDeclaration - the variable declaration instantiated by this decision
      isVisible - 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: IDecisionVariable
      Returns the number of nested elements. The return value should be 0 unless this IDecisionVariable is a
      Returns:
      An integer value greater or equal to 0.
    • getNestedElement

      public IDecisionVariable getNestedElement(int index)
      Description copied from interface: IDecisionVariable
      Returns the element specified by index. [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: IConfigurationElement
      Changes the value of a nested variable.
      Parameters:
      value - the new value
      state - the new assignment state
      nested - the nested variable to be considered in the parent
      Throws:
      ConfigurationException - in case of type incompatibilities
    • freeze

      public void freeze(String nestedElement)
      Description copied from interface: IConfigurationElement
      Causes 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: IDecisionVariable
      Removes all (nested) values which are in state AssignmentState.DERIVED, i.e., all values which are propagated bay the reasoner. This will keep all user assigned AssignmentState.ASSIGNED and frozen AssignmentState.FROZEN values.
      Returns:
      true if there was a change, false if the variable keeps unchanged.