@GwtIncompatible public final class SafeTreeMap<K,V> extends java.lang.Object implements java.io.Serializable, java.util.NavigableMap<K,V>
TreeMap
that aggressively checks to see if keys are
mutually comparable. This implementation passes the navigable map test
suites.Modifier and Type | Field and Description |
---|---|
private java.util.NavigableMap<K,V> |
delegate |
private static java.util.Comparator<java.lang.Object> |
NATURAL_ORDER |
private static long |
serialVersionUID |
Modifier | Constructor and Description |
---|---|
|
SafeTreeMap() |
|
SafeTreeMap(java.util.Comparator<? super K> comparator) |
|
SafeTreeMap(java.util.Map<? extends K,? extends V> map) |
private |
SafeTreeMap(java.util.NavigableMap<K,V> delegate) |
|
SafeTreeMap(java.util.SortedMap<K,? extends V> map) |
Modifier and Type | Method and Description |
---|---|
java.util.Map.Entry<K,V> |
ceilingEntry(K key) |
K |
ceilingKey(K key) |
private <T> T |
checkValid(T t) |
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() |
private static final java.util.Comparator<java.lang.Object> NATURAL_ORDER
private static final long serialVersionUID
public SafeTreeMap()
public SafeTreeMap(java.util.Comparator<? super K> comparator)
public java.util.Comparator<? super K> comparator()
public boolean containsKey(java.lang.Object key)
public boolean containsValue(java.lang.Object value)
public java.util.NavigableSet<K> descendingKeySet()
public java.util.NavigableSet<K> keySet()
public java.util.NavigableSet<K> navigableKeySet()
public java.util.NavigableMap<K,V> subMap(K fromKey, boolean fromInclusive, K toKey, boolean toInclusive)
public java.util.Collection<V> values()
private <T> T checkValid(T t)
public boolean equals(java.lang.Object obj)
public int hashCode()
public java.lang.String toString()
toString
in class java.lang.Object