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

java.lang.Object
  extended byorg.eclipse.emf.common.notify.impl.BasicNotifierImpl
      extended byorg.eclipse.emf.ecore.impl.BasicEObjectImpl
          extended byorg.eclipse.emf.ecore.impl.EObjectImpl
              extended byorg.eclipse.emf.ecore.impl.FlatEObjectImpl
                  extended byorg.eclipse.emf.ecore.impl.EModelElementImpl
                      extended byorg.eclipse.emf.ecore.impl.ENamedElementImpl
                          extended byorg.eclipse.emf.ecore.impl.EClassifierImpl
                              extended byorg.eclipse.emf.ecore.impl.EDataTypeImpl
                                  extended byorg.eclipse.emf.ocl.types.impl.CollectionTypeImpl
All Implemented Interfaces:
ASTNode, org.eclipse.emf.ecore.util.BasicExtendedMetaData.EClassifierExtendedMetaData.Holder, CollectionType, org.eclipse.emf.ecore.EClassifier, org.eclipse.emf.ecore.EDataType, org.eclipse.emf.ecore.EModelElement, org.eclipse.emf.ecore.ENamedElement, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.InternalEObject, org.eclipse.emf.common.notify.Notifier, PredefinedType, TypedASTNode
Direct Known Subclasses:
BagTypeImpl, OrderedSetTypeImpl, SequenceTypeImpl, SetTypeImpl

public class CollectionTypeImpl
extends org.eclipse.emf.ecore.impl.EDataTypeImpl
implements CollectionType


Nested Class Summary
 
Nested classes inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl
org.eclipse.emf.ecore.impl.BasicEObjectImpl.EPropertiesHolder, org.eclipse.emf.ecore.impl.BasicEObjectImpl.EPropertiesHolderBaseImpl, org.eclipse.emf.ecore.impl.BasicEObjectImpl.EPropertiesHolderImpl
 
Nested classes inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl
org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EAdapterList
 
Nested classes inherited from class org.eclipse.emf.ecore.InternalEObject
org.eclipse.emf.ecore.InternalEObject.EStore
 
Field Summary
static java.lang.String copyright
           
protected  org.eclipse.emf.ecore.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, generatedInstanceClassName, INSTANCE_CLASS_EDEFAULT, INSTANCE_CLASS_NAME_EDEFAULT, instanceClass, instanceClassName, 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(org.eclipse.emf.ecore.EClassifier elementType)
           
 
Method Summary
static java.util.Collection append(java.util.Collection c, java.lang.Object o)
          Appends the supplied object to the supplied ordered collection
static java.util.Collection asBag(java.util.Collection c)
          Returns the supplied collection as a Bag
static java.util.Collection asOrderedSet(java.util.Collection c)
          Returns the supplied collection as an OrderedSet
static java.util.Collection asSequence(java.util.Collection c)
          Returns the supplied collection as a Sequence
static java.util.Collection asSet(java.util.Collection c)
          Returns the supplied collection as a Set
static java.lang.Object at(java.util.Collection c, int i)
          Returns the object at the supplied position of the supplied ordered collection
 org.eclipse.emf.ecore.EClassifier basicGetElementType()
           
static CollectionKind commonSuperType(CollectionKind kind1, CollectionKind kind2)
           
static int count(java.util.Collection c, java.lang.Object o)
           
protected static org.eclipse.emf.common.util.EList createIterators()
           
static java.util.Collection createNewBag()
          Creates a new bag
static java.util.Collection createNewBag(java.util.Collection c)
          Creates a new bag with initial collection supplied
static java.util.Collection createNewOrderedSet()
          Creates a new java ordered set
static java.util.Collection createNewOrderedSet(java.util.Collection c)
          Creates a new ordered set with initial collection supplied
static java.util.Collection createNewSequence()
          Creates a new sequence
static java.util.Collection createNewSequence(java.util.Collection c)
          Creates a new sequence with initial collection supplied
static java.util.Collection createNewSet()
          Creates a new java set
static java.util.Collection createNewSet(java.util.Collection c)
          Creates a new java set with initial collection supplied
protected static org.eclipse.emf.common.util.EList createOperations()
          Initialiaze Operations defined on AnyType
 int eBaseStructuralFeatureID(int derivedFeatureID, java.lang.Class baseClass)
           
 int eDerivedStructuralFeatureID(int baseFeatureID, java.lang.Class baseClass)
           
 java.lang.Object eGet(int featureID, boolean resolve, boolean coreType)
           
 boolean eIsSet(int featureID)
           
static boolean equals(java.util.Collection c1, java.util.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, java.lang.Object newValue)
           
protected  org.eclipse.emf.ecore.EClass eStaticClass()
           
 void eUnset(int featureID)
           
static boolean excludes(java.util.Collection c, java.lang.Object o)
           
static boolean excludesAll(java.util.Collection c1, java.util.Collection c2)
           
static java.util.Collection excluding(java.util.Collection c, java.lang.Object o)
          Returns all but the supplied element from the supplied collection.
static java.lang.Object first(java.util.Collection c)
          Returns the first element of the supplied ordered collection if the ordered collection is not empty, null otherwise.
static java.util.Collection flatten(java.util.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.
 org.eclipse.emf.ecore.EClassifier getCommonSupertype(org.eclipse.emf.ecore.EClassifier type)
           
 org.eclipse.emf.ecore.EClassifier getElementType()
           
 int getEndPosition()
           
 org.eclipse.emf.common.util.EList getIterators()
           
 CollectionKind getKind()
           
 java.lang.String getName()
           
 int getOperationCodeFor(java.lang.String oper)
          Returns the operation code from an operation name.
 java.lang.String getOperationNameFor(int opcode)
          Returns the String name of an operation.
 org.eclipse.emf.common.util.EList getOperations()
          Get the list of operations supported by OCL Collection Types
static int getRelationship(CollectionKind kind1, CollectionKind kind2)
           
 int getRelationshipTo(org.eclipse.emf.ecore.EClassifier type)
           
 org.eclipse.emf.ecore.EClassifier getResultTypeFor(org.eclipse.emf.ecore.EClassifier ownerType, int opcode, org.eclipse.emf.common.util.EList args)
          Obtain the result type on a collection type operation.
 int getStartPosition()
           
 int getTypeEndPosition()
           
 int getTypeStartPosition()
           
static int hashCode(java.util.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(java.util.Collection c, java.lang.Object o)
           
static boolean includesAll(java.util.Collection c1, java.util.Collection c2)
           
static java.util.Collection including(java.util.Collection c, java.lang.Object element)
          Returns the supplied collection with the supplied element added
static java.lang.Integer indexOf(java.util.Collection c, java.lang.Object o)
          Returns the index in the supplied collection of the supplied object or null if the object is not in the collection.
static java.util.Collection insertAt(java.util.Collection c, int oclIndex, java.lang.Object o)
          Inserts the supplied object at the supplied position of the supplied ordered collection Note: OCL is 1-indexed!
static java.util.Collection intersection(java.util.Collection c1, java.util.Collection c2)
          Returns the collection containing just those elements that are in both the supplied collections.
static boolean isEmpty(java.util.Collection c)
           
static java.lang.Object last(java.util.Collection c)
          Returns the last element of the supplied collection if the collection is not empty, null otherwise.
static java.util.Set minus(java.util.Set s1, java.util.Set s2)
          Returns all the elements in the first supplied set that are not in the second supplied set.
static boolean notEmpty(java.util.Collection c)
           
static java.util.Collection prepend(java.util.Collection c, java.lang.Object o)
          Prepends the supplied object to the supplied ordered collection
static java.util.Set product(java.util.Collection c1, java.util.Collection c2, org.eclipse.emf.ecore.EClass resultType)
          Computes the product of two collections, returning a set of tuples of the resulting type.
 void setElementType(org.eclipse.emf.ecore.EClassifier newElementType)
           
 void setEndPosition(int newEndPosition)
           
 void setStartPosition(int newStartPosition)
           
 void setTypeEndPosition(int newTypeEndPosition)
           
 void setTypeStartPosition(int newTypeStartPosition)
           
static int size(java.util.Set s)
           
static java.util.Collection subOrderedSet(java.util.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 java.util.Collection subSequence(java.util.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 java.lang.Object sum(java.util.Collection c)
           
static java.util.Set symmetricDifference(java.util.Set s1, java.util.Set s2)
          Returns the set of all elements in one or the other of the supplied sets that are not in their intersection.
 java.lang.String toString()
           
static java.util.Collection union(java.util.Collection c1, java.util.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, dynamicIsInstance, eBasicRemoveFromContainerFeature, eBasicSetContainer, eInverseAdd, eInverseRemove, getClassForName, getClassifierID, getEPackage, getEPackageGen, getExtendedMetaData, getInstanceClass, getInstanceClassGen, getInstanceClassName, getInstanceClassNameGen, getPrimitiveOrArrayClass, isInstance, setClassifierID, setExtendedMetaData, setInstanceClass, setInstanceClassName, setInstanceClassNameGen
 
Methods inherited from class org.eclipse.emf.ecore.impl.ENamedElementImpl
getNameGen, setName
 
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
eContents, eCrossReferences, 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, getInstanceClass, getInstanceClassName, isInstance, setInstanceClass, setInstanceClassName
 
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 java.lang.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:
CollectionTypeImpl.getStartPosition(), Constant Field Values

startPosition

protected int startPosition
The cached value of the 'Start Position' attribute.

See Also:
CollectionTypeImpl.getStartPosition()

END_POSITION_EDEFAULT

protected static final int END_POSITION_EDEFAULT
The default value of the 'End Position' attribute.

See Also:
CollectionTypeImpl.getEndPosition(), Constant Field Values

endPosition

protected int endPosition
The cached value of the 'End Position' attribute.

See Also:
CollectionTypeImpl.getEndPosition()

TYPE_START_POSITION_EDEFAULT

protected static final int TYPE_START_POSITION_EDEFAULT
The default value of the 'Type Start Position' attribute.

See Also:
CollectionTypeImpl.getTypeStartPosition(), Constant Field Values

typeStartPosition

protected int typeStartPosition
The cached value of the 'Type Start Position' attribute.

See Also:
CollectionTypeImpl.getTypeStartPosition()

TYPE_END_POSITION_EDEFAULT

protected static final int TYPE_END_POSITION_EDEFAULT
The default value of the 'Type End Position' attribute.

See Also:
CollectionTypeImpl.getTypeEndPosition(), Constant Field Values

typeEndPosition

protected int typeEndPosition
The cached value of the 'Type End Position' attribute.

See Also:
CollectionTypeImpl.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 org.eclipse.emf.ecore.EClassifier elementType
The cached value of the 'Element Type' reference.

See Also:
CollectionTypeImpl.getElementType()

KIND_EDEFAULT

protected static final CollectionKind KIND_EDEFAULT
The default value of the 'Kind' attribute.

See Also:
CollectionTypeImpl.getKind()
Constructor Detail

CollectionTypeImpl

protected CollectionTypeImpl()

CollectionTypeImpl

protected CollectionTypeImpl(org.eclipse.emf.ecore.EClassifier elementType)
Method Detail

getOperationCodeFor

public int getOperationCodeFor(java.lang.String oper)
Returns the operation code from an operation name.

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

getOperationNameFor

public java.lang.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 org.eclipse.emf.common.util.EList createOperations()
Initialiaze Operations defined on AnyType


createIterators

protected static org.eclipse.emf.common.util.EList createIterators()

getOperations

public org.eclipse.emf.common.util.EList getOperations()
Description copied from interface: CollectionType
Get the list of operations supported by OCL Collection Types

Specified by:
getOperations in interface CollectionType
Returns:
the operations

getIterators

public org.eclipse.emf.common.util.EList getIterators()

getName

public java.lang.String getName()
Specified by:
getName in interface org.eclipse.emf.ecore.ENamedElement

getResultTypeFor

public org.eclipse.emf.ecore.EClassifier getResultTypeFor(org.eclipse.emf.ecore.EClassifier ownerType,
                                                          int opcode,
                                                          org.eclipse.emf.common.util.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(org.eclipse.emf.ecore.EClassifier type)

Specified by:
getRelationshipTo in interface PredefinedType

getCommonSupertype

public org.eclipse.emf.ecore.EClassifier getCommonSupertype(org.eclipse.emf.ecore.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 org.eclipse.emf.ecore.EClass eStaticClass()


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 org.eclipse.emf.ecore.EClassifier getElementType()

Specified by:
getElementType in interface CollectionType

basicGetElementType

public org.eclipse.emf.ecore.EClassifier basicGetElementType()


setElementType

public void setElementType(org.eclipse.emf.ecore.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 java.lang.Object eGet(int featureID,
                             boolean resolve,
                             boolean coreType)

Specified by:
eGet in interface org.eclipse.emf.ecore.InternalEObject

eSet

public void eSet(int featureID,
                 java.lang.Object newValue)

Specified by:
eSet in interface org.eclipse.emf.ecore.InternalEObject

eUnset

public void eUnset(int featureID)

Specified by:
eUnset in interface org.eclipse.emf.ecore.InternalEObject

eIsSet

public boolean eIsSet(int featureID)

Specified by:
eIsSet in interface org.eclipse.emf.ecore.InternalEObject

eBaseStructuralFeatureID

public int eBaseStructuralFeatureID(int derivedFeatureID,
                                    java.lang.Class baseClass)

Specified by:
eBaseStructuralFeatureID in interface org.eclipse.emf.ecore.InternalEObject

eDerivedStructuralFeatureID

public int eDerivedStructuralFeatureID(int baseFeatureID,
                                       java.lang.Class baseClass)

Specified by:
eDerivedStructuralFeatureID in interface org.eclipse.emf.ecore.InternalEObject

toString

public java.lang.String toString()


size

public static int size(java.util.Set s)

includes

public static boolean includes(java.util.Collection c,
                               java.lang.Object o)

excludes

public static boolean excludes(java.util.Collection c,
                               java.lang.Object o)

count

public static int count(java.util.Collection c,
                        java.lang.Object o)

includesAll

public static boolean includesAll(java.util.Collection c1,
                                  java.util.Collection c2)

excludesAll

public static boolean excludesAll(java.util.Collection c1,
                                  java.util.Collection c2)

isEmpty

public static boolean isEmpty(java.util.Collection c)

notEmpty

public static boolean notEmpty(java.util.Collection c)

sum

public static java.lang.Object sum(java.util.Collection c)

equals

public static boolean equals(java.util.Collection c1,
                             java.util.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(java.util.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 java.util.Collection intersection(java.util.Collection c1,
                                                java.util.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 java.util.Collection union(java.util.Collection c1,
                                         java.util.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 java.util.Collection flatten(java.util.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 java.util.Set minus(java.util.Set s1,
                                  java.util.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 java.util.Collection excluding(java.util.Collection c,
                                             java.lang.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 java.util.Set symmetricDifference(java.util.Set s1,
                                                java.util.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 java.util.Collection including(java.util.Collection c,
                                             java.lang.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 java.util.Collection asSet(java.util.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 java.util.Collection asBag(java.util.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 java.util.Collection asSequence(java.util.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 java.util.Collection asOrderedSet(java.util.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 java.util.Set product(java.util.Collection c1,
                                    java.util.Collection c2,
                                    org.eclipse.emf.ecore.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 java.util.Collection append(java.util.Collection c,
                                          java.lang.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 java.util.Collection prepend(java.util.Collection c,
                                           java.lang.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 java.util.Collection insertAt(java.util.Collection c,
                                            int oclIndex,
                                            java.lang.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 java.util.Collection subOrderedSet(java.util.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 java.util.Collection subSequence(java.util.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 java.lang.Object at(java.util.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 java.lang.Object first(java.util.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 java.lang.Object last(java.util.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 java.lang.Integer indexOf(java.util.Collection c,
                                        java.lang.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 java.util.Collection createNewSet()
Creates a new java set


createNewSet

public static java.util.Collection createNewSet(java.util.Collection c)
Creates a new java set with initial collection supplied


createNewBag

public static java.util.Collection createNewBag()
Creates a new bag


createNewBag

public static java.util.Collection createNewBag(java.util.Collection c)
Creates a new bag with initial collection supplied


createNewOrderedSet

public static java.util.Collection createNewOrderedSet()
Creates a new java ordered set


createNewOrderedSet

public static java.util.Collection createNewOrderedSet(java.util.Collection c)
Creates a new ordered set with initial collection supplied


createNewSequence

public static java.util.Collection createNewSequence()
Creates a new sequence


createNewSequence

public static java.util.Collection createNewSequence(java.util.Collection c)
Creates a new sequence with initial collection supplied


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