Class SafeTreeMap<K,V>
java.lang.Object
com.google.common.collect.testing.SafeTreeMap<K,V>
- All Implemented Interfaces:
Serializable
,Map<K,
,V> NavigableMap<K,
,V> SequencedMap<K,
,V> SortedMap<K,
V>
@GwtIncompatible
public final class SafeTreeMap<K,V>
extends Object
implements Serializable, NavigableMap<K,V>
A wrapper around
TreeMap
that aggressively checks to see if keys are mutually comparable.
This implementation passes the navigable map test suites.- Author:
- Louis Wasserman
- See Also:
-
Nested Class Summary
-
Constructor Summary
ConstructorsConstructorDescriptionSafeTreeMap
(Comparator<? super K> comparator) SafeTreeMap
(Map<? extends K, ? extends V> map) SafeTreeMap
(SortedMap<K, ? extends V> map) -
Method Summary
Modifier and TypeMethodDescriptionceilingEntry
(K key) @Nullable K
ceilingKey
(K key) void
clear()
Comparator
<? super K> boolean
containsKey
(Object key) boolean
containsValue
(Object value) entrySet()
boolean
firstKey()
floorEntry
(K key) @Nullable K
@Nullable V
int
hashCode()
higherEntry
(K key) @Nullable K
boolean
isEmpty()
keySet()
lastKey()
lowerEntry
(K key) @Nullable K
@Nullable V
void
@Nullable V
int
size()
toString()
values()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
Methods inherited from interface java.util.NavigableMap
reversed
Methods inherited from interface java.util.SequencedMap
sequencedEntrySet, sequencedKeySet, sequencedValues
-
Constructor Details
-
SafeTreeMap
public SafeTreeMap() -
SafeTreeMap
-
SafeTreeMap
-
SafeTreeMap
-
-
Method Details
-
ceilingEntry
- Specified by:
ceilingEntry
in interfaceNavigableMap<K,
V>
-
ceilingKey
- Specified by:
ceilingKey
in interfaceNavigableMap<K,
V>
-
clear
-
comparator
- Specified by:
comparator
in interfaceSortedMap<K,
V>
-
containsKey
- Specified by:
containsKey
in interfaceMap<K,
V>
-
containsValue
- Specified by:
containsValue
in interfaceMap<K,
V>
-
descendingKeySet
- Specified by:
descendingKeySet
in interfaceNavigableMap<K,
V>
-
descendingMap
- Specified by:
descendingMap
in interfaceNavigableMap<K,
V>
-
entrySet
-
firstEntry
- Specified by:
firstEntry
in interfaceNavigableMap<K,
V> - Specified by:
firstEntry
in interfaceSequencedMap<K,
V>
-
firstKey
-
floorEntry
- Specified by:
floorEntry
in interfaceNavigableMap<K,
V>
-
floorKey
-
get
-
headMap
-
headMap
- Specified by:
headMap
in interfaceNavigableMap<K,
V>
-
higherEntry
- Specified by:
higherEntry
in interfaceNavigableMap<K,
V>
-
higherKey
-
isEmpty
-
keySet
-
lastEntry
-
lastKey
-
lowerEntry
- Specified by:
lowerEntry
in interfaceNavigableMap<K,
V>
-
lowerKey
-
pollFirstEntry
- Specified by:
pollFirstEntry
in interfaceNavigableMap<K,
V> - Specified by:
pollFirstEntry
in interfaceSequencedMap<K,
V>
-
pollLastEntry
- Specified by:
pollLastEntry
in interfaceNavigableMap<K,
V> - Specified by:
pollLastEntry
in interfaceSequencedMap<K,
V>
-
put
-
putAll
-
remove
-
size
-
subMap
- Specified by:
subMap
in interfaceNavigableMap<K,
V>
-
subMap
-
tailMap
-
tailMap
- Specified by:
tailMap
in interfaceNavigableMap<K,
V>
-
values
-
equals
-
hashCode
-
toString
-