edu.wisc.ssec.mcidasv.util.trie
Class PatriciaTrie.SubMap

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by 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 Class Summary
(package private)  class PatriciaTrie.SubMap.EntrySetView
           
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
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)
           
 
Method Summary
 Comparator<? super K> comparator()
           
 boolean containsKey(Object key)
           
 Set<Map.Entry<K,V>> entrySet()
           
 K firstKey()
           
 V get(Object key)
           
 SortedMap<K,V> headMap(K toKey)
           
protected  boolean inFromRange(K key, boolean forceInclusive)
           
protected  boolean inRange(K key)
           
protected  boolean inRange2(K key)
           
protected  boolean inToRange(K key, boolean forceInclusive)
           
 boolean isEmpty()
           
 K lastKey()
           
protected  Set<Map.Entry<K,V>> newSubMapEntrySet()
           
 V put(K key, V value)
           
 V remove(Object key)
           
 SortedMap<K,V> subMap(K fromKey, K toKey)
           
 SortedMap<K,V> tailMap(K fromKey)
           
 
Methods inherited from class java.util.AbstractMap
clear, clone, containsValue, equals, hashCode, keySet, putAll, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.SortedMap
keySet, values
 
Methods inherited from interface java.util.Map
clear, containsValue, equals, hashCode, putAll, size
 

Field Detail

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
Constructor Detail

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)
Method Detail

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)