public static class ReferenceSets.Singleton<K> extends AbstractReferenceSet<K> implements java.io.Serializable, java.lang.Cloneable
This class may be useful to implement your own in case you subclass a type-specific set.
Modifier and Type | Method and Description |
---|---|
boolean |
addAll(java.util.Collection<? extends K> c) |
java.lang.Object |
clone() |
boolean |
contains(java.lang.Object k) |
void |
forEach(java.util.function.Consumer<? super K> action) |
ObjectListIterator<K> |
iterator()
Returns a type-specific iterator on the elements of this collection.
|
boolean |
remove(java.lang.Object k) |
boolean |
removeAll(java.util.Collection<?> c) |
boolean |
removeIf(java.util.function.Predicate<? super K> filter) |
boolean |
retainAll(java.util.Collection<?> c) |
int |
size() |
ObjectSpliterator<K> |
spliterator()
Returns a type-specific spliterator on the elements of this set.
|
java.lang.Object[] |
toArray() |
equals, hashCode
toString
public boolean contains(java.lang.Object k)
public boolean remove(java.lang.Object k)
public ObjectListIterator<K> iterator()
ReferenceCollection
iterator
in interface ObjectIterable<K>
iterator
in interface ReferenceCollection<K>
iterator
in interface ReferenceSet<K>
iterator
in interface java.lang.Iterable<K>
iterator
in interface java.util.Collection<K>
iterator
in interface java.util.Set<K>
iterator
in class AbstractReferenceSet<K>
Iterable.iterator()
public ObjectSpliterator<K> spliterator()
ReferenceSet
Set spliterators must report at least Spliterator.DISTINCT
.
See Set.spliterator()
for more documentation on the requirements
of the returned spliterator.
spliterator
in interface ObjectIterable<K>
spliterator
in interface ReferenceCollection<K>
spliterator
in interface ReferenceSet<K>
spliterator
in interface java.lang.Iterable<K>
spliterator
in interface java.util.Collection<K>
spliterator
in interface java.util.Set<K>
public int size()
public java.lang.Object[] toArray()
public void forEach(java.util.function.Consumer<? super K> action)
forEach
in interface java.lang.Iterable<K>
public boolean addAll(java.util.Collection<? extends K> c)
public boolean removeAll(java.util.Collection<?> c)
public boolean retainAll(java.util.Collection<?> c)
public boolean removeIf(java.util.function.Predicate<? super K> filter)
removeIf
in interface java.util.Collection<K>
public java.lang.Object clone()
clone
in class java.lang.Object