edu.wisc.ssec.mcidasv.util.trie
Class PatriciaTrie.SubMap
java.lang.Object
java.util.AbstractMap<K,V>
edu.wisc.ssec.mcidasv.util.trie.PatriciaTrie.SubMap
- All Implemented Interfaces:
- Serializable, Map<K,V>, SortedMap<K,V>
- Direct Known Subclasses:
- PatriciaTrie.PrefixSubMap
- Enclosing class:
- PatriciaTrie<K,V>
private class PatriciaTrie.SubMap
- extends AbstractMap<K,V>
- implements SortedMap<K,V>, Serializable
Nested classes/interfaces inherited from interface java.util.Map |
Map.Entry<K,V> |
Field Summary |
private Set<Map.Entry<K,V>> |
entrySet
|
protected boolean |
fromInclusive
Whether or not the 'from' is inclusive. |
protected K |
fromKey
The key to start from, null if the beginning. |
protected boolean |
toInclusive
Whether or not the 'to' is inclusive. |
protected K |
toKey
The key to end at, null if till the end. |
Constructor Summary |
protected |
PatriciaTrie.SubMap()
Constructs a blank SubMap -- this should ONLY be used
by subclasses that wish to lazily construct their
fromKey or toKey |
(package private) |
PatriciaTrie.SubMap(K fromKey,
K toKey)
|
fromKey
protected K fromKey
- The key to start from, null if the beginning.
toKey
protected K toKey
- The key to end at, null if till the end.
fromInclusive
protected boolean fromInclusive
- Whether or not the 'from' is inclusive.
toInclusive
protected boolean toInclusive
- Whether or not the 'to' is inclusive.
entrySet
private transient Set<Map.Entry<K,V>> entrySet
PatriciaTrie.SubMap
protected PatriciaTrie.SubMap()
- Constructs a blank SubMap -- this should ONLY be used
by subclasses that wish to lazily construct their
fromKey or toKey
PatriciaTrie.SubMap
PatriciaTrie.SubMap(K fromKey,
K toKey)
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interface Map<K,V>
- Overrides:
isEmpty
in class AbstractMap<K,V>
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey
in interface Map<K,V>
- Overrides:
containsKey
in class AbstractMap<K,V>
remove
public V remove(Object key)
- Specified by:
remove
in interface Map<K,V>
- Overrides:
remove
in class AbstractMap<K,V>
get
public V get(Object key)
- Specified by:
get
in interface Map<K,V>
- Overrides:
get
in class AbstractMap<K,V>
put
public V put(K key,
V value)
- Specified by:
put
in interface Map<K,V>
- Overrides:
put
in class AbstractMap<K,V>
comparator
public Comparator<? super K> comparator()
- Specified by:
comparator
in interface SortedMap<K,V>
firstKey
public K firstKey()
- Specified by:
firstKey
in interface SortedMap<K,V>
lastKey
public K lastKey()
- Specified by:
lastKey
in interface SortedMap<K,V>
entrySet
public Set<Map.Entry<K,V>> entrySet()
- Specified by:
entrySet
in interface Map<K,V>
- Specified by:
entrySet
in interface SortedMap<K,V>
- Specified by:
entrySet
in class AbstractMap<K,V>
newSubMapEntrySet
protected Set<Map.Entry<K,V>> newSubMapEntrySet()
subMap
public SortedMap<K,V> subMap(K fromKey,
K toKey)
- Specified by:
subMap
in interface SortedMap<K,V>
headMap
public SortedMap<K,V> headMap(K toKey)
- Specified by:
headMap
in interface SortedMap<K,V>
tailMap
public SortedMap<K,V> tailMap(K fromKey)
- Specified by:
tailMap
in interface SortedMap<K,V>
inRange
protected boolean inRange(K key)
inRange2
protected boolean inRange2(K key)
inToRange
protected boolean inToRange(K key,
boolean forceInclusive)
inFromRange
protected boolean inFromRange(K key,
boolean forceInclusive)