Class ContainerVariable

    • Constructor Detail

      • ContainerVariable

        protected ContainerVariable​(IConfigurationElement parent,
                                    AbstractVariable varDeclaration,
                                    boolean isVisible,
                                    boolean isAttribute)
        Sole constructor for this class.
        Parameters:
        parent - the parent this variable is part of, typically the Configuration instance, but in case of compounds/container also the containing IDecisionVariable
        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 Detail

      • clear

        void clear()
        Clears the list.
      • 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
      • indexOf

        public int indexOf​(IDecisionVariable var)
        Returns the 0-based index of var in this container.
        Parameters:
        var - the variable to search for
        Returns:
        the index of var or -1 if not found
      • freeze

        public void freeze​(java.lang.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.
      • allowsNestedStates

        boolean allowsNestedStates()
        Description copied from class: StructuredVariable
        Returns whether this variable support individual states for nested items.
        Specified by:
        allowsNestedStates in class StructuredVariable
        Returns:
        true if nested items can have their own states, otherwise false.
      • getElementName

        protected java.lang.String getElementName​(int index)
        Returns the symbolic name for an element in this container, such as the index for sequences.
        Parameters:
        index - the position of the element within the container
        Returns:
        the symbolic name
      • addNestedElement

        public IDecisionVariable addNestedElement()
        Adds a new nested element to this variable. This nested element is empty, is in state AssignmentState.UNDEFINED and can be configured afterwards.
        Returns:
        the created decision variable
      • getContainedType

        public IDatatype getContainedType()
        Returns the contained type of this container.
        Returns:
        the contained type
      • addNestedElement

        public IDecisionVariable addNestedElement​(IDatatype type)
        Adds a new nested element to this variable. This nested element is empty, is in state AssignmentState.UNDEFINED and can be configured afterwards.
        Parameters:
        type - the specific type to create the nested element for; if null, the declared contained type is used; if not assignable to the declared contained type, the declared contained type is used instead
        Returns:
        the created decision variable
      • notifyWasAssigned

        public boolean notifyWasAssigned​(Value value)
        Description copied from interface: IDecisionVariable
        Inform the variable independent of its own tracking that we believe that a value was assigned (although we did not due to equal values/performance reasons), in particular after resetting the track through CommandAssignmentState#compareTo(CommandAssignmentState).
        Specified by:
        notifyWasAssigned in interface IDecisionVariable
        Overrides:
        notifyWasAssigned in class DecisionVariable
        Parameters:
        value - the new value
        Returns:
        true whether this variable was defined before, false else