Class ForwardingMap.StandardKeySet
java.lang.Object
java.util.AbstractCollection<K>
java.util.AbstractSet<K>
com.google.common.collect.ForwardingMap.StandardKeySet
- All Implemented Interfaces:
Iterable<K>, Collection<K>, Set<K>
- Enclosing class:
ForwardingMap<K,V>
A sensible implementation of
Map.keySet() in terms of the following
methods: ForwardingMap.clear(), ForwardingMap.containsKey(Object),
ForwardingMap.isEmpty(), ForwardingMap.remove(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.- Since:
- 10.0
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class AbstractSet
equals, hashCodeMethods inherited from class AbstractCollection
add, addAll, containsAll, toArray, toArray, toStringMethods inherited from interface Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface Set
add, addAll, containsAll, spliterator, toArray, toArray
-
Constructor Details
-
StandardKeySet
public StandardKeySet()Constructor for use by subclasses.
-
-
Method Details
-
iterator
- Specified by:
iteratorin interfaceCollection<K>- Specified by:
iteratorin interfaceIterable<K>- Specified by:
iteratorin interfaceSet<K>- Specified by:
iteratorin classAbstractCollection<K>
-
size
public int size()- Specified by:
sizein interfaceCollection<K>- Specified by:
sizein interfaceSet<K>- Specified by:
sizein classAbstractCollection<K>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<K>- Specified by:
isEmptyin interfaceSet<K>- Overrides:
isEmptyin classAbstractCollection<K>
-
contains
- Specified by:
containsin interfaceCollection<K>- Specified by:
containsin interfaceSet<K>- Overrides:
containsin classAbstractCollection<K>
-
remove
- Specified by:
removein interfaceCollection<K>- Specified by:
removein interfaceSet<K>- Overrides:
removein classAbstractCollection<K>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<K>- Specified by:
clearin interfaceSet<K>- Overrides:
clearin classAbstractCollection<K>
-
removeAll
- Specified by:
removeAllin interfaceCollection<E>- Specified by:
removeAllin interfaceSet<E>- Overrides:
removeAllin classAbstractSet<E>
-
retainAll
- Specified by:
retainAllin interfaceCollection<E>- Specified by:
retainAllin interfaceSet<E>- Overrides:
retainAllin classAbstractCollection<E>
-