Package com.google.common.collect
Class ForwardingSortedMap.StandardKeySet
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<E>
-
- com.google.common.collect.ForwardingSortedMap.StandardKeySet
-
- All Implemented Interfaces:
Iterable<K>
,Collection<K>
,Set<K>
,SortedSet<K>
protected class ForwardingSortedMap.StandardKeySet extends AbstractSet<E>
A sensible implementation ofSortedMap.keySet()
in terms of the methods ofForwardingSortedMap
. In many cases, you may wish to overrideForwardingMap.keySet()
to forward to this implementation or a subclass thereof.- Since:
- 15.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()
Comparator<? super K>
comparator()
boolean
contains(Object o)
K
first()
SortedSet<K>
headSet(K toElement)
boolean
isEmpty()
Iterator<K>
iterator()
K
last()
boolean
remove(Object o)
boolean
removeAll(Collection<?> c)
boolean
retainAll(Collection<?> c)
int
size()
SortedSet<K>
subSet(K fromElement, K toElement)
SortedSet<K>
tailSet(K fromElement)
-
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, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
-
Methods inherited from interface java.util.SortedSet
spliterator
-
-
-
-
Constructor Detail
-
StandardKeySet
public StandardKeySet()
Constructor for use by subclasses.
-
-
Method Detail
-
comparator
@CheckForNull public Comparator<? super K> comparator()
- Specified by:
comparator
in interfaceSortedSet<K extends @Nullable Object>
-
subSet
public SortedSet<K> subSet(K fromElement, K toElement)
-
headSet
public SortedSet<K> headSet(K toElement)
-
tailSet
public SortedSet<K> tailSet(K fromElement)
-
iterator
public Iterator<K> iterator()
-
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)
-
-