## org.eclipse.emf.ocl.types.impl
Class CollectionTypeImpl

    java.lang.Object
      org.eclipse.emf.common.notify.impl.BasicNotifierImpl
          org.eclipse.emf.ecore.impl.BasicEObjectImpl
              org.eclipse.emf.ecore.impl.EObjectImpl
                  org.eclipse.emf.ecore.impl.FlatEObjectImpl
                      org.eclipse.emf.ecore.impl.EModelElementImpl
                          org.eclipse.emf.ecore.impl.ENamedElementImpl
                              org.eclipse.emf.ecore.impl.EClassifierImpl
                                  org.eclipse.emf.ecore.impl.EDataTypeImpl
                                      org.eclipse.emf.ocl.types.impl.CollectionTypeImpl

All Implemented Interfaces:
  Notifier, EClassifier, EDataType, EModelElement, ENamedElement, EObject, InternalEObject, BasicExtendedMetaData.EClassifierExtendedMetaData.Holder, CollectionType, ASTNode, PredefinedType, TypedASTNode

Direct Known Subclasses:
  BagTypeImpl, OrderedSetTypeImpl, SequenceTypeImpl, SetTypeImpl

    public class CollectionTypeImpl

extends EDataTypeImpl
implements CollectionType

Nested Class Summary

Nested classes/interfaces inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl
`BasicEObjectImpl.EPropertiesHolder, BasicEObjectImpl.EPropertiesHolderBaseImpl, BasicEObjectImpl.EPropertiesHolderImpl`

Nested classes/interfaces inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl
`BasicNotifierImpl.EAdapterList<E extends Object & Adapter>`

Nested classes/interfaces inherited from interface org.eclipse.emf.ecore.InternalEObject
`InternalEObject.EStore`

Field Summary
`static String` `copyright`
`protected EClassifier` `elementType` The cached value of the '`Element Type`' reference
`protected static int` `END_POSITION_EDEFAULT` The default value of the '`End Position`' attribute
`protected int` `endPosition` The cached value of the '`End Position`' attribute
`protected static CollectionKind` `KIND_EDEFAULT` The default value of the '`Kind`' attribute
`static BagType` `OCL_BAG`
`static CollectionType` `OCL_COLLECTION`
`static OrderedSetType` `OCL_ORDERED_SET`
`static SequenceType` `OCL_SEQUENCE`
`static SetType` `OCL_SET`
`protected static int` `START_POSITION_EDEFAULT` The default value of the '`Start Position`' attribute
`protected int` `startPosition` The cached value of the '`Start Position`' attribute
`protected static int` `TYPE_END_POSITION_EDEFAULT` The default value of the '`Type End Position`' attribute
`protected static int` `TYPE_START_POSITION_EDEFAULT` The default value of the '`Type Start Position`' attribute
`protected int` `typeEndPosition` The cached value of the '`Type End Position`' attribute
`protected int` `typeStartPosition` The cached value of the '`Type Start Position`' attribute

Fields inherited from class org.eclipse.emf.ecore.impl.EDataTypeImpl
`defaultValue, defaultValueIsSet, SERIALIZABLE_EDEFAULT, SERIALIZABLE_EFLAG`

Fields inherited from class org.eclipse.emf.ecore.impl.EClassifierImpl
`DEFAULT_VALUE_EDEFAULT, eClassifierExtendedMetaData, eTypeParameters, generatedInstanceClassName, INSTANCE_CLASS_EDEFAULT, INSTANCE_CLASS_NAME_EDEFAULT, instanceClass, instanceClassName, instanceTypeName, metaObjectID`

Fields inherited from class org.eclipse.emf.ecore.impl.ENamedElementImpl
`name, NAME_EDEFAULT`

Fields inherited from class org.eclipse.emf.ecore.impl.EModelElementImpl
`eAnnotations, EFROZEN, ELAST_EMODEL_ELEMENT_FLAG`

Fields inherited from class org.eclipse.emf.ecore.impl.FlatEObjectImpl
`eContents, eCrossReferences, eProxyURI`

Fields inherited from class org.eclipse.emf.ecore.impl.EObjectImpl
`eAdapters, eContainer, eContainerFeatureID, EDELIVER, EDYNAMIC_CLASS, eFlags, ELAST_EOBJECT_FLAG, ELAST_NOTIFIER_FLAG, eProperties, EPROXY`

Fields inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl
`EVIRTUAL_GET, EVIRTUAL_IS_SET, EVIRTUAL_NO_VALUE, EVIRTUAL_SET, EVIRTUAL_UNSET`

Fields inherited from interface org.eclipse.emf.ocl.utilities.PredefinedType

`ABS, ABS_NAME, ALL_INSTANCES, ALL_INSTANCES_NAME, AND, AND_NAME, ANY, ANY_NAME, APPEND, APPEND_NAME, AS_BAG, AS_BAG_NAME, AS_ORDERED_SET, AS_ORDERED_SET_NAME, AS_SEQUENCE, AS_SEQUENCE_NAME, AS_SET, AS_SET_NAME, AT, AT_NAME, CLOSURE, CLOSURE_NAME, COLLECT, COLLECT_NAME, COLLECT_NESTED, COLLECT_NESTED_NAME, CONCAT, CONCAT_NAME, COUNT, COUNT_NAME, DIV, DIV_NAME, DIVIDE, DIVIDE_NAME, EQUAL, EQUAL_NAME, EXCLUDES, EXCLUDES_ALL, EXCLUDES_ALL_NAME, EXCLUDES_NAME, EXCLUDING, EXCLUDING_NAME, EXISTS, EXISTS_NAME, FIRST, FIRST_NAME, FLATTEN, FLATTEN_NAME, FLOOR, FLOOR_NAME, FOR_ALL, FOR_ALL_NAME, GREATER_THAN, GREATER_THAN_EQUAL, GREATER_THAN_EQUAL_NAME, GREATER_THAN_NAME, HAS_RETURNED, HAS_RETURNED_NAME, IMPLIES, IMPLIES_NAME, INCLUDES, INCLUDES_ALL, INCLUDES_ALL_NAME, INCLUDES_NAME, INCLUDING, INCLUDING_NAME, INDEX_OF, INDEX_OF_NAME, INSERT_AT, INSERT_AT_NAME, INTERSECTION, INTERSECTION_NAME, IS_EMPTY, IS_EMPTY_NAME, IS_OPERATION_CALL, IS_OPERATION_CALL_NAME, IS_SIGNAL_SENT, IS_SIGNAL_SENT_NAME, IS_UNIQUE, IS_UNIQUE_NAME, LAST, LAST_NAME, LESS_THAN, LESS_THAN_EQUAL, LESS_THAN_EQUAL_NAME, LESS_THAN_NAME, MAX, MAX_NAME, MIN, MIN_NAME, MINUS, MINUS_NAME, MOD, MOD_NAME, NOT, NOT_EMPTY, NOT_EMPTY_NAME, NOT_EQUAL, NOT_EQUAL_NAME, NOT_NAME, OCL_AS_TYPE, OCL_AS_TYPE_NAME, OCL_IS_IN_STATE, OCL_IS_IN_STATE_NAME, OCL_IS_INVALID, OCL_IS_INVALID_NAME, OCL_IS_KIND_OF, OCL_IS_KIND_OF_NAME, OCL_IS_NEW, OCL_IS_NEW_NAME, OCL_IS_TYPE_OF, OCL_IS_TYPE_OF_NAME, OCL_IS_UNDEFINED, OCL_IS_UNDEFINED_NAME, ONE, ONE_NAME, OR, OR_NAME, PLUS, PLUS_NAME, PREPEND, PREPEND_NAME, PRODUCT, PRODUCT_NAME, REJECT, REJECT_NAME, RELATED_TYPE, RESULT, RESULT_NAME, ROUND, ROUND_NAME, SAME_TYPE, SELECT, SELECT_NAME, SIZE, SIZE_NAME, SORTED_BY, SORTED_BY_NAME, STRICT_SUBTYPE, STRICT_SUPERTYPE, SUB_ORDERED_SET, SUB_ORDERED_SET_NAME, SUB_SEQUENCE, SUB_SEQUENCE_NAME, SUBSTRING, SUBSTRING_NAME, SUBTYPE, SUM, SUM_NAME, SUPERTYPE, SYMMETRIC_DIFFERENCE, SYMMETRIC_DIFFERENCE_NAME, TIMES, TIMES_NAME, TO_INTEGER, TO_INTEGER_NAME, TO_LOWER, TO_LOWER_NAME, TO_REAL, TO_REAL_NAME, TO_UPPER, TO_UPPER_NAME, UNION, UNION_NAME, UNRELATED_TYPE, XOR, XOR_NAME`

Fields inherited from interface org.eclipse.emf.ecore.InternalEObject
`EOPPOSITE_FEATURE_BASE`

Constructor Summary
`protected` `CollectionTypeImpl()`
`protected` `CollectionTypeImpl(EClassifier elementType)`

Method Summary
`static Collection` `append(Collection c, Object o)` Appends the supplied object to the supplied ordered collection
`static Collection` `asBag(Collection c)` Returns the supplied collection as a Bag
`static Collection` `asOrderedSet(Collection c)` Returns the supplied collection as an OrderedSet
`static Collection` `asSequence(Collection c)` Returns the supplied collection as a Sequence
`static Collection` `asSet(Collection c)` Returns the supplied collection as a Set
`static Object` `at(Collection c, int i)` Returns the object at the supplied position of the supplied ordered collection
`EClassifier` `basicGetElementType()`
`static CollectionKind` `commonSuperType(CollectionKind kind1, CollectionKind kind2)`
`static int` `count(Collection c, Object o)`
`protected static EList` `createIterators()`
`static Collection` `createNewBag()` Creates a new bag
`static Collection` `createNewBag(Collection c)` Creates a new bag with initial collection supplied
`static Collection` `createNewOrderedSet()` Creates a new java ordered set
`static Collection` `createNewOrderedSet(Collection c)` Creates a new ordered set with initial collection supplied
`static Collection` `createNewSequence()` Creates a new sequence
`static Collection` `createNewSequence(Collection c)` Creates a new sequence with initial collection supplied
`static Collection` `createNewSet()` Creates a new java set
`static Collection` `createNewSet(Collection c)` Creates a new java set with initial collection supplied
`protected static EList` `createOperations()` Initialiaze Operations defined on AnyType
`int` `eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass)`
`int` `eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass)`
`Object` `eGet(int featureID, boolean resolve, boolean coreType)`
`boolean` `eIsSet(int featureID)`
`static boolean` `equals(Collection c1, Collection c2)` Computes the equivalence of two collections, accounting for the equivalence of primitive numeric values that OCL considers equal but Java does not.
`void` `eSet(int featureID, Object newValue)`
`protected EClass` `eStaticClass()`
`void` `eUnset(int featureID)`
`static boolean` `excludes(Collection c, Object o)`
`static boolean` `excludesAll(Collection c1, Collection c2)`
`static Collection` `excluding(Collection c, Object o)` Returns all but the supplied element from the supplied collection.
`static Object` `first(Collection c)` Returns the first element of the supplied ordered collection if the ordered collection is not empty, null otherwise.
`static Collection` `flatten(Collection c)` Flattens a collection by taking the union of each of its constituent collections, if they are a collection type, or just returns the supplied collection if they are not.
`EClassifier` `getCommonSupertype(EClassifier type)`
`EClassifier` `getElementType()`
`int` `getEndPosition()`
`EList` `getIterators()`
`CollectionKind` `getKind()`
`String` `getName()`
`int` `getOperationCodeFor(String oper)` Returns the operation code from an operation name.
`String` `getOperationNameFor(int opcode)` Returns the String name of an operation.
`EList` `getOperations()` Get the list of operations supported by OCL Collection Types
`static int` `getRelationship(CollectionKind kind1, CollectionKind kind2)`
`int` `getRelationshipTo(EClassifier type)`
`EClassifier` `getResultTypeFor(EClassifier ownerType, int opcode, EList args)` Obtain the result type on a collection type operation.
`int` `getStartPosition()`
`int` `getTypeEndPosition()`
`int` `getTypeStartPosition()`
`static int` `hashCode(Collection c)` Computes the hash of a collection, accounting for the similar hashing of primitive numeric values that OCL considers equal but Java does not.
`static boolean` `includes(Collection c, Object o)`
`static boolean` `includesAll(Collection c1, Collection c2)`
`static Collection` `including(Collection c, Object element)` Returns the supplied collection with the supplied element added
`static Integer` `indexOf(Collection c, Object o)` Returns the index in the supplied collection of the supplied object or null if the object is not in the collection.
`static Collection` `insertAt(Collection c, int oclIndex, Object o)` Inserts the supplied object at the supplied position of the supplied ordered collection Note: OCL is 1-indexed!
`static Collection` `intersection(Collection c1, Collection c2)` Returns the collection containing just those elements that are in both the supplied collections.
`static boolean` `isEmpty(Collection c)`
`static Object` `last(Collection c)` Returns the last element of the supplied collection if the collection is not empty, null otherwise.
`static Set` `minus(Set s1, Set s2)` Returns all the elements in the first supplied set that are not in the second supplied set.
`static boolean` `notEmpty(Collection c)`
`static Collection` `prepend(Collection c, Object o)` Prepends the supplied object to the supplied ordered collection
`static Set` `product(Collection c1, Collection c2, EClass resultType)` Computes the product of two collections, returning a set of tuples of the resulting type.
`void` `setElementType(EClassifier newElementType)`
`void` `setEndPosition(int newEndPosition)`
`void` `setStartPosition(int newStartPosition)`
`void` `setTypeEndPosition(int newTypeEndPosition)`
`void` `setTypeStartPosition(int newTypeStartPosition)`
`static int` `size(Set s)`
`static Collection` `subOrderedSet(Collection c, int oclLower, int oclUpper)` Returns the subset of the supplied ordered collection whose elements have indices between the supplied lower and upper bounds (inclusive).
`static Collection` `subSequence(Collection c, int oclLower, int oclUpper)` Returns the subsequence of the supplied ordered collection whose elements have indices between the supplied lower and upper bounds (inclusive).
`static Object` `sum(Collection c)`
`static Set` `symmetricDifference(Set s1, Set s2)` Returns the set of all elements in one or the other of the supplied sets that are not in their intersection.
`String` `toString()`
`static Collection` `union(Collection c1, Collection c2)` Returns the collection containing all elements from both supplied collections

Methods inherited from class org.eclipse.emf.ecore.impl.EDataTypeImpl
`getDefaultValue, isSerializable, setDataTypeGeneratedInstanceClass, setGeneratedInstanceClass, setInstanceClassGen, setSerializable`

Methods inherited from class org.eclipse.emf.ecore.impl.EClassifierImpl

`basicGetEPackage, basicSetInstanceClassName, basicSetInstanceTypeName, dynamicIsInstance, eBasicRemoveFromContainerFeature, eBasicSetContainer, eInverseAdd, eInverseRemove, getClassForName, getClassifierID, getEPackage, getEPackageGen, getETypeParameters, getExtendedMetaData, getInstanceClass, getInstanceClassGen, getInstanceClassName, getInstanceClassNameGen, getInstanceTypeName, getPrimitiveOrArrayClass, isInstance, isSetInstanceClassName, isSetInstanceTypeName, setClassifierID, setExtendedMetaData, setInstanceClass, setInstanceClassName, setInstanceClassNameGen, setInstanceTypeName, setName, unsetInstanceClassName, unsetInstanceTypeName`

Methods inherited from class org.eclipse.emf.ecore.impl.ENamedElementImpl
`eContents, eCrossReferences, getNameGen`

Methods inherited from class org.eclipse.emf.ecore.impl.EModelElementImpl
`eObjectForURIFragmentSegment, eURIFragmentSegment, freeze, freeze, getEAnnotation, getEAnnotations, isFrozen, setFrozen`

Methods inherited from class org.eclipse.emf.ecore.impl.FlatEObjectImpl
`eIsProxy, eProperties, eProxyURI, eSetProxyURI`

Methods inherited from class org.eclipse.emf.ecore.impl.EObjectImpl
`eAdapters, eBasicAdapters, eBasicProperties, eClass, eContainerFeatureID, eDeliver, eInternalContainer, eSetClass, eSetDeliver`

Methods inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl

`eAddVirtualValue, eAllContents, eBasicRemoveFromContainer, eBasicSetContainer, eComputeVirtualValuesCapacity, eContainer, eContainingFeature, eContainmentFeature, eContainmentFeature, eContains, eDerivedStructuralFeatureID, eDirectResource, eDynamicBasicRemoveFromContainer, eDynamicClass, eDynamicFeature, eDynamicFeatureID, eDynamicGet, eDynamicGet, eDynamicGet, eDynamicInverseAdd, eDynamicInverseAdd, eDynamicInverseRemove, eDynamicInverseRemove, eDynamicIsSet, eDynamicIsSet, eDynamicIsSet, eDynamicSet, eDynamicSet, eDynamicSet, eDynamicUnset, eDynamicUnset, eDynamicUnset, eGet, eGet, eGet, eHasSettings, eInternalResource, eInverseAdd, eInverseRemove, eIsSet, eOpenGet, eOpenIsSet, eOpenSet, eOpenUnset, eRemoveVirtualValue, eResolveProxy, eResource, eSet, eSetDirectResource, eSetResource, eSetStore, eSetting, eSettingDelegate, eSettings, eSetVirtualIndexBits, eSetVirtualValue, eSetVirtualValues, eStaticFeatureCount, eStore, eUnset, eVirtualBitCount, eVirtualGet, eVirtualGet, eVirtualIndex, eVirtualIndexBits, eVirtualIsSet, eVirtualSet, eVirtualUnset, eVirtualValue, eVirtualValues`

Methods inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl
`eNotificationRequired, eNotify`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface org.eclipse.emf.ecore.EDataType
`isSerializable, setSerializable`

Methods inherited from interface org.eclipse.emf.ecore.EClassifier
`getClassifierID, getDefaultValue, getEPackage, getETypeParameters, getInstanceClass, getInstanceClassName, getInstanceTypeName, isInstance, setInstanceClass, setInstanceClassName, setInstanceTypeName`

Methods inherited from interface org.eclipse.emf.ecore.ENamedElement
`setName`

Methods inherited from interface org.eclipse.emf.ecore.EModelElement
`getEAnnotation, getEAnnotations`

Methods inherited from interface org.eclipse.emf.ecore.EObject
`eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eIsProxy, eIsSet, eResource, eSet, eUnset`

Methods inherited from interface org.eclipse.emf.common.notify.Notifier
`eAdapters, eDeliver, eNotify, eSetDeliver`

Methods inherited from interface org.eclipse.emf.ecore.InternalEObject
`eNotificationRequired`

Field Detail

### copyright

    public static final String copyright

  See Also:
    Constant Field Values

### START_POSITION_EDEFAULT

    protected static final int START_POSITION_EDEFAULT

  The default value of the '`Start Position`' attribute.

  See Also:
    `getStartPosition()`, Constant Field Values

### startPosition

    protected int startPosition

  The cached value of the '`Start Position`' attribute.

  See Also:
    `getStartPosition()`

### END_POSITION_EDEFAULT

    protected static final int END_POSITION_EDEFAULT

  The default value of the '`End Position`' attribute.

  See Also:
    `getEndPosition()`, Constant Field Values

### endPosition

    protected int endPosition

  The cached value of the '`End Position`' attribute.

  See Also:
    `getEndPosition()`

### TYPE_START_POSITION_EDEFAULT

    protected static final int TYPE_START_POSITION_EDEFAULT

  The default value of the '`Type Start Position`' attribute.

  See Also:
    `getTypeStartPosition()`, Constant Field Values

### typeStartPosition

    protected int typeStartPosition

  The cached value of the '`Type Start Position`' attribute.

  See Also:
    `getTypeStartPosition()`

### TYPE_END_POSITION_EDEFAULT

    protected static final int TYPE_END_POSITION_EDEFAULT

  The default value of the '`Type End Position`' attribute.

  See Also:
    `getTypeEndPosition()`, Constant Field Values

### typeEndPosition

    protected int typeEndPosition

  The cached value of the '`Type End Position`' attribute.

  See Also:
    `getTypeEndPosition()`

### OCL_SEQUENCE

    public static SequenceType OCL_SEQUENCE

### OCL_SET

    public static SetType OCL_SET

### OCL_ORDERED_SET

    public static OrderedSetType OCL_ORDERED_SET

### OCL_BAG

    public static BagType OCL_BAG

### OCL_COLLECTION

    public static CollectionType OCL_COLLECTION

### elementType

    protected EClassifier elementType

  The cached value of the '`Element Type`' reference.

  See Also:
    `getElementType()`

### KIND_EDEFAULT

    protected static final CollectionKind KIND_EDEFAULT

  The default value of the '`Kind`' attribute.

  See Also:
    `getKind()`

Constructor Detail

### CollectionTypeImpl

    protected CollectionTypeImpl()

### CollectionTypeImpl

    protected CollectionTypeImpl(EClassifier elementType)

Method Detail

### getOperationCodeFor

    public int getOperationCodeFor(String oper)

  Returns the operation code from an operation name.

  Specified by:
    `getOperationCodeFor` in interface `PredefinedType`
  Parameters:
    `oper` -
  Returns:
    the operation code

### getOperationNameFor

    public String getOperationNameFor(int opcode)

  Returns the String name of an operation.

  Specified by:
    `getOperationNameFor` in interface `PredefinedType`
  Parameters:
    `opcode` -
  Returns:
    the operation name

### createOperations

    protected static EList createOperations()

  Initialiaze Operations defined on AnyType

### createIterators

    protected static EList createIterators()

### getOperations

    public EList getOperations()

  Description copied from interface: `CollectionType`
  Get the list of operations supported by OCL Collection Types

  Specified by:
    `getOperations` in interface `CollectionType`
  Specified by:
    `getOperations` in interface `PredefinedType`
  Returns:
    the operations

### getIterators

    public EList getIterators()

### getName

    public String getName()

  Specified by:
    `getName` in interface `ENamedElement`
  Overrides:
    `getName` in class `ENamedElementImpl`

### getResultTypeFor

    public EClassifier getResultTypeFor(EClassifier ownerType,
                                        int opcode,
                                        EList args)
                                 throws SemanticException

  Obtain the result type on a collection type operation. A conformance test is performed, and the result type may be the common supertype of the source and argument types, depending on the operation.

  Specified by:
    `getResultTypeFor` in interface `PredefinedType`
  Parameters:
    `opcode` -
    `args` -
  Returns:
    the result type
  Throws:
    `SemanticException`

### getRelationshipTo

    public int getRelationshipTo(EClassifier type)

  Specified by:
    `getRelationshipTo` in interface `PredefinedType`

### getCommonSupertype

    public EClassifier getCommonSupertype(EClassifier type)
                                   throws SemanticException

  Specified by:
    `getCommonSupertype` in interface `PredefinedType`
  Throws:
    `SemanticException`

### commonSuperType

    public static CollectionKind commonSuperType(CollectionKind kind1,
                                                 CollectionKind kind2)

### getRelationship

    public static int getRelationship(CollectionKind kind1,
                                      CollectionKind kind2)

### eStaticClass

    protected EClass eStaticClass()

  Overrides:
    `eStaticClass` in class `EDataTypeImpl`

### getStartPosition

    public int getStartPosition()

  Specified by:
    `getStartPosition` in interface `ASTNode`
  Returns:
    the value of the 'Start Position' attribute.
  See Also:
    `ASTNode.setStartPosition(int)`, `UtilitiesPackage.getASTNode_StartPosition()`

### setStartPosition

    public void setStartPosition(int newStartPosition)

  Specified by:
    `setStartPosition` in interface `ASTNode`
  Parameters:
    `newStartPosition` - the new value of the 'Start Position' attribute.
  See Also:
    `ASTNode.getStartPosition()`

### getEndPosition

    public int getEndPosition()

  Specified by:
    `getEndPosition` in interface `ASTNode`
  Returns:
    the value of the 'End Position' attribute.
  See Also:
    `ASTNode.setEndPosition(int)`, `UtilitiesPackage.getASTNode_EndPosition()`

### setEndPosition

    public void setEndPosition(int newEndPosition)

  Specified by:
    `setEndPosition` in interface `ASTNode`
  Parameters:
    `newEndPosition` - the new value of the 'End Position' attribute.
  See Also:
    `ASTNode.getEndPosition()`

### getTypeStartPosition

    public int getTypeStartPosition()

  Specified by:
    `getTypeStartPosition` in interface `TypedASTNode`
  Returns:
    the value of the 'Type Start Position' attribute.
  See Also:
    `TypedASTNode.setTypeStartPosition(int)`, `UtilitiesPackage.getTypedASTNode_TypeStartPosition()`

### setTypeStartPosition

    public void setTypeStartPosition(int newTypeStartPosition)

  Specified by:
    `setTypeStartPosition` in interface `TypedASTNode`
  Parameters:
    `newTypeStartPosition` - the new value of the 'Type Start Position' attribute.
  See Also:
    `TypedASTNode.getTypeStartPosition()`

### getTypeEndPosition

    public int getTypeEndPosition()

  Specified by:
    `getTypeEndPosition` in interface `TypedASTNode`
  Returns:
    the value of the 'Type End Position' attribute.
  See Also:
    `TypedASTNode.setTypeEndPosition(int)`, `UtilitiesPackage.getTypedASTNode_TypeEndPosition()`

### setTypeEndPosition

    public void setTypeEndPosition(int newTypeEndPosition)

  Specified by:
    `setTypeEndPosition` in interface `TypedASTNode`
  Parameters:
    `newTypeEndPosition` - the new value of the 'Type End Position' attribute.
  See Also:
    `TypedASTNode.getTypeEndPosition()`

### getElementType

    public EClassifier getElementType()

  Specified by:
    `getElementType` in interface `CollectionType`

### basicGetElementType

    public EClassifier basicGetElementType()

### setElementType

    public void setElementType(EClassifier newElementType)

  Specified by:
    `setElementType` in interface `CollectionType`
  Parameters:
    `newElementType` - the new value of the 'Element Type' reference.
  See Also:
    `CollectionType.getElementType()`

### getKind

    public CollectionKind getKind()

  Specified by:
    `getKind` in interface `CollectionType`
  Returns:
    the value of the 'Kind' attribute.
  See Also:
    `CollectionKind`, `TypesPackage.getCollectionType_Kind()`

### eGet

    public Object eGet(int featureID,
                       boolean resolve,
                       boolean coreType)

  Specified by:
    `eGet` in interface `InternalEObject`
  Overrides:
    `eGet` in class `EDataTypeImpl`

### eSet

    public void eSet(int featureID,
                     Object newValue)

  Specified by:
    `eSet` in interface `InternalEObject`
  Overrides:
    `eSet` in class `EDataTypeImpl`

### eUnset

    public void eUnset(int featureID)

  Specified by:
    `eUnset` in interface `InternalEObject`
  Overrides:
    `eUnset` in class `EDataTypeImpl`

### eIsSet

    public boolean eIsSet(int featureID)

  Specified by:
    `eIsSet` in interface `InternalEObject`
  Overrides:
    `eIsSet` in class `EDataTypeImpl`

### eBaseStructuralFeatureID

    public int eBaseStructuralFeatureID(int derivedFeatureID,
                                        Class baseClass)

  Specified by:
    `eBaseStructuralFeatureID` in interface `InternalEObject`
  Overrides:
    `eBaseStructuralFeatureID` in class `BasicEObjectImpl`

### eDerivedStructuralFeatureID

    public int eDerivedStructuralFeatureID(int baseFeatureID,
                                           Class baseClass)

  Specified by:
    `eDerivedStructuralFeatureID` in interface `InternalEObject`
  Overrides:
    `eDerivedStructuralFeatureID` in class `BasicEObjectImpl`

### toString

    public String toString()

  Overrides:
    `toString` in class `EDataTypeImpl`

### size

    public static int size(Set s)

### includes

    public static boolean includes(Collection c,
                                   Object o)

### excludes

    public static boolean excludes(Collection c,
                                   Object o)

### count

    public static int count(Collection c,
                            Object o)

### includesAll

    public static boolean includesAll(Collection c1,
                                      Collection c2)

### excludesAll

    public static boolean excludesAll(Collection c1,
                                      Collection c2)

### isEmpty

    public static boolean isEmpty(Collection c)

### notEmpty

    public static boolean notEmpty(Collection c)

### sum

    public static Object sum(Collection c)

### equals

    public static boolean equals(Collection c1,
                                 Collection c2)

  Computes the equivalence of two collections, accounting for the equivalence of primitive numeric values that OCL considers equal but Java does not.

  Parameters:
    `c1` - a collection
    `c2` - another collection
  Returns:
    whether they are equivalent as far as OCL is concerned

### hashCode

    public static int hashCode(Collection c)

  Computes the hash of a collection, accounting for the similar hashing of primitive numeric values that OCL considers equal but Java does not.

  Parameters:
    `c` - a collection
  Returns:
    its hash

### intersection

    public static Collection intersection(Collection c1,
                                          Collection c2)

  Returns the collection containing just those elements that are in both the supplied collections.

  Parameters:
    `c1` - the collection.
    `c2` - the other collection.
  Returns:
    the collection: c1 intersection c2.

### union

    public static Collection union(Collection c1,
                                   Collection c2)

  Returns the collection containing all elements from both supplied collections

  Parameters:
    `c1` - one collection.
    `c2` - the other collection.
  Returns:
    the collection: c1 union c2.

### flatten

    public static Collection flatten(Collection c)

  Flattens a collection by taking the union of each of its constituent collections, if they are a collection type, or just returns the supplied collection if they are not.

  Parameters:
    `c` - the collection to flatten
  Returns:
    the flattened collection

### minus

    public static Set minus(Set s1,
                            Set s2)

  Returns all the elements in the first supplied set that are not in the second supplied set.

  Parameters:
    `s1` - the first set.
    `s2` - the second set.
  Returns:
    the collection c1-c2.

### excluding

    public static Collection excluding(Collection c,
                                       Object o)

  Returns all but the supplied element from the supplied collection. For collections in which an element may appear more than once, all elements with that value are removed.

  Parameters:
    `c` - the collection
    `o` - the element
  Returns:
    the collection without the element

### symmetricDifference

    public static Set symmetricDifference(Set s1,
                                          Set s2)

  Returns the set of all elements in one or the other of the supplied sets that are not in their intersection.

  Parameters:
    `s1` - one set
    `s2` - the other set
  Returns:
    the symmetric difference (i.e. (s1 union s2) - (s1 intersection s2))

### including

    public static Collection including(Collection c,
                                       Object element)

  Returns the supplied collection with the supplied element added

  Parameters:
    `c` - the collection
    `element` - the element
  Returns:
    the collection with the element

### asSet

    public static Collection asSet(Collection c)

  Returns the supplied collection as a Set

  Parameters:
    `c` - the collection
  Returns:
    a set with each element of the supplied collection added to it.

### asBag

    public static Collection asBag(Collection c)

  Returns the supplied collection as a Bag

  Parameters:
    `c` - the collection
  Returns:
    a bag with each element of the supplied collection added to it.

### asSequence

    public static Collection asSequence(Collection c)

  Returns the supplied collection as a Sequence

  Parameters:
    `c` - the collection
  Returns:
    a sequence with each element of the supplied collection added to it.

### asOrderedSet

    public static Collection asOrderedSet(Collection c)

  Returns the supplied collection as an OrderedSet

  Parameters:
    `c` - the collection
  Returns:
    an orderedset with each element of the supplied collection added to it.

### product

    public static Set product(Collection c1,
                              Collection c2,
                              EClass resultType)

  Computes the product of two collections, returning a set of tuples of the resulting type.

  Parameters:
    `c1` - a collection
    `c2` - another collection
    `resultType` - the resulting tuple type
  Returns:
    the set of tuples

### append

    public static Collection append(Collection c,
                                    Object o)

  Appends the supplied object to the supplied ordered collection

  Parameters:
    `c` - the collection
    `o` - the object
  Returns:
    the supplied ordered collection with the new element at the end

### prepend

    public static Collection prepend(Collection c,
                                     Object o)

  Prepends the supplied object to the supplied ordered collection

  Parameters:
    `c` - the collection
    `o` - the object
  Returns:
    the supplied ordered collection with the new element at the beginning

### insertAt

    public static Collection insertAt(Collection c,
                                      int oclIndex,
                                      Object o)

  Inserts the supplied object at the supplied position of the supplied ordered collection

  Note: OCL is 1-indexed!

  Parameters:
    `c` - the collection.
    `oclIndex` - the position to insert at.
    `o` - the object to insert.
  Returns:
    the ordered collection with the object inserted at the position.

### subOrderedSet

    public static Collection subOrderedSet(Collection c,
                                           int oclLower,
                                           int oclUpper)

  Returns the subset of the supplied ordered collection whose elements have indices between the supplied lower and upper bounds (inclusive).

  Parameters:
    `c` - the collection
    `oclLower` - the lower bound.
    `oclUpper` - the upper bound.
  Returns:
    the ordered sub-collection between the lower and upper bounds.

### subSequence

    public static Collection subSequence(Collection c,
                                         int oclLower,
                                         int oclUpper)

  Returns the subsequence of the supplied ordered collection whose elements have indices between the supplied lower and upper bounds (inclusive).

  Parameters:
    `c` - the collection
    `oclLower` - the lower bound.
    `oclUpper` - the upper bound.
  Returns:
    the subsequence between the lower and upper bounds.

### at

    public static Object at(Collection c,
                            int i)

  Returns the object at the supplied position of the supplied ordered collection

  Parameters:
    `c` - the collection
    `i` - the position.
  Returns:
    the object in s at position i (or null if there is no object at that position). Note: OCL is 1-indexed!

### first

    public static Object first(Collection c)

  Returns the first element of the supplied ordered collection if the ordered collection is not empty, null otherwise.

  Parameters:
    `c` - the collection
  Returns:
    the first element of the collection or null.

### last

    public static Object last(Collection c)

  Returns the last element of the supplied collection if the collection is not empty, null otherwise.

  Parameters:
    `c` - the collection
  Returns:
    the last element of the collection or null.

### indexOf

    public static Integer indexOf(Collection c,
                                  Object o)

  Returns the index in the supplied collection of the supplied object or null if the object is not in the collection.

  Parameters:
    `c` - the collection.
    `o` - the object.
  Returns:
    the index (1-based) of the object in the collection.

### createNewSet

    public static Collection createNewSet()

  Creates a new java set

### createNewSet

    public static Collection createNewSet(Collection c)

  Creates a new java set with initial collection supplied

### createNewBag

    public static Collection createNewBag()

  Creates a new bag

### createNewBag

    public static Collection createNewBag(Collection c)

  Creates a new bag with initial collection supplied

### createNewOrderedSet

    public static Collection createNewOrderedSet()

  Creates a new java ordered set

### createNewOrderedSet

    public static Collection createNewOrderedSet(Collection c)

  Creates a new ordered set with initial collection supplied

### createNewSequence

    public static Collection createNewSequence()

  Creates a new sequence

### createNewSequence

    public static Collection createNewSequence(Collection c)

  Creates a new sequence with initial collection supplied

Copyright 2002, 2007 IBM Corporation and others. All Rights Reserved.