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

com.ibm.able.rules
Class AbleOclBag

java.lang.Object
  extended byjava.util.AbstractCollection
      extended bycom.ibm.able.rules.AbleOclCollection
          extended bycom.ibm.able.rules.AbleOclBag
All Implemented Interfaces:
java.util.Collection, java.io.Serializable

public class AbleOclBag
extends AbleOclCollection
implements java.io.Serializable

This class defines an OCL Bag. The underlying implementation is built on com.ibm.able.data.AbleBag and its methods are surfaced as well.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.ibm.able.rules.AbleOclCollection
myCollection
 
Constructor Summary
AbleOclBag()
          Create a new, empty Bag.
AbleOclBag(AbleOclCollection theAbleOclCollection)
          Create a new Bag based on the specified OCL collection.
AbleOclBag(java.util.Collection theCollection)
          Create a new Bag based on the specified Java collection.
 
Method Summary
 boolean equals(java.lang.Object theObject)
           
 AbleOclCollection excluding(java.lang.Object theObject)
          Returns a new collection comprised of this collection with the specified object removed.
 AbleOclCollection flatten()
          Flattens the elements of this collection.
 int hashCode()
           
 AbleOclCollection including(java.lang.Object theObject)
          Returns a new collection comprised of this collection and the specified object.
 AbleOclCollection intersection(AbleOclBag theBag)
          Returns a new collection that is the intersection of this collection and the specified Bag.
 AbleOclSet intersection(AbleOclSet theSet)
          Returns a new collection that is the intersection of this collection and the specified Set.
 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.
 void setCollection(java.util.Collection theCollection)
          Sets the value of the underlying collection to be the specified collection.
 AbleOclBag union(AbleOclBag theBag)
          Returns a new collection that is the union of this collection and the specified Bag.
 AbleOclCollection union(AbleOclSet theSet)
          Returns a new collection that is the union of this collection and the specified Set.
 
Methods inherited from class com.ibm.able.rules.AbleOclCollection
add, addAll, any, append, asBag, asOrderedSet, asSequence, asSet, at, clear, collect, contains, containsAll, count, difference, excludes, excludesAll, exists, first, flatten, forAll, getCollection, hasAtLeast, hasAtMost, hasBetween, hasExactly, includes, includesAll, indexOf, insertAt, intersection, isEmpty, isUnique, iterator, last, notEmpty, one, prepend, product, reject, remove, select, size, subOrderedSet, subSequence, sum, symmetricDifference, toArray, toArray, union
 
Methods inherited from class java.util.AbstractCollection
toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbleOclBag

public AbleOclBag()
Create a new, empty Bag.


AbleOclBag

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

Parameters:
theCollection - A collection on which to base the new Bag.


AbleOclBag

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

Parameters:
theAbleOclCollection - A collection on which to base the new Bag.

Method Detail

removeAll

public boolean removeAll(java.util.Collection theCollection)
Description copied from class: AbleOclCollection
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
Overrides:
removeAll in class AbleOclCollection
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)
Description copied from class: AbleOclCollection
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
Overrides:
retainAll in class AbleOclCollection
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.

flatten

public AbleOclCollection flatten()
Description copied from class: AbleOclCollection
Flattens the elements of this collection.

Overrides:
flatten in class AbleOclCollection
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.

including

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

Overrides:
including in class AbleOclCollection
Parameters:
theObject - An element to add to the new collection.

Returns:
a new collection comprised of this collection and the specified object.

excluding

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

Overrides:
excluding in class AbleOclCollection
Parameters:
theObject - An element to remove from the new collection.

Returns:
a new collection comprised of this collection with the specified object removed.

intersection

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

Overrides:
intersection in class AbleOclCollection
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.

intersection

public AbleOclSet intersection(AbleOclSet theSet)
Description copied from class: AbleOclCollection
Returns a new collection that is the intersection of this collection and the specified Set.

Overrides:
intersection in class AbleOclCollection
Parameters:
theSet - A collection to examine with this collection.

Returns:
a new Set that is the intersection of this collection and the specified Set.

union

public AbleOclBag union(AbleOclBag theBag)
Description copied from class: AbleOclCollection
Returns a new collection that is the union of this collection and the specified Bag.

Overrides:
union in class AbleOclCollection
Parameters:
theBag - A collection to examine with this collection.

Returns:
a new Bag that is the union of this collection and the specified Bag.

union

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

Overrides:
union in class AbleOclCollection
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.

setCollection

public void setCollection(java.util.Collection theCollection)
Description copied from class: AbleOclCollection
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'.)

Overrides:
setCollection in class AbleOclCollection
Parameters:
theCollection - The collection that is to be the value of this collection.


equals

public boolean equals(java.lang.Object theObject)
Specified by:
equals in interface java.util.Collection

hashCode

public int hashCode()
Specified by:
hashCode in interface java.util.Collection

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

(C) Copyright IBM Corporation 1999, 2005