@Beta protected class ForwardingMap.StandardKeySet extends AbstractSet<E>
A sensible implementation of Map.keySet()
in terms of the following methods: ForwardingMap.clear()
, ForwardingMap.containsKey(java.lang.Object)
, ForwardingMap.isEmpty()
, ForwardingMap.remove(java.lang.Object)
, ForwardingMap.size()
, and the Set.iterator()
method of ForwardingMap.entrySet()
. In many cases, you may wish to override ForwardingMap.keySet()
to forward to this implementation or a subclass thereof.
Constructor and Description |
---|
StandardKeySet()
Constructor for use by subclasses.
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
contains(Object o) |
boolean |
isEmpty() |
Iterator<K> |
iterator() |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
int |
size() |
equals, hashCode
add, addAll, containsAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
add, addAll, containsAll, spliterator, toArray, toArray
parallelStream, removeIf, stream
public int size()
size
in interface Collection<K>
size
in interface Set<K>
size
in class AbstractCollection<K>
public boolean isEmpty()
isEmpty
in interface Collection<K>
isEmpty
in interface Set<K>
isEmpty
in class AbstractCollection<K>
public boolean contains(Object o)
contains
in interface Collection<K>
contains
in interface Set<K>
contains
in class AbstractCollection<K>
public boolean remove(Object o)
remove
in interface Collection<K>
remove
in interface Set<K>
remove
in class AbstractCollection<K>
public void clear()
clear
in interface Collection<K>
clear
in interface Set<K>
clear
in class AbstractCollection<K>
public boolean removeAll(Collection<?> c)
removeAll
in interface Collection<E>
removeAll
in interface Set<E>
removeAll
in class AbstractSet<E>
public boolean retainAll(Collection<?> c)
retainAll
in interface Collection<E>
retainAll
in interface Set<E>
retainAll
in class AbstractCollection<E>