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) privateSafeTreeMap(NavigableMap<K, V> delegate) SafeTreeMap(SortedMap<K, ? extends V> map) -
Method Summary
Modifier and TypeMethodDescriptionceilingEntry(K key) ceilingKey(K key) private <T> TcheckValid(T t) voidclear()Comparator<? super K> booleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()booleanfirstKey()floorEntry(K key) inthashCode()higherEntry(K key) booleanisEmpty()keySet()lastKey()lowerEntry(K key) voidintsize()toString()values()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAllMethods inherited from interface java.util.NavigableMap
reversedMethods 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:
ceilingEntryin interfaceNavigableMap<K,V>
-
ceilingKey
- Specified by:
ceilingKeyin interfaceNavigableMap<K,V>
-
clear
public void clear() -
comparator
- Specified by:
comparatorin interfaceSortedMap<K,V>
-
containsKey
- Specified by:
containsKeyin interfaceMap<K,V>
-
containsValue
- Specified by:
containsValuein interfaceMap<K,V>
-
descendingKeySet
- Specified by:
descendingKeySetin interfaceNavigableMap<K,V>
-
descendingMap
- Specified by:
descendingMapin interfaceNavigableMap<K,V>
-
entrySet
-
firstEntry
- Specified by:
firstEntryin interfaceNavigableMap<K,V> - Specified by:
firstEntryin interfaceSequencedMap<K,V>
-
firstKey
-
floorEntry
- Specified by:
floorEntryin interfaceNavigableMap<K,V>
-
floorKey
- Specified by:
floorKeyin interfaceNavigableMap<K,V>
-
get
-
headMap
-
headMap
- Specified by:
headMapin interfaceNavigableMap<K,V>
-
higherEntry
- Specified by:
higherEntryin interfaceNavigableMap<K,V>
-
higherKey
- Specified by:
higherKeyin interfaceNavigableMap<K,V>
-
isEmpty
public boolean isEmpty() -
keySet
-
lastEntry
- Specified by:
lastEntryin interfaceNavigableMap<K,V> - Specified by:
lastEntryin interfaceSequencedMap<K,V>
-
lastKey
-
lowerEntry
- Specified by:
lowerEntryin interfaceNavigableMap<K,V>
-
lowerKey
- Specified by:
lowerKeyin interfaceNavigableMap<K,V>
-
pollFirstEntry
- Specified by:
pollFirstEntryin interfaceNavigableMap<K,V> - Specified by:
pollFirstEntryin interfaceSequencedMap<K,V>
-
pollLastEntry
- Specified by:
pollLastEntryin interfaceNavigableMap<K,V> - Specified by:
pollLastEntryin interfaceSequencedMap<K,V>
-
put
-
putAll
-
remove
-
size
public int size() -
subMap
- Specified by:
subMapin interfaceNavigableMap<K,V>
-
subMap
-
tailMap
-
tailMap
- Specified by:
tailMapin interfaceNavigableMap<K,V>
-
values
-
checkValid
private <T> T checkValid(T t) -
equals
-
hashCode
public int hashCode() -
toString
-