Package com.google.common.collect
Class ForwardingMap.StandardKeySet
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<E>
-
- com.google.common.collect.ForwardingMap.StandardKeySet
-
- All Implemented Interfaces:
Iterable<K>
,Collection<K>
,Set<K>
protected class ForwardingMap.StandardKeySet extends AbstractSet<E>
A sensible implementation ofMap.keySet()
in terms of the following methods:ForwardingMap.clear()
,ForwardingMap.containsKey(java.lang.Object)
,ForwardingMap.isEmpty()
,ForwardingMap.remove(java.lang.Object)
,ForwardingMap.size()
, and theSet.iterator()
method ofForwardingMap.entrySet()
. In many cases, you may wish to overrideForwardingMap.keySet()
to forward to this implementation or a subclass thereof.- Since:
- 10.0
-
-
Constructor Summary
Constructors Constructor Description StandardKeySet()
Constructor for use by subclasses.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
boolean
contains(Object o)
void
forEach(Consumer<? super K> action)
boolean
isEmpty()
Iterator<K>
iterator()
boolean
remove(Object o)
boolean
removeAll(Collection<?> c)
boolean
retainAll(Collection<?> c)
int
size()
-
Methods inherited from class java.util.AbstractSet
equals, hashCode
-
Methods inherited from class java.util.AbstractCollection
add, addAll, containsAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.Set
add, addAll, containsAll, spliterator, toArray, toArray
-
-
-
-
Constructor Detail
-
StandardKeySet
public StandardKeySet()
Constructor for use by subclasses.
-
-
Method Detail
-
iterator
public Iterator<K> iterator()
-
forEach
public void forEach(Consumer<? super K> action)
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
contains
public boolean contains(@CheckForNull Object o)
-
remove
public boolean remove(@CheckForNull Object o)
-
clear
public void clear()
-
removeAll
public boolean removeAll(Collection<?> c)
-
retainAll
public boolean retainAll(Collection<?> c)
-
-