public abstract class AbstractLongSet extends AbstractLongCollection implements LongSet
LongCollection
,
AbstractLongCollection
,
LongSet
,
LongHashSet
Modifier | Constructor and Description |
---|---|
protected |
AbstractLongSet()
The main constructor, for use by subclasses.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o)
Tests whether the given object is equal to this Set.
|
int |
hashCode()
Returns a hash code for this Set.
|
boolean |
removeAll(LongCollection c)
Removes from this set all elements in the given collection (optional
operation).
|
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, retainAll, size, toArray, toArray, toString
protected AbstractLongSet()
public boolean equals(java.lang.Object o)
equals
in interface LongCollection
equals
in interface LongSet
equals
in class java.lang.Object
o
- the Object to be tested for equality with this Setpublic int hashCode()
hashCode
in interface LongCollection
hashCode
in interface LongSet
hashCode
in class java.lang.Object
LongSet.equals(Object)
public boolean removeAll(LongCollection c)
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.removeAll
in interface LongCollection
removeAll
in interface LongSet
removeAll
in class AbstractLongCollection
c
- the collection of elements to removejava.lang.UnsupportedOperationException
- if remove is not supportedjava.lang.NullPointerException
- if the collection is nullAbstractLongCollection.remove(long)
,
LongCollection.contains(long)
,
LongIterator.remove()