public static class ObjectSets.Singleton<K> extends AbstractObjectSet<K> implements Serializable, 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(Collection<? extends K> c) |
Object |
clone() |
boolean |
contains(Object k) |
ObjectListIterator<K> |
iterator()
Returns a type-specific iterator on the elements of this collection.
|
boolean |
remove(Object k) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
int |
size() |
equals, hashCodetoStringadd, clear, containsAll, isEmpty, toArray, toArrayadd, clear, containsAll, isEmpty, spliterator, toArray, toArrayparallelStream, removeIf, streampublic boolean contains(Object k)
contains in interface Collection<K>contains in interface Set<K>contains in class AbstractCollection<K>public boolean remove(Object k)
remove in interface Collection<K>remove in interface Set<K>remove in class AbstractCollection<K>public ObjectListIterator<K> iterator()
ObjectCollectionNote that this specification strengthens the one given in
Iterable.iterator(), which was already
strengthened in the corresponding type-specific class,
but was weakened by the fact that this interface extends Collection.
iterator in interface ObjectCollection<K>iterator in interface ObjectIterable<K>iterator in interface ObjectSet<K>iterator in interface Iterable<K>iterator in interface Collection<K>iterator in interface Set<K>iterator in class AbstractObjectSet<K>Iterable.iterator()public int size()
size in interface Collection<K>size in interface Set<K>size in class AbstractCollection<K>public boolean addAll(Collection<? extends K> c)
addAll in interface Collection<K>addAll in interface Set<K>addAll in class AbstractCollection<K>public boolean removeAll(Collection<?> c)
removeAll in interface Collection<K>removeAll in interface Set<K>removeAll in class AbstractCollection<K>public boolean retainAll(Collection<?> c)
retainAll in interface Collection<K>retainAll in interface Set<K>retainAll in class AbstractCollection<K>