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:
java.lang.Iterable<K>
,java.util.Collection<K>
,java.util.Set<K>
- Enclosing class:
- ForwardingMap<K extends @Nullable java.lang.Object,V extends @Nullable java.lang.Object>
protected class ForwardingMap.StandardKeySet extends java.util.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(java.lang.Object o)
void
forEach(java.util.function.Consumer<? super K> action)
boolean
isEmpty()
java.util.Iterator<K>
iterator()
boolean
remove(java.lang.Object o)
boolean
removeAll(java.util.Collection<?> c)
boolean
retainAll(java.util.Collection<?> c)
int
size()
-
Methods inherited from class java.util.AbstractCollection
add, addAll, containsAll, toArray, toArray, toString
-
-
-
-
Constructor Detail
-
StandardKeySet
public StandardKeySet()
Constructor for use by subclasses.
-
-
Method Detail
-
iterator
public java.util.Iterator<K> iterator()
- Specified by:
iterator
in interfacejava.util.Collection<K extends @Nullable java.lang.Object>
- Specified by:
iterator
in interfacejava.lang.Iterable<K extends @Nullable java.lang.Object>
- Specified by:
iterator
in interfacejava.util.Set<K extends @Nullable java.lang.Object>
- Specified by:
iterator
in classjava.util.AbstractCollection<K extends @Nullable java.lang.Object>
-
forEach
public void forEach(java.util.function.Consumer<? super K> action)
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
contains
public boolean contains(@CheckForNull java.lang.Object o)
-
remove
public boolean remove(@CheckForNull java.lang.Object o)
-
clear
public void clear()
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
-
-