BRUtil - Making Java a Kinder, Gentler, Place to be.

brutil
Interface Set

All Superinterfaces:
Collection
All Known Subinterfaces:
MultiSet, SortedMultiSet, SortedSet
All Known Implementing Classes:
AbstractSet, HashSet

public interface Set
extends Collection


Method Summary
 java.lang.Object add(java.lang.Object o)
          Add the specified object to the Set.
 boolean contains(java.lang.Object o)
          Tells if the specified object is contained within this set.
 java.lang.Object find(java.lang.Object elt)
           
 boolean isEmpty()
          Returns true if the Collection contains no elements, false otherwise
 java.util.Iterator iterator()
          Returns an iterator over the elements in the set.
 java.lang.Object remove(java.lang.Object o)
          Removes the specified object from the Set, if present.
 
Methods inherited from interface brutil.Collection
clear, size
 

Method Detail

add

public java.lang.Object add(java.lang.Object o)
Add the specified object to the Set. Unless the implementing class is also a MultiSet, there may only be one instance of the object in the set.
Parameters:
o - The object to add to the Set.
Returns:
Object pointer that was replaced by this add, null otherwise.

contains

public boolean contains(java.lang.Object o)
Tells if the specified object is contained within this set.
Parameters:
o - The object to search for in the Set.
Returns:
true if the object is contained in the set, false otherwise.

iterator

public java.util.Iterator iterator()
Returns an iterator over the elements in the set.
Returns:
An iterator of the elements in the set.

remove

public java.lang.Object remove(java.lang.Object o)
Removes the specified object from the Set, if present.
Parameters:
o - The object to remove.
Returns:
Object removed if the object was in the Set, null otherwise.

isEmpty

public boolean isEmpty()
Description copied from interface: Collection
Returns true if the Collection contains no elements, false otherwise
Specified by:
isEmpty in interface Collection
Returns:
true if the Set is empty, false otherwise.

find

public java.lang.Object find(java.lang.Object elt)
Returns:
the contained item that matches the parameter with respect to its .equals()


BRUtil - Making Java a Kinder, Gentler, Place to be.