ABLE 2.3.0 07/13/2005 14:21:00

com.ibm.able.rules
Class AbleOclCollection

java.lang.Object
  extended byjava.util.AbstractCollection
      extended bycom.ibm.able.rules.AbleOclCollection
All Implemented Interfaces:
java.util.Collection, java.io.Serializable
Direct Known Subclasses:
AbleOclBag, AbleOclOrderedSet, AbleOclSequence, AbleOclSet

public abstract class AbleOclCollection
extends java.util.AbstractCollection
implements java.util.Collection, java.io.Serializable

This class defines an OCL Collection base class, upon which OCL Bag, Sequence, Set, and OrderedSet are built.

This class is a java.util.Collection and can be used as such (methods such as add, addAll, contains, work). The class also supports OCL methods such as includes, excludes, exists, forAll. A few additional methods, such as hasExactly, hasAtMost, and so on, are thrown in for good measure.

Note that methods defined for collection subtypes are mostly implemented in here as throwing UnsupportedOperationExceptions. Each collection subtype, AbleOclSet for example, must override these methods (methods such as intersection, union and so on) as necessary.

See Also:
Serialized Form

Field Summary
protected  java.util.Collection myCollection
          The current value of the collection.
 
Constructor Summary
AbleOclCollection()
          Create a new, empty collection.
AbleOclCollection(AbleOclCollection theAbleOclCollection)
          Create a new collection based on the specified OCL collection.
AbleOclCollection(java.util.Collection theCollection)
          Create a new collection based on the specified Java collection.
 
Method Summary
 boolean add(java.lang.Object theObject)
          Ensures that this collection contains the specified element.
 boolean addAll(java.util.Collection theCollection)
          Adds all of the elements in the specified collection to this collection.
 java.lang.Object any(AbleSelector theSelector)
          Returns the first element of this collection that causes the specified selector expression to evaluate to true, if any.
 AbleOclCollection append(java.lang.Object theObject)
          Returns a new collection that is this collection with the specified object added at the end.
 AbleOclBag asBag()
          Returns this collection as a new Bag.
 AbleOclOrderedSet asOrderedSet()
          Returns this collection as a new OrderedSet.
 AbleOclSequence asSequence()
          Returns this collection as a new Sequence.
 AbleOclSet asSet()
          Returns this collection as a new Set.
 java.lang.Object at(int thePosition)
          Returns the element at the specified location.
 void clear()
          Removes all elements from this collection.
 AbleOclCollection collect(AbleSelector theSelector)
          Collects and returns the values returned when the specified expression is evaluated against each element of this collection.
 boolean contains(java.lang.Object theObject)
          Determines whether this collection contains the specified element.
 boolean containsAll(java.util.Collection theCollection)
          Determines whether this collection contains all of the elements in the specified collection.
 int count(java.lang.Object theObject)
          Counts the number of times that the specified object occurs in this collection.
 AbleOclSet difference(AbleOclSet theSet)
          Returns a new Set that is the difference of this Set and the specified Set.
 boolean excludes(java.lang.Object theObject)
          Determines whether the specified object does not occur in this collection.
 boolean excludesAll(AbleOclCollection theCollection)
          Determines whether all the elements of the specified collection do not occur in this collection.
 AbleOclCollection excluding(java.lang.Object theObject)
          Returns a new collection comprised of this collection with the specified object removed.
 boolean exists(AbleSelector theSelector)
          Determines whether at least one element of this collection causes the specified constraint expression to evaluate to true.
 java.lang.Object first()
          Returns the first element of the collection.
 AbleOclCollection flatten()
          Flattens the elements of this collection.
protected static AbleOclCollection flatten(AbleOclCollection theOclCollection)
           
 boolean forAll(AbleSelector theSelector)
          Determines whether all of the elements of this collection cause the specified selector expression to evaluate to true.
 java.util.Collection getCollection()
          Gets the value of the underlying collection.
 boolean hasAtLeast(int theNumber, AbleSelector theSelector)
          Determines whether at least the specified number of elements of this collection cause the specified constraint expression to evaluate to true.
 boolean hasAtMost(int theNumber, AbleSelector theSelector)
          Determines whether no more than the specified number of elements of this collection cause the specified constraint expression to evaluate to true.
 boolean hasBetween(int theNumberLo, int theNumberHi, AbleSelector theSelector)
          Determines whether the number of elements of this collection that cause the specified constraint expression to evaluate to true falls within the specified range (inclusive).
 boolean hasExactly(int theNumber, AbleSelector theSelector)
          Determines whether the number of elements of this collection that cause the specified constraint expression to evaluate to true is exactly the specified number.
 boolean includes(java.lang.Object theObject)
          Determines whether the specified object does occur in this collection.
 boolean includesAll(AbleOclCollection theCollection)
          Determines whether all the elements of the specified collection occur in this collection.
 AbleOclCollection including(java.lang.Object theObject)
          Returns a new collection comprised of this collection and the specified object.
 int indexOf(java.lang.Object theObject)
          Returns the position of the specified element.
 AbleOclCollection insertAt(int thePosition, java.lang.Object theObject)
          Returns a new collection that is this collection with the specified object inserted at the specified location.
 AbleOclCollection intersection(AbleOclBag theBag)
          Returns a new collection that is the intersection of this collection and the specified Bag.
protected static void intersection(AbleOclCollection theOclCollection1, AbleOclCollection theOclCollection2, AbleOclCollection theResultOclCollection)
           
 AbleOclSet intersection(AbleOclSet theSet)
          Returns a new collection that is the intersection of this collection and the specified Set.
 boolean isEmpty()
          Determines whether this collection is empty.
 boolean isUnique(AbleSelector theSelector)
          Determines whether the specified expression evaluates to a unique value for each element of this collection.
 java.util.Iterator iterator()
          Returns an iterator over the elements in this collection.
 java.lang.Object last()
          Returns the last element of the collection.
 boolean notEmpty()
          Determines whether this collection is not empty.
 boolean one(AbleSelector theSelector)
          Determines whether one and only one of the elements of this collection cause the specified selector expression to evaluate to true.
 AbleOclCollection prepend(java.lang.Object theObject)
          Returns a new collection that is this collection with the specified object added at the beginning.
 AbleOclSet product(AbleOclCollection theCollection)
          Determines the cartesian product of this collection and the specified collection.
 AbleOclCollection reject(AbleSelector theSelector)
          Creates a new collection whose elements are those of this collection that cause the specified selector expression to evaluate to false.
 boolean remove(java.lang.Object theObject)
          Removes a single instance of the specified element from this collection.
 boolean removeAll(java.util.Collection theCollection)
          Removes all of this collection's elements that are also contained in the specified collection.
 boolean retainAll(java.util.Collection theCollection)
          Retains only the elements in this collection that are contained in the specified collection.
 AbleOclCollection select(AbleSelector theSelector)
          Creates a new collection whose elements are those of this collection that cause the specified selector expression to evaluate to true.
 void setCollection(java.util.Collection theCollection)
          Sets the value of the underlying collection to be the specified collection.
 int size()
          Returns the number of elements in this colection.
 AbleOclOrderedSet subOrderedSet(int theFirstPosition, int theLastPosition)
          Returns a new OrderedSet that is a portion of this OrderedSet.
 AbleOclSequence subSequence(int theFirstPosition, int theLastPosition)
          Returns a new Sequence that is a portion of this Sequence.
 java.lang.Object sum()
          Sums the elements of this collection.
 AbleOclSet symmetricDifference(AbleOclSet theSet)
          Returns a new Set that is the symmetric difference of this Set and the specified Set.
 java.lang.Object[] toArray()
          Returns an array containing all of the elements in this collection.
 java.lang.Object[] toArray(java.lang.Object[] theObjectArray)
          Returns an array containing all of the elements in this collection.
 AbleOclBag union(AbleOclBag theBag)
          Returns a new collection that is the union of this collection and the specified Bag.
 AbleOclSequence union(AbleOclSequence theSequence)
          Returns a new Sequence that is the union of this Sequence and the specified Sequence.
 AbleOclCollection union(AbleOclSet theSet)
          Returns a new collection that is the union of this collection and the specified Set.
 
Methods inherited from class java.util.AbstractCollection
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Field Detail

myCollection

protected java.util.Collection myCollection
The current value of the collection.

Valid data types are:

Constructor Detail

AbleOclCollection

public AbleOclCollection()
Create a new, empty collection. Before the collection can be used, the setCollection(Collection) method must be called to set the value of this collection.


AbleOclCollection

public AbleOclCollection(java.util.Collection theCollection)
Create a new collection based on the specified Java collection.

Parameters:
theCollection - A Java collection upon which the new collection is based.


AbleOclCollection

public AbleOclCollection(AbleOclCollection theAbleOclCollection)
Create a new collection based on the specified OCL collection.

Parameters:
theAbleOclCollection - An OCL collection upon which the new collection is based.

Method Detail

add

public boolean add(java.lang.Object theObject)
Ensures that this collection contains the specified element.

Specified by:
add in interface java.util.Collection
Parameters:
theObject - An element whose presence in this collection is to be ensured.

Returns:
true if this collection changed as a result of the call; otherwise, returns false.

addAll

public boolean addAll(java.util.Collection theCollection)
Adds all of the elements in the specified collection to this collection.

Specified by:
addAll in interface java.util.Collection
Parameters:
theCollection - A collection whose elements are to be inserted into this collection.

Returns:
true if this collection changed as a result of the call; otherwise, returns false.

clear

public void clear()
Removes all elements from this collection. This collection will be empty after this method returns, unless the method throws an exception.

Specified by:
clear in interface java.util.Collection

contains

public boolean contains(java.lang.Object theObject)
Determines whether this collection contains the specified element.

Specified by:
contains in interface java.util.Collection
Parameters:
theObject - An element whose presence in this collection is to be tested.

Returns:
true if this collection contains the specified element; otherwise, returns false.

containsAll

public boolean containsAll(java.util.Collection theCollection)
Determines whether this collection contains all of the elements in the specified collection.

Specified by:
containsAll in interface java.util.Collection
Parameters:
theCollection - A collection whose elements are to be checked for containment in this collection.

Returns:
true if this collection contains all the elements in the specified collection; otherwise, returns false.

isEmpty

public boolean isEmpty()
Determines whether this collection is empty.

Specified by:
isEmpty in interface java.util.Collection
Returns:
true if this collection contains no elements; otherwise, returns false.

iterator

public java.util.Iterator iterator()
Returns an iterator over the elements in this collection.

Specified by:
iterator in interface java.util.Collection
Returns:
an Iterator over the elements in this collection.

remove

public boolean remove(java.lang.Object theObject)
Removes a single instance of the specified element from this collection.

Specified by:
remove in interface java.util.Collection
Parameters:
theObject - An element to be removed from this collection, if present.

Returns:
true if this collection changed as a result of the call; otherwise, returns false.

removeAll

public boolean removeAll(java.util.Collection theCollection)
Removes all of this collection's elements that are also contained in the specified collection. After this call returns, this collection will contain no elements in common with the specified collection.

Specified by:
removeAll in interface java.util.Collection
Parameters:
theCollection - A collection whose elements are to be removed from this collection.

Returns:
true if this collection changed as a result of the call; otherwise, returns false.

retainAll

public boolean retainAll(java.util.Collection theCollection)
Retains only the elements in this collection that are contained in the specified collection. In other words, removes from this collection all of its elements that are not contained in the specified collection.

Specified by:
retainAll in interface java.util.Collection
Parameters:
theCollection - A collection whose elements are to be retained in this collection.

Returns:
true if this collection changed as a result of the call; otherwise, returns false.

size

public int size()
Returns the number of elements in this colection.

Specified by:
size in interface java.util.Collection
Returns:
the number of elements in this collection.

toArray

public java.lang.Object[] toArray()
Returns an array containing all of the elements in this collection.

Specified by:
toArray in interface java.util.Collection
Returns:
an array containing all of the elements in this collection.

toArray

public java.lang.Object[] toArray(java.lang.Object[] theObjectArray)
Returns an array containing all of the elements in this collection.

Specified by:
toArray in interface java.util.Collection
Parameters:
theObjectArray - The array into which the elements of this collection are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose.

Returns:
an array containing all of the elements of this collection.

count

public int count(java.lang.Object theObject)
Counts the number of times that the specified object occurs in this collection.

Parameters:
theObject - The object to look for in this collection.

Returns:
the number of times the specified object occurs in this collection.

excludes

public boolean excludes(java.lang.Object theObject)
Determines whether the specified object does not occur in this collection.

Parameters:
theObject - The object to look for in this collection.

Returns:
true if the specified element is not a member of this collection; otherwise, false.

excludesAll

public boolean excludesAll(AbleOclCollection theCollection)
Determines whether all the elements of the specified collection do not occur in this collection.

Parameters:
theCollection - A collection whose elements are to be examined for containment in this collection.

Returns:
true if the all the elements of the specified collection do not occur in this collection; otherwise, false.

includes

public boolean includes(java.lang.Object theObject)
Determines whether the specified object does occur in this collection.

Parameters:
theObject - The object to look for in this collection.

Returns:
true if the specified element is a member of this collection; otherwise, false.

includesAll

public boolean includesAll(AbleOclCollection theCollection)
Determines whether all the elements of the specified collection occur in this collection.

Parameters:
theCollection - A collection whose elements are to be examined for containment in this collection.

Returns:
true if the all the elements of the specified collection occur in this collection; otherwise, false.

notEmpty

public boolean notEmpty()
Determines whether this collection is not empty.

Returns:
true if this collection contains one or more elements; otherwise, returns false.

product

public AbleOclSet product(AbleOclCollection theCollection)
Determines the cartesian product of this collection and the specified collection.

Returns:
the cartesian product of this collection and the specified collection.
Throws:
java.lang.UnsupportedOperationException - in all cases.

sum

public java.lang.Object sum()
Sums the elements of this collection. The collection must be a homogenous collection of one of:

Returns:
the sum of the elements of this collection. The data type of the returned object depends on the daya type of the elements of this collection.

exists

public boolean exists(AbleSelector theSelector)
               throws AbleDataException
Determines whether at least one element of this collection causes the specified constraint expression to evaluate to true.

Parameters:
theSelector - An encapsulated {selector variable | boolean expression} that is to be evaluated against the elements of this collection.

Returns:
true if at least one of the elements of this collection cause the expression to evaluate to true; otherwise, false.
Throws:
AbleDataException

forAll

public boolean forAll(AbleSelector theSelector)
               throws AbleDataException
Determines whether all of the elements of this collection cause the specified selector expression to evaluate to true.

Parameters:
theSelector - An encapsulated {selector variable | boolean expression} that is to be evaluated against the elements of this collection.

Returns:
true if all of the elements of this collection cause the expression to evaluate to true; otherwise, false.
Throws:
AbleDataException

isUnique

public boolean isUnique(AbleSelector theSelector)
                 throws AbleDataException
Determines whether the specified expression evaluates to a unique value for each element of this collection.

Parameters:
theSelector - An encapsulated {selector variable | expression} that is to be evaluated against the elements of this collection.

Returns:
true if the expression evaluates to a unique value for each element of the collection; otherwise false is returned.
Throws:
AbleDataException

any

public java.lang.Object any(AbleSelector theSelector)
                     throws AbleDataException
Returns the first element of this collection that causes the specified selector expression to evaluate to true, if any.

Parameters:
theSelector - An encapsulated {selector variable | boolean expression} that is to be evaluated against the elements of this collection.

Returns:
an element of this collection that causes the expression to evaluate to true. If no element is found, null is returned.
Throws:
AbleDataException

one

public boolean one(AbleSelector theSelector)
            throws AbleDataException
Determines whether one and only one of the elements of this collection cause the specified selector expression to evaluate to true.

Parameters:
theSelector - An encapsulated {selector variable | boolean expression} that is to be evaluated against the elements of this collection.

Returns:
true if one and only one of the elements of this collection cause the expression to evaluate to true; otherwise, false.
Throws:
AbleDataException

collect

public AbleOclCollection collect(AbleSelector theSelector)
                          throws AbleDataException
Collects and returns the values returned when the specified expression is evaluated against each element of this collection.

Parameters:
theSelector - An encapsulated {selector variable | expression} that is to be evaluated against the elements of this collection.

Returns:
a collection of values returned by evaluating the expression against each element of the specified collection.
Throws:
AbleDataException

select

public AbleOclCollection select(AbleSelector theSelector)
                         throws AbleDataException
Creates a new collection whose elements are those of this collection that cause the specified selector expression to evaluate to true.

Parameters:
theSelector - An encapsulated {selector variable | boolean expression} that is to be evaluated against the elements of this collection.

Returns:
a new collection of those elements selected from this collection.
Throws:
AbleDataException

reject

public AbleOclCollection reject(AbleSelector theSelector)
                         throws AbleDataException
Creates a new collection whose elements are those of this collection that cause the specified selector expression to evaluate to false.

Parameters:
theSelector - An encapsulated {selector variable | boolean expression} that is to be evaluated against the elements of this collection.

Returns:
a new collection of those elements rejected from this collection.
Throws:
AbleDataException

hasExactly

public boolean hasExactly(int theNumber,
                          AbleSelector theSelector)
                   throws AbleDataException
Determines whether the number of elements of this collection that cause the specified constraint expression to evaluate to true is exactly the specified number.

Parameters:
theNumber - The exact number of elements that can cause the expression to evaluate to true.

theSelector - An encapsulated {selector variable | boolean expression} that is to be evaluated against the elements of this collection.

Returns:
true if the number of elements of this collection that cause the expression to evaluate to true is equal to the specified number; otherwise, false.
Throws:
AbleDataException

hasAtLeast

public boolean hasAtLeast(int theNumber,
                          AbleSelector theSelector)
                   throws AbleDataException
Determines whether at least the specified number of elements of this collection cause the specified constraint expression to evaluate to true.

Parameters:
theNumber - The minimum number of elements that can cause the expression to evaluate to true.

theSelector - An encapsulated {selector variable | boolean expression} that is to be evaluated against the elements of this collection.

Returns:
true if the number of elements of this collection that cause the expression to evaluate to true is greater than or equal to the specified number; otherwise, false.
Throws:
AbleDataException

hasAtMost

public boolean hasAtMost(int theNumber,
                         AbleSelector theSelector)
                  throws AbleDataException
Determines whether no more than the specified number of elements of this collection cause the specified constraint expression to evaluate to true.

Parameters:
theNumber - The maximum number of elements that can cause the expression to evaluate to true.

theSelector - An encapsulated {selector variable | boolean expression} that is to be evaluated against the elements of this collection.

Returns:
true if the number of elements of this collection that cause the expression to evaluate to true is less than or equal to the specified number; otherwise, false.
Throws:
AbleDataException

hasBetween

public boolean hasBetween(int theNumberLo,
                          int theNumberHi,
                          AbleSelector theSelector)
                   throws AbleDataException
Determines whether the number of elements of this collection that cause the specified constraint expression to evaluate to true falls within the specified range (inclusive).

Parameters:
theNumberLo - The minimum number of elements that can cause the expression to evaluate to true.

theNumberHi - The maximum number of elements that can cause the expression to evaluate to true.

theSelector - An encapsulated {selector variable | boolean expression} that is to be evaluated against the elements of this collection.

Returns:
true if the number of elements of this collection that cause the expression to evaluate to true is greater than or equal to the specified low number and less than or equal to the specified high number; otherwise, false.
Throws:
AbleDataException

asBag

public AbleOclBag asBag()
Returns this collection as a new Bag.

Returns:
this collection as a new Bag.

asOrderedSet

public AbleOclOrderedSet asOrderedSet()
Returns this collection as a new OrderedSet.

Returns:
this collection as a new OrderedSet.

asSequence

public AbleOclSequence asSequence()
Returns this collection as a new Sequence.

Returns:
this collection as a new Sequence.

asSet

public AbleOclSet asSet()
Returns this collection as a new Set.

Returns:
this collection as a new Set.

flatten

public AbleOclCollection flatten()
Flattens the elements of this collection.

Returns:
If the elements of this collection are not themselves collections, this collection itself is returned. If the elements are collections, the returned value is a new collection containing all the elements of all the subcollections.
Throws:
java.lang.UnsupportedOperationException - if this collection does not support this operation.

including

public AbleOclCollection including(java.lang.Object theObject)
Returns a new collection comprised of this collection and the specified object.

Parameters:
theObject - An element to add to the new collection.

Returns:
a new collection comprised of this collection and the specified object.
Throws:
java.lang.UnsupportedOperationException - if this collection does not support this operation.

excluding

public AbleOclCollection excluding(java.lang.Object theObject)
Returns a new collection comprised of this collection with the specified object removed.

Parameters:
theObject - An element to remove from the new collection.

Returns:
a new collection comprised of this collection with the specified object removed.
Throws:
java.lang.UnsupportedOperationException - if this collection does not support this operation.

intersection

public AbleOclCollection intersection(AbleOclBag theBag)
Returns a new collection that is the intersection of this collection and the specified Bag.

Parameters:
theBag - A collection to examine with this collection.

Returns:
a Bag if this collection is a Bag; a Set if this collection is a Set.
Throws:
java.lang.UnsupportedOperationException - if this collection does not support this operation.

intersection

public AbleOclSet intersection(AbleOclSet theSet)
Returns a new collection that is the intersection of this collection and the specified Set.

Parameters:
theSet - A collection to examine with this collection.

Returns:
a new Set that is the intersection of this collection and the specified Set.
Throws:
java.lang.UnsupportedOperationException - if this collection does not support this operation.

union

public AbleOclBag union(AbleOclBag theBag)
Returns a new collection that is the union of this collection and the specified Bag.

Parameters:
theBag - A collection to examine with this collection.

Returns:
a new Bag that is the union of this collection and the specified Bag.
Throws:
java.lang.UnsupportedOperationException - if this collection does not support this operation.

union

public AbleOclCollection union(AbleOclSet theSet)
Returns a new collection that is the union of this collection and the specified Set.

Parameters:
theSet - A collection to examine with this collection.

Returns:
If this collection is a Bag, a new Bag that is the union of this collection and the specified Set. If this collection is a Set, a new Set that is the union of this collection and the specified Set.
Throws:
java.lang.UnsupportedOperationException - if this collection does not support this operation.

append

public AbleOclCollection append(java.lang.Object theObject)
Returns a new collection that is this collection with the specified object added at the end.

Parameters:
theObject - An element to add to the end of the new collection.

Returns:
A new collection that is this collection with the specified element added at the end.
Throws:
java.lang.UnsupportedOperationException - if this collection does not support this operation.

prepend

public AbleOclCollection prepend(java.lang.Object theObject)
Returns a new collection that is this collection with the specified object added at the beginning.

Parameters:
theObject - An element to add to the beginning of the new collection.

Returns:
A new collection that is this collection with the specified element added at the beginning.
Throws:
java.lang.UnsupportedOperationException - if this collection does not support this operation.

insertAt

public AbleOclCollection insertAt(int thePosition,
                                  java.lang.Object theObject)
Returns a new collection that is this collection with the specified object inserted at the specified location.

Parameters:
thePosition - The location at which to insert the specified element.

theObject - An element to insert in the new collection.

Returns:
A new collection that is this collection with the specified element inserted at the specified location.
Throws:
java.lang.UnsupportedOperationException - if this collection does not support this operation.

at

public java.lang.Object at(int thePosition)
Returns the element at the specified location.

Parameters:
thePosition - The location of the element to return.

Returns:
The element at the specified location.
Throws:
java.lang.UnsupportedOperationException - if this collection does not support this operation.

first

public java.lang.Object first()
Returns the first element of the collection.

Returns:
The first element of the collection.
Throws:
java.lang.UnsupportedOperationException - if this collection does not support this operation.

indexOf

public int indexOf(java.lang.Object theObject)
Returns the position of the specified element.

Parameters:
theObject - The element for which to search.

Returns:
The position of the specified element.
Throws:
java.lang.UnsupportedOperationException - if this collection does not support this operation.

last

public java.lang.Object last()
Returns the last element of the collection.

Returns:
The last element of the collection.
Throws:
java.lang.UnsupportedOperationException - if this collection does not support this operation.

subOrderedSet

public AbleOclOrderedSet subOrderedSet(int theFirstPosition,
                                       int theLastPosition)
Returns a new OrderedSet that is a portion of this OrderedSet.

Parameters:
theFirstPosition - The position of the first element to include.

theLastPosition - The position of the last element to include.

Returns:
A new OrderedSet that is a subset of this OrderedSet.
Throws:
java.lang.UnsupportedOperationException - if this collection does not support this operation.

subSequence

public AbleOclSequence subSequence(int theFirstPosition,
                                   int theLastPosition)
Returns a new Sequence that is a portion of this Sequence.

Parameters:
theFirstPosition - The position of the first element to include.

theLastPosition - The position of the last element to include.

Returns:
A new Sequence that is a subset of this Sequence.
Throws:
java.lang.UnsupportedOperationException - if this collection does not support this operation.

union

public AbleOclSequence union(AbleOclSequence theSequence)
Returns a new Sequence that is the union of this Sequence and the specified Sequence.

Parameters:
theSequence - A Sequence to examine with this Sequence.

Returns:
a new Sequence that is the union of this Sequence and the specified Sequence.
Throws:
java.lang.UnsupportedOperationException - if this collection does not support this operation.

difference

public AbleOclSet difference(AbleOclSet theSet)
Returns a new Set that is the difference of this Set and the specified Set.

Parameters:
theSet - A Set to examine with this Set.

Returns:
a new Set that is the difference of this Set and the specified Set.
Throws:
java.lang.UnsupportedOperationException - if this collection does not support this operation.

symmetricDifference

public AbleOclSet symmetricDifference(AbleOclSet theSet)
Returns a new Set that is the symmetric difference of this Set and the specified Set.

Parameters:
theSet - A Set to examine with this Set.

Returns:
a new Set that is the symmetric difference of this Set and the specified Set.
Throws:
java.lang.UnsupportedOperationException - if this collection does not support this operation.

setCollection

public void setCollection(java.util.Collection theCollection)
Sets the value of the underlying collection to be the specified collection. Use this method only when the null argument constructor has been used to create this collection. (This in itself is discouraged, but since AbleOclCollection can function as a sort of generic Java Collection, the operation isn't forbidden; that is, the constructors are purposely 'public' rather than 'protected'.)

Parameters:
theCollection - The collection that is to be the value of this collection.


getCollection

public java.util.Collection getCollection()
Gets the value of the underlying collection.

Returns:
The collection that is the current value of this collection.

flatten

protected static AbleOclCollection flatten(AbleOclCollection theOclCollection)

intersection

protected static void intersection(AbleOclCollection theOclCollection1,
                                   AbleOclCollection theOclCollection2,
                                   AbleOclCollection theResultOclCollection)

ABLE 2.3.0 07/13/2005 14:21:00

(C) Copyright IBM Corporation 1999, 2005