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

com.ibm.able.data
Class AbleBag

java.lang.Object
  extended byjava.util.AbstractCollection
      extended bycom.ibm.able.data.AbleBag
All Implemented Interfaces:
java.util.Collection, java.io.Serializable

public class AbleBag
extends java.util.AbstractCollection
implements java.io.Serializable

This class defines a generic Bag class. The class is an extension of java.util.AbstractCollection, which, according to its documentation, is already basically a Bag.

See Also:
Serialized Form

Constructor Summary
AbleBag()
          Create a new, empty Bag.
AbleBag(java.util.Collection theCollection)
          Create a new Bag based on the specified collection.
 
Method Summary
 boolean add(java.lang.Object theObject)
           
 void clear()
           
 boolean equals(java.lang.Object theObject)
          Returns true iff this bag and the argument bag have the same number of the same elements.
 int hashCode()
           
 java.util.Iterator iterator()
           
 boolean remove(java.lang.Object theObject)
          Removes every occurrence of the object from the collection.
 int size()
           
 java.lang.String toString()
           
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, removeAll, retainAll, toArray, toArray
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbleBag

public AbleBag()
Create a new, empty Bag.


AbleBag

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

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

Method Detail

iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface java.util.Collection

size

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

add

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

clear

public void clear()
Specified by:
clear in interface java.util.Collection

equals

public boolean equals(java.lang.Object theObject)
Returns true iff this bag and the argument bag have the same number of the same elements.

Specified by:
equals in interface java.util.Collection

hashCode

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

remove

public boolean remove(java.lang.Object theObject)
Removes every occurrence of the object from the collection.

Specified by:
remove in interface java.util.Collection

toString

public java.lang.String toString()

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

(C) Copyright IBM Corporation 1999, 2005