java.lang.Object | ||
↳ | java.util.AbstractCollection <E> | |
↳ | java.util.AbstractSet<E> |
Known Direct Subclasses
ConcurrentSkipListSet
<E>,
CopyOnWriteArraySet
<E>,
EnumSet
<E extends
Enum
<E>>,
HashSet
<E>,
TreeSet
<E>
|
Known Indirect Subclasses
LinkedHashSet
<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
|
|||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.util.AbstractCollection
|
|||||||||||||||||||||||||||||||||||||||||
From class
java.lang.Object
|
|||||||||||||||||||||||||||||||||||||||||
From interface java.lang.Iterable | |||||||||||||||||||||||||||||||||||||||||
From interface
java.util.Collection
|
|||||||||||||||||||||||||||||||||||||||||
From interface
java.util.Set
|
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.
object | the object to compare with this set. |
---|
true
if the specified object is equal to this set,
false
otherwise
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.
Removes all occurrences in this collection which are contained in the specified collection.
collection | the collection of objects to remove. |
---|
true
if this collection was modified,
false
otherwise.
UnsupportedOperationException | if removing from this collection is not supported. |
---|