Build 1.0_r1(from source)

java.util
Class AbstractSet<E>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<E>
All Implemented Interfaces:
Iterable<E>, Collection<E>, Set<E>
Direct Known Subclasses:
ConcurrentHashMap.EntrySet, ConcurrentHashMap.KeySet, CopyOnWriteArraySet, EnumSet, HashMap.HashMapEntrySet, HashSet, IdentityHashMap.IdentityHashMapEntrySet, TreeMap.SubMapEntrySet, TreeMap.SubMapKeySet, TreeSet

public abstract class AbstractSet<E>
extends AbstractCollection<E>
implements Set<E>

AbstractSet is an abstract implementation of the Set interface. This Implementation does not support adding. A subclass must implement the abstract methods iterator() and size().

Since:
1.2

Constructor Summary
protected AbstractSet()
          Constructs a new instance of this AbstractSet.
 
Method Summary
 boolean equals(Object object)
          Compares the specified object to this Set and answer if they are equal.
 int hashCode()
          Returns an integer hash code for the receiver.
 boolean removeAll(Collection<?> collection)
          Removes all occurrences in this Collection of each object in the specified Collection.
 
Methods inherited from class java.util.AbstractCollection
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, retainAll, size, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, retainAll, size, toArray, toArray
 

Constructor Detail

AbstractSet

protected AbstractSet()
Constructs a new instance of this AbstractSet.

Method Detail

equals

public boolean equals(Object object)
Compares the specified object to this Set and answer if they are equal. The object must be an instance of Set and contain the same objects.

Specified by:
equals in interface Collection<E>
Specified by:
equals in interface Set<E>
Overrides:
equals in class Object
Parameters:
object - the object to compare with this object
Returns:
true if the specified object is equal to this Set, false otherwise
See Also:
hashCode()

hashCode

public int hashCode()
Returns an integer hash code for the receiver. Objects which are equal answer the same value for this method.

Specified by:
hashCode in interface Collection<E>
Specified by:
hashCode in interface Set<E>
Overrides:
hashCode in class Object
Returns:
the receiver's hash
See Also:
equals(java.lang.Object)

removeAll

public boolean removeAll(Collection<?> collection)
Removes all occurrences in this Collection of each object in the specified Collection.

Specified by:
removeAll in interface Collection<E>
Specified by:
removeAll in interface Set<E>
Overrides:
removeAll in class AbstractCollection<E>
Parameters:
collection - the Collection of objects to remove
Returns:
true if this Collection is modified, false otherwise
Throws:
UnsupportedOperationException - when removing from this Collection is not supported

Build 1.0_r1(from source)

Please submit a feedback, bug or feature