java.util
Class AbstractSet

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractSet
All Implemented Interfaces:
Collection, Set
Direct Known Subclasses:
HashSet, TreeSet

public abstract synchronized class AbstractSet
extends AbstractCollection
implements Set


Constructor Summary
protected AbstractSet()
           
 
Method Summary
 boolean equals(Object)
          Determines if this object is "equal" to another object.
 int hashCode()
           
 boolean removeAll(Collection)
           
 
Methods inherited from class java.util.AbstractCollection
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, retainAll, size, toArray, toArray, toString
 
Methods inherited from interface java.util.Set
add, contains, iterator, remove, size
 

Constructor Detail

AbstractSet

protected AbstractSet()
Method Detail

equals

public boolean equals(Object)
Description copied from class: Object
Determines if this object is "equal" to another object.

In general, objects should be instances of the same class with the same guts to be considered equal. For example, the code below only prints same value since s and t are different strings though they have the same value: "hello".

 String s = new String("hello");
 String t = new String("hello");
 if (s.equals(t)) System.out.println("same value");
 if (s == t) System.out.println("same string");

 

Specified by:
equals in interface Collection
Overrides:
equals in class Object
Following copied from class: java.lang.Object
Parameters:
is - the other Object to which this one is compared
Returns:
true if this Object is equal to other

hashCode

public int hashCode()
Specified by:
hashCode in interface Collection
Overrides:
hashCode in class Object

removeAll

public boolean removeAll(Collection)
Specified by:
removeAll in interface Collection
Overrides:
removeAll in class AbstractCollection