Class SafeTreeMap<K,V>
- java.lang.Object
-
- com.google.common.collect.testing.SafeTreeMap<K,V>
-
- All Implemented Interfaces:
java.io.Serializable
,java.util.Map<K,V>
,java.util.NavigableMap<K,V>
,java.util.SortedMap<K,V>
@GwtIncompatible public final class SafeTreeMap<K,V> extends java.lang.Object implements java.io.Serializable, java.util.NavigableMap<K,V>
A wrapper aroundTreeMap
that aggressively checks to see if keys are mutually comparable. This implementation passes the navigable map test suites.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SafeTreeMap()
SafeTreeMap(java.util.Comparator<? super K> comparator)
SafeTreeMap(java.util.Map<? extends K,? extends V> map)
SafeTreeMap(java.util.SortedMap<K,? extends V> map)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map.Entry<K,V>
ceilingEntry(K key)
K
ceilingKey(K key)
void
clear()
java.util.Comparator<? super K>
comparator()
boolean
containsKey(java.lang.Object key)
boolean
containsValue(java.lang.Object value)
java.util.NavigableSet<K>
descendingKeySet()
java.util.NavigableMap<K,V>
descendingMap()
java.util.Set<java.util.Map.Entry<K,V>>
entrySet()
boolean
equals(java.lang.Object obj)
java.util.Map.Entry<K,V>
firstEntry()
K
firstKey()
java.util.Map.Entry<K,V>
floorEntry(K key)
K
floorKey(K key)
V
get(java.lang.Object key)
int
hashCode()
java.util.SortedMap<K,V>
headMap(K toKey)
java.util.NavigableMap<K,V>
headMap(K toKey, boolean inclusive)
java.util.Map.Entry<K,V>
higherEntry(K key)
K
higherKey(K key)
boolean
isEmpty()
java.util.NavigableSet<K>
keySet()
java.util.Map.Entry<K,V>
lastEntry()
K
lastKey()
java.util.Map.Entry<K,V>
lowerEntry(K key)
K
lowerKey(K key)
java.util.NavigableSet<K>
navigableKeySet()
java.util.Map.Entry<K,V>
pollFirstEntry()
java.util.Map.Entry<K,V>
pollLastEntry()
V
put(K key, V value)
void
putAll(java.util.Map<? extends K,? extends V> map)
V
remove(java.lang.Object key)
int
size()
java.util.NavigableMap<K,V>
subMap(K fromKey, boolean fromInclusive, K toKey, boolean toInclusive)
java.util.SortedMap<K,V>
subMap(K fromKey, K toKey)
java.util.SortedMap<K,V>
tailMap(K fromKey)
java.util.NavigableMap<K,V>
tailMap(K fromKey, boolean inclusive)
java.lang.String
toString()
java.util.Collection<V>
values()
-
-
-
Method Detail
-
comparator
public java.util.Comparator<? super K> comparator()
-
containsKey
public boolean containsKey(java.lang.Object key)
-
containsValue
public boolean containsValue(java.lang.Object value)
-
descendingKeySet
public java.util.NavigableSet<K> descendingKeySet()
-
keySet
public java.util.NavigableSet<K> keySet()
-
navigableKeySet
public java.util.NavigableSet<K> navigableKeySet()
-
subMap
public java.util.NavigableMap<K,V> subMap(K fromKey, boolean fromInclusive, K toKey, boolean toInclusive)
-
values
public java.util.Collection<V> values()
-
equals
public boolean equals(java.lang.Object obj)
-
hashCode
public int hashCode()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-