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>
- Enclosing class:
- ForwardingMap<K extends @Nullable Object,V extends @Nullable Object>
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 voidclear()booleancontains(@Nullable Object o)booleanisEmpty()Iterator<K>iterator()booleanremove(@Nullable Object o)booleanremoveAll(Collection<?> c)booleanretainAll(Collection<?> c)intsize()-
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()
-
size
public int size()
- Specified by:
sizein interfaceCollection<K extends @Nullable Object>- Specified by:
sizein interfaceSet<K extends @Nullable Object>- Specified by:
sizein classAbstractCollection<K extends @Nullable Object>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceCollection<K extends @Nullable Object>- Specified by:
isEmptyin interfaceSet<K extends @Nullable Object>- Overrides:
isEmptyin classAbstractCollection<K extends @Nullable Object>
-
contains
public boolean contains(@Nullable Object o)
- Specified by:
containsin interfaceCollection<K extends @Nullable Object>- Specified by:
containsin interfaceSet<K extends @Nullable Object>- Overrides:
containsin classAbstractCollection<K extends @Nullable Object>
-
remove
public boolean remove(@Nullable Object o)
- Specified by:
removein interfaceCollection<K extends @Nullable Object>- Specified by:
removein interfaceSet<K extends @Nullable Object>- Overrides:
removein classAbstractCollection<K extends @Nullable Object>
-
clear
public void clear()
- Specified by:
clearin interfaceCollection<K extends @Nullable Object>- Specified by:
clearin interfaceSet<K extends @Nullable Object>- Overrides:
clearin classAbstractCollection<K extends @Nullable Object>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAllin interfaceCollection<E extends @Nullable Object>- Specified by:
removeAllin interfaceSet<E extends @Nullable Object>- Overrides:
removeAllin classAbstractSet<E extends @Nullable Object>
-
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAllin interfaceCollection<E extends @Nullable Object>- Specified by:
retainAllin interfaceSet<E extends @Nullable Object>- Overrides:
retainAllin classAbstractCollection<E extends @Nullable Object>
-
-