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>
A wrapper around
TreeMap
that aggressively checks to see if keys are mutually comparable.
This implementation passes the navigable map test suites.- See Also:
-
Nested Class Summary
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final NavigableMap
<K, V> private static final Comparator
<Object> private static final long
-
Constructor Summary
ConstructorsModifierConstructorDescriptionSafeTreeMap
(Comparator<? super K> comparator) SafeTreeMap
(Map<? extends K, ? extends V> map) private
SafeTreeMap
(NavigableMap<K, V> delegate) SafeTreeMap
(SortedMap<K, ? extends V> map) -
Method Summary
Modifier and TypeMethodDescriptionceilingEntry
(K key) ceilingKey
(K key) private <T> T
checkValid
(T t) void
clear()
Comparator
<? super K> boolean
containsKey
(Object key) boolean
containsValue
(Object value) entrySet()
boolean
firstKey()
floorEntry
(K key) int
hashCode()
higherEntry
(K key) boolean
isEmpty()
keySet()
lastKey()
lowerEntry
(K key) void
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
-
Field Details
-
NATURAL_ORDER
-
delegate
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
-
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
public void 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
- Specified by:
floorKey
in interfaceNavigableMap<K,
V>
-
get
-
headMap
-
headMap
- Specified by:
headMap
in interfaceNavigableMap<K,
V>
-
higherEntry
- Specified by:
higherEntry
in interfaceNavigableMap<K,
V>
-
higherKey
- Specified by:
higherKey
in interfaceNavigableMap<K,
V>
-
isEmpty
public boolean isEmpty() -
keySet
-
lastEntry
- Specified by:
lastEntry
in interfaceNavigableMap<K,
V> - Specified by:
lastEntry
in interfaceSequencedMap<K,
V>
-
lastKey
-
lowerEntry
- Specified by:
lowerEntry
in interfaceNavigableMap<K,
V>
-
lowerKey
- Specified by:
lowerKey
in interfaceNavigableMap<K,
V>
-
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
public int size() -
subMap
- Specified by:
subMap
in interfaceNavigableMap<K,
V>
-
subMap
-
tailMap
-
tailMap
- Specified by:
tailMap
in interfaceNavigableMap<K,
V>
-
values
-
checkValid
private <T> T checkValid(T t) -
equals
-
hashCode
public int hashCode() -
toString
-