java.util
public abstract class AbstractSet<E> extends AbstractCollection<E> implements Set<E>
Since: 1.2
See Also: Collection AbstractCollection Set HashSet TreeSet LinkedHashSet
UNKNOWN: updated to 1.4
Constructor Summary | |
---|---|
protected | AbstractSet()
The main constructor, for use by subclasses. |
Method Summary | |
---|---|
boolean | equals(Object o)
Tests whether the given object is equal to this Set. |
int | hashCode()
Returns a hash code for this Set. |
boolean | removeAll(Collection<?> c)
Removes from this set all elements in the given collection (optional
operation). |
Parameters: o the Object to be tested for equality with this Set
Returns: true if the given object is equal to this Set
Returns: a hash code for this Set
size()
to determine
the smaller collection. Then, if this set is smaller, it iterates
over the set, calling Iterator.remove if the collection contains
the element. If this set is larger, it iterates over the collection,
calling Set.remove for all elements in the collection. Note that
this operation will fail if a remove methods is not supported.
Parameters: c the collection of elements to remove
Returns: true if the set was modified as a result
Throws: UnsupportedOperationException if remove is not supported NullPointerException if the collection is null