Class Container
- java.lang.Object
-
- net.ssehub.easy.varModel.model.ModelElement
-
- net.ssehub.easy.varModel.model.ContainableModelElement
-
- net.ssehub.easy.varModel.model.datatypes.CustomDatatype
-
- net.ssehub.easy.varModel.model.datatypes.StructuredDatatype
-
- net.ssehub.easy.varModel.model.datatypes.Container
-
- All Implemented Interfaces:
IDatatype,IDatatypeVisitable,IModelElement
public class Container extends StructuredDatatype
Realizes an abstract container.- Author:
- heiko beck, Holger Eichelberger
-
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description protectedContainer(java.lang.String name, DelegatingType singleton, IDatatype type, IModelElement parent)Constructor for the container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(IDatatypeVisitor visitor)Accepts a specialized visitor for creating a textual representation of the identity of this type.voidaccept(IModelVisitor visitor)Accept method for the visitor.IDatatypegetContainedType()Returns the type of the contained elements.IDatatypegetGenericType(int index)Returns the specified generic type.intgetGenericTypeCount()Returns the number of generic types.booleanisAssignableFrom(IDatatype type)Determines if the data type represented by this object is either the same as, or is a supertype oftype.static booleanisConstraintContainer(IDatatype type)Returns whethertypeis a container with one generic of type Constraint.static booleanisContainer(IDatatype type, IDatatype... generics)Returns whethertypeis a container and the givengenericsmatch.static booleanisReferencesContainer(IDatatype type)Returns iftypeis a container of references.static booleanisReferencesContainer(IDatatype type, IDatatype elementType)Returns iftypeis a container of references of the givenelementType.-
Methods inherited from class net.ssehub.easy.varModel.model.datatypes.CustomDatatype
getOperation, getOperationCount, getType, getTypeClass, isPrimitive, isPseudoType, isType
-
Methods inherited from class net.ssehub.easy.varModel.model.ContainableModelElement
getNameSpace, getParent, getProject, getQualifiedName, getTopLevelParent, isTopLevel, setParent
-
Methods inherited from class net.ssehub.easy.varModel.model.ModelElement
findAttribute, getComment, getName, getUniqueName, isTransparent, propagateAttribute, setComment, setName, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.ssehub.easy.varModel.model.datatypes.IDatatype
getName, getNameSpace, getQualifiedName, getUniqueName
-
-
-
-
Field Detail
-
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
-
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 Detail
-
Container
protected Container(java.lang.String name, DelegatingType singleton, IDatatype type, IModelElement parent)Constructor for the container.- Parameters:
name- Name of the containersingleton- the instance which knows the operationstype- data type of the container elementsparent- the object, in which this specific one is embedded
-
-
Method Detail
-
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:IDatatypeReturns the specified generic type.- Specified by:
getGenericTypein interfaceIDatatype- Overrides:
getGenericTypein classCustomDatatype- Parameters:
index- the index of the type- Returns:
- the specified generic type
-
getGenericTypeCount
public int getGenericTypeCount()
Description copied from interface:IDatatypeReturns the number of generic types.- Specified by:
getGenericTypeCountin interfaceIDatatype- Overrides:
getGenericTypeCountin classCustomDatatype- Returns:
- the number of generic types
-
accept
public void accept(IDatatypeVisitor visitor)
Description copied from interface:IDatatypeVisitableAccepts a specialized visitor for creating a textual representation of the identity of this type.- Specified by:
acceptin interfaceIDatatypeVisitable- Overrides:
acceptin classContainableModelElement- Parameters:
visitor- the visitor to accept
-
accept
public void accept(IModelVisitor visitor)
Description copied from interface:IModelElementAccept 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 oftype.- Specified by:
isAssignableFromin interfaceIDatatype- Overrides:
isAssignableFromin classCustomDatatype- Parameters:
type- the type being checked- Returns:
trueif this type is either the same or a supertype oftype,trueelse
-
isConstraintContainer
public static final boolean isConstraintContainer(IDatatype type)
Returns whethertypeis a container with one generic of type Constraint.- Parameters:
type- the type to check for- Returns:
trueiftypeis a container of Constraints,falseelse
-
isContainer
public static final boolean isContainer(IDatatype type, IDatatype... generics)
Returns whethertypeis a container and the givengenericsmatch.- Parameters:
type- the type to check forgenerics- the generics to be considered- Returns:
trueiftypeis a container with the given generics,falseelse- See Also:
isReferencesContainer(IDatatype),isReferencesContainer(IDatatype, IDatatype)
-
isReferencesContainer
public static final boolean isReferencesContainer(IDatatype type)
Returns iftypeis a container of references.- Parameters:
type- the type to check- Returns:
trueiftypeis a container of references,falseelse
-
isReferencesContainer
public static boolean isReferencesContainer(IDatatype type, IDatatype elementType)
Returns iftypeis a container of references of the givenelementType.- Parameters:
type- the type to checkelementType- the element type within the references- Returns:
trueiftypeis a container of references,falseelse- See Also:
isContainer(IDatatype, IDatatype...)
-
-