Class Container

All Implemented Interfaces:
IDatatype, IDatatypeVisitable, IModelElement
Direct Known Subclasses:
Sequence, Set

public class Container extends StructuredDatatype
Realizes an abstract container.
Author:
heiko beck, Holger Eichelberger
  • Field Details

    • DTYPE

      static final DelegatingType DTYPE
    • TYPE

      public static final IDatatype TYPE
      This constant represents the common type of all sets. Each specific sequence type is assignable to this type.
    • SIZE

      public static final Operation SIZE
    • UNEQUALS

      public static final Operation UNEQUALS
    • UNEQUALS_ALIAS

      public static final Operation UNEQUALS_ALIAS
    • INCLUDES

      public static final Operation INCLUDES
    • EXCLUDES

      public static final Operation EXCLUDES
    • INCLUDES_ALL

      public static final Operation INCLUDES_ALL
    • EXCLUDES_ALL

      public static final Operation EXCLUDES_ALL
    • COUNT

      public static final Operation COUNT
    • IS_EMPTY

      public static final Operation IS_EMPTY
    • NOT_EMPTY

      public static final Operation NOT_EMPTY
    • SUM

      public static final Operation SUM
    • PRODUCT

      public static final Operation PRODUCT
    • MIN

      public static final Operation MIN
    • MAX

      public static final Operation MAX
    • AVG

      public static final Operation AVG
    • TYPE_OF

      public static final Operation TYPE_OF
    • ITERATE

      public static final Operation ITERATE
    • APPLY

      public static final Operation APPLY
    • FORALL

      public static final Operation FORALL
    • EXISTS

      public static final Operation EXISTS
    • ANY

      public static final Operation ANY
    • ONE

      public static final Operation ONE
    • IS_UNIQUE

      public static final Operation IS_UNIQUE
    • COLLECT

      public static final Operation COLLECT
    • COLLECT_NESTED

      public static final Operation COLLECT_NESTED
    • SORTED_BY

      public static final Operation SORTED_BY
    • SELECT

      public static final Operation SELECT
    • REJECT

      public static final Operation REJECT
    • IS_ACYCLIC

      public static final Operation IS_ACYCLIC
    • CLOSURE

      public static final Operation CLOSURE
    • MIN2

      public static final Operation MIN2
    • MAX2

      public static final Operation MAX2
    • IS_DEFINED

      public static final Operation IS_DEFINED
    • IF_DEFINED

      public static final Operation IF_DEFINED
    • COPY

      public static final Operation COPY
    • SELECT_BY_TYPE

      public static final Operation SELECT_BY_TYPE
    • TYPE_SELECT

      public static final Operation TYPE_SELECT
    • SELECT_BY_KIND

      public static final Operation SELECT_BY_KIND
    • TYPE_REJECT

      public static final Operation TYPE_REJECT
    • type

      private IDatatype type
  • Constructor Details

    • Container

      protected Container(String name, DelegatingType singleton, IDatatype type, IModelElement parent)
      Constructor for the container.
      Parameters:
      name - Name of the container
      singleton - the instance which knows the operations
      type - data type of the container elements
      parent - the object, in which this specific one is embedded
  • Method Details

    • getContainedType

      public IDatatype getContainedType()
      Returns the type of the contained elements.
      Returns:
      the type of the contained elements
    • getGenericType

      public IDatatype getGenericType(int index)
      Description copied from interface: IDatatype
      Returns the specified generic type.
      Specified by:
      getGenericType in interface IDatatype
      Overrides:
      getGenericType in class CustomDatatype
      Parameters:
      index - the index of the type
      Returns:
      the specified generic type
    • getGenericTypeCount

      public int getGenericTypeCount()
      Description copied from interface: IDatatype
      Returns the number of generic types.
      Specified by:
      getGenericTypeCount in interface IDatatype
      Overrides:
      getGenericTypeCount in class CustomDatatype
      Returns:
      the number of generic types
    • accept

      public void accept(IDatatypeVisitor visitor)
      Description copied from interface: IDatatypeVisitable
      Accepts a specialized visitor for creating a textual representation of the identity of this type.
      Specified by:
      accept in interface IDatatypeVisitable
      Overrides:
      accept in class ContainableModelElement
      Parameters:
      visitor - the visitor to accept
    • 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)
      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
    • isConstraintContainer

      public static final boolean isConstraintContainer(IDatatype type)
      Returns whether type is a container with one generic of type Constraint.
      Parameters:
      type - the type to check for
      Returns:
      true if type is a container of Constraints, false else
    • isContainer

      public static final boolean isContainer(IDatatype type, IDatatype... generics)
      Returns whether type is a container and the given generics match.
      Parameters:
      type - the type to check for
      generics - the generics to be considered
      Returns:
      true if type is a container with the given generics, false else
      See Also:
    • isReferencesContainer

      public static final boolean isReferencesContainer(IDatatype type)
      Returns if type is a container of references.
      Parameters:
      type - the type to check
      Returns:
      true if type is a container of references, false else
    • isReferencesContainer

      public static boolean isReferencesContainer(IDatatype type, IDatatype elementType)
      Returns if type is a container of references of the given elementType.
      Parameters:
      type - the type to check
      elementType - the element type within the references
      Returns:
      true if type is a container of references, false else
      See Also: