Class AbstractPatriciaTrie.RangeMap

    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Set<java.util.Map.Entry<K,​V>> entrySet
      The entrySet() view.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private RangeMap()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Comparator<? super K> comparator()  
      boolean containsKey​(java.lang.Object key)  
      protected abstract java.util.Set<java.util.Map.Entry<K,​V>> createEntrySet()
      Creates and returns an entrySet() view of the AbstractPatriciaTrie.RangeMap.
      protected abstract java.util.SortedMap<K,​V> createRangeMap​(K fromKey, boolean fromInclusive, K toKey, boolean toInclusive)
      Creates and returns a sub-range view of the current AbstractPatriciaTrie.RangeMap.
      java.util.Set<java.util.Map.Entry<K,​V>> entrySet()  
      V get​(java.lang.Object key)  
      protected abstract K getFromKey()
      Returns the FROM Key.
      protected abstract K getToKey()
      Returns the TO Key.
      java.util.SortedMap<K,​V> headMap​(K toKey)  
      protected boolean inFromRange​(K key, boolean forceInclusive)
      Returns true if the provided key is in the FROM range of the AbstractPatriciaTrie.RangeMap.
      protected boolean inRange​(K key)
      Returns true if the provided key is greater than TO and less than FROM.
      protected boolean inRange2​(K key)
      This form allows the high endpoint (as well as all legit keys).
      protected boolean inToRange​(K key, boolean forceInclusive)
      Returns true if the provided key is in the TO range of the AbstractPatriciaTrie.RangeMap.
      protected abstract boolean isFromInclusive()
      Whether or not the getFromKey() is in the range.
      protected abstract boolean isToInclusive()
      Whether or not the getToKey() is in the range.
      V put​(K key, V value)  
      V remove​(java.lang.Object key)  
      java.util.SortedMap<K,​V> subMap​(K fromKey, K toKey)  
      java.util.SortedMap<K,​V> tailMap​(K fromKey)  
      • Methods inherited from class java.util.AbstractMap

        clear, clone, containsValue, equals, hashCode, isEmpty, 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.Map

        clear, compute, computeIfAbsent, computeIfPresent, containsValue, equals, forEach, getOrDefault, hashCode, isEmpty, merge, putAll, putIfAbsent, remove, replace, replace, replaceAll, size
      • Methods inherited from interface java.util.SortedMap

        firstKey, keySet, lastKey, values
    • Field Detail

      • entrySet

        private transient volatile java.util.Set<java.util.Map.Entry<K,​V>> entrySet
        The entrySet() view.
    • Constructor Detail

      • RangeMap

        private RangeMap()
    • Method Detail

      • getFromKey

        protected abstract K getFromKey()
        Returns the FROM Key.
      • isFromInclusive

        protected abstract boolean isFromInclusive()
        Whether or not the getFromKey() is in the range.
      • getToKey

        protected abstract K getToKey()
        Returns the TO Key.
      • isToInclusive

        protected abstract boolean isToInclusive()
        Whether or not the getToKey() is in the range.
      • comparator

        public java.util.Comparator<? super K> comparator()
        Specified by:
        comparator in interface java.util.SortedMap<K,​V>
      • containsKey

        public boolean containsKey​(java.lang.Object key)
        Specified by:
        containsKey in interface java.util.Map<K,​V>
        Overrides:
        containsKey in class java.util.AbstractMap<K,​V>
      • remove

        public V remove​(java.lang.Object key)
        Specified by:
        remove in interface java.util.Map<K,​V>
        Overrides:
        remove in class java.util.AbstractMap<K,​V>
      • get

        public V get​(java.lang.Object key)
        Specified by:
        get in interface java.util.Map<K,​V>
        Overrides:
        get in class java.util.AbstractMap<K,​V>
      • put

        public V put​(K key,
                     V value)
        Specified by:
        put in interface java.util.Map<K,​V>
        Overrides:
        put in class java.util.AbstractMap<K,​V>
      • entrySet

        public java.util.Set<java.util.Map.Entry<K,​V>> entrySet()
        Specified by:
        entrySet in interface java.util.Map<K,​V>
        Specified by:
        entrySet in interface java.util.SortedMap<K,​V>
        Specified by:
        entrySet in class java.util.AbstractMap<K,​V>
      • subMap

        public java.util.SortedMap<K,​V> subMap​(K fromKey,
                                                     K toKey)
        Specified by:
        subMap in interface java.util.SortedMap<K,​V>
      • headMap

        public java.util.SortedMap<K,​V> headMap​(K toKey)
        Specified by:
        headMap in interface java.util.SortedMap<K,​V>
      • tailMap

        public java.util.SortedMap<K,​V> tailMap​(K fromKey)
        Specified by:
        tailMap in interface java.util.SortedMap<K,​V>
      • inRange

        protected boolean inRange​(K key)
        Returns true if the provided key is greater than TO and less than FROM.
      • inRange2

        protected boolean inRange2​(K key)
        This form allows the high endpoint (as well as all legit keys).
      • inFromRange

        protected boolean inFromRange​(K key,
                                      boolean forceInclusive)
        Returns true if the provided key is in the FROM range of the AbstractPatriciaTrie.RangeMap.
      • inToRange

        protected boolean inToRange​(K key,
                                    boolean forceInclusive)
        Returns true if the provided key is in the TO range of the AbstractPatriciaTrie.RangeMap.
      • createRangeMap

        protected abstract java.util.SortedMap<K,​V> createRangeMap​(K fromKey,
                                                                         boolean fromInclusive,
                                                                         K toKey,
                                                                         boolean toInclusive)
        Creates and returns a sub-range view of the current AbstractPatriciaTrie.RangeMap.