Class DecisionVariableDeclaration

All Implemented Interfaces:
net.ssehub.easy.basics.modelManagement.IVariable, IDatatypeVisitable, IDerivedDatatypeListener, IAttributableElement, IAttributeAccess, IFreezable, IModelElement
Direct Known Subclasses:
ConstantDecisionVariableDeclaration, ExplicitTypeVariableDeclaration, ProjectDecisionVariableDeclaration

public class DecisionVariableDeclaration extends AbstractVariable implements IFreezable, IAttributableElement, net.ssehub.easy.basics.modelManagement.IVariable
Implements a decision variable.
Author:
Marcel Lueder, Holger Eichelberger
  • Field Details

  • Constructor Details

    • DecisionVariableDeclaration

      DecisionVariableDeclaration()
      Constructor for serialization.
    • DecisionVariableDeclaration

      public DecisionVariableDeclaration(String name, IDatatype type, IModelElement parent)
      Constructor for decision variable declaration.
      Parameters:
      name - Name of the decision variable declaration
      type - type of the new VariableDeclaration
      parent - the object, in which this specific one is embedded
  • Method Details

    • accept

      public void accept(IModelVisitor visitor)
      Description copied from interface: IFreezable
      Accept method for the visitor.
      Specified by:
      accept in interface IFreezable
      Specified by:
      accept in interface IModelElement
      Parameters:
      visitor - The visitor, which should process this model element.
    • addAttribute

      private boolean addAttribute(Attribute attribute)
      Adds an attribute.
      Parameters:
      attribute - the attribute to be added
      Returns:
      true if the operation was successful, false if the element is about being attributed multiple times with the same attribute
    • attribute

      public boolean attribute(Attribute attribute)
      Attributes this element.
      Specified by:
      attribute in interface IAttributableElement
      Parameters:
      attribute - the attribute to be added
      Returns:
      true if the operation was successful, false if the element is about being attributed multiple times with the same attribute
    • getAttributesCount

      public int getAttributesCount()
      Returns the number of attributes.
      Specified by:
      getAttributesCount in interface IAttributeAccess
      Returns:
      the number of attributes
    • getAttribute

      public Attribute getAttribute(int index)
      Returns a specific attribute.
      Specified by:
      getAttribute in interface IAttributeAccess
      Parameters:
      index - the index of the attribute
      Returns:
      the attribute
      Throws:
      IndexOutOfBoundsException - if index<0 || index>=getAttributesCount()
    • getAttribute

      public Attribute getAttribute(String name)
      Returns a specific attribute.
      Specified by:
      getAttribute in interface IAttributeAccess
      Parameters:
      name - the name of the attribute
      Returns:
      the attribute (or null if not found)
    • isTemporaryVariable

      public boolean isTemporaryVariable()
      Description copied from class: AbstractVariable
      Returns whether this decision variable declaration is used as a temporary variable (in constraints, i.e. the parent is a constraint).
      Specified by:
      isTemporaryVariable in class AbstractVariable
      Returns:
      true if it is a temporary variable, false if it is a defined variable in the model
    • isTemporaryDeclarator

      public boolean isTemporaryDeclarator()
      Returns whether this variable is a temporary declarator, i.e., a temporary variable create to quality an unqualified container iterator.
      Returns:
      true for temporary, false else
    • isAttribute

      public boolean isAttribute()
      Returns whether this variable is an attribute.
      Specified by:
      isAttribute in class AbstractVariable
      Returns:
      true if it is an attribute, false else
    • propagateAttribute

      public boolean propagateAttribute(Attribute attribute)
      Description copied from interface: IModelElement
      Propagates an attribute application from the parent to this element or contained elements. This may imply the creation of clones of the given attribute.
      Specified by:
      propagateAttribute in interface IModelElement
      Overrides:
      propagateAttribute in class ModelElement
      Parameters:
      attribute - the attribute to be propagated
      Returns:
      true if the operation was successful, false if the element is about being attributed multiple times with the same attribute
    • logger

      private static net.ssehub.easy.basics.logger.EASyLoggerFactory.EASyLogger logger()
      Logger.
      Returns:
      logger
    • isDeclaratorTypeExplicit

      public boolean isDeclaratorTypeExplicit()
      In case that this instance is used as a (set operation) declarator, was the type declared explicitly in the model?
      Returns:
      false if not explicit, true if explicit
    • isConstant

      public boolean isConstant()
      Description copied from class: AbstractVariable
      Returns whether this variable is a constant.
      Specified by:
      isConstant in class AbstractVariable
      Returns:
      true for constant, false else