Class FreezeVariableType

All Implemented Interfaces:
IDatatype, IDatatypeVisitable, IModelElement

public class FreezeVariableType extends StructuredDatatype
An internal type for freezes to iterate / specify expressions on freezables.
Author:
Holger Eichelberger
  • Field Details

    • DTYPE

      static final DelegatingType DTYPE
    • TYPE

      public static final IDatatype TYPE
      This constant represents the common type of all freeze variables. Each specific freeze variable type is assignable to this type.
    • NAME

      public static final Operation NAME
    • NAME2

      public static final Operation NAME2
    • QNAME

      public static final Operation QNAME
    • QNAME2

      public static final Operation QNAME2
    • attributes

      private List<Attribute> attributes
  • Constructor Details

    • FreezeVariableType

      private FreezeVariableType()
      Creates the singleton instance for TYPE.
    • FreezeVariableType

      public FreezeVariableType(IFreezable[] freezables, IModelElement parent)
      Constructor for a specific freeze variable type.
      Parameters:
      freezables - the freezables to derive the structure of this type from
      parent - the object, in which this specific one is embedded
  • Method Details

    • indexAttributes

      private void indexAttributes(IFreezable freezable, Map<String,Attribute> attributes)
      Indexes all attributes for adding them to the internal type.
      Parameters:
      freezable - the freezable to be analyzed
      attributes - the name-attributes map (modified as a side effect)
    • accept

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

      public boolean isAssignableFrom(IDatatype type)
      Description copied from class: CustomDatatype
      Determines if the data type represented by this object is either the same as, or is a supertype of type.
      Specified by:
      isAssignableFrom in interface IDatatype
      Overrides:
      isAssignableFrom in class CustomDatatype
      Parameters:
      type - the type being checked
      Returns:
      true if this type is either the same or a supertype of type, true else
    • addAttribute

      void addAttribute(Attribute attribute)
      Adds an attribute to this type.
      Parameters:
      attribute - the attribute to be added
    • getAttributesCount

      public int getAttributesCount()
      Returns the number of attributes.
      Returns:
      the number of attributes
    • getAttribute

      public Attribute getAttribute(int index)
      Returns the specified attribute.
      Parameters:
      index - the 0-based index of the attribute to return
      Returns:
      the specified attribute
      Throws:
      IndexOutOfBoundsException - if index<0 || index>=getAttributesCount()
    • getAttribute

      public Attribute getAttribute(String name)
      Returns the attribute of the given name.
      Parameters:
      name - the name of the attribute
      Returns:
      the attribute or null if none was found