/**
* @ Author Chen weibing
* @ Msn: cwbnig1982@hotmail.com
* @ E-mail: chenweibing1982@sohu.com
* @ CreateTime 2004-11-30
* @ Version: 1.0
*/
Package com. cwbnig. util;
Import java. util. Iterator;
Public interface BagADT
{
// Adds one element to this bag
Public void add (Object element );
// Remove and returns a random element from the bag
Public Object removeRandom () throws EmptyBagException;
// Removes and returns the specified element from this bag
Public Object remove (Object element) throws EmptyBagException, NoSuchElementException;
// Returns the union of this bag and the parameter
Public BagADT union (BagADT set );
// Returns true if this bag contains the parameter
Public boolean contains (Object target );
// Returns true if this bag and the parameter contain exacitly the same elements
Public boolean isEmpty ();
// Returns the number of elements in this set
Public int size ();
// Returns an iterator for the elements in this bag
Public Iterator iterator ();
// Returns a string representation of this bag
Public String toString ();
}