| java.lang.Object | ||
| ↳ | java.util.AbstractCollection<E> | |
| ↳ | java.util.AbstractSet<E> | |
|
ConcurrentSkipListSet<E>,
CopyOnWriteArraySet<E>,
EnumSet<E extends Enum<E>>,
HashSet<E>,
TreeSet<E>
|
|
|
An 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().
| Protected Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new instance of this AbstractSet.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Compares the specified object to this Set and returns true if they are
equal.
| |||||||||||
Returns the hash code for this set.
| |||||||||||
Removes all occurrences in this collection which are contained in the
specified collection.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
| |||||||||||
|
| |||||||||||
|
| |||||||||||
|
| |||||||||||
|
| |||||||||||
Compares the specified object to this Set and returns true if they are equal. The object must be an instance of Set and contain the same objects.
| Parameters | |
|---|---|
object |
Object:
the object to compare with this set. |
| Returns | |
|---|---|
boolean |
true if the specified object is equal to this set,
false otherwise |
See also:
Returns the hash code for this set. Two set which are equal must return the same value. This implementation calculates the hash code by adding each element's hash code.
| Returns | |
|---|---|
int |
the hash code of this set. |
See also:
Removes all occurrences in this collection which are contained in the specified collection.
| Parameters | |
|---|---|
collection |
Collection:
the collection of objects to remove. |
| Returns | |
|---|---|
boolean |
true if this collection was modified, false
otherwise. |
| Throws | |
|---|---|
UnsupportedOperationException |
if removing from this collection is not supported. |