Class ArrayTernaryTrie.Growing<V>

  • All Implemented Interfaces:
    Trie<V>
    Enclosing class:
    ArrayTernaryTrie<V>

    public static class ArrayTernaryTrie.Growing<V>
    extends java.lang.Object
    implements Trie<V>
    • Constructor Summary

      Constructors 
      Constructor Description
      Growing()  
      Growing​(boolean insensitive, int capacity, int growby)  
      Growing​(int capacity, int growby)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()  
      void dump()  
      boolean equals​(java.lang.Object obj)  
      V get​(java.lang.String s)
      Get an exact match from a String key
      V get​(java.lang.String s, int offset, int len)
      Get an exact match from a String key
      V get​(java.nio.ByteBuffer b)
      Get an exact match from a segment of a ByteBuufer as key
      V get​(java.nio.ByteBuffer b, int offset, int len)
      Get an exact match from a segment of a ByteBuufer as key
      V getBest​(byte[] b, int offset, int len)
      Get the best match from key in a byte array.
      V getBest​(java.lang.String s)
      Get the best match from key in a String.
      V getBest​(java.lang.String s, int offset, int length)
      Get the best match from key in a String.
      V getBest​(java.nio.ByteBuffer b, int offset, int len)
      Get the best match from key in a byte buffer.
      int hashCode()  
      boolean isCaseInsensitive()  
      boolean isEmpty()  
      boolean isFull()  
      java.util.Set<java.lang.String> keySet()  
      boolean put​(java.lang.String s, V v)
      Put an entry into the Trie
      boolean put​(V v)
      Put a value as both a key and a value.
      V remove​(java.lang.String s)  
      int size()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Growing

        public Growing()
      • Growing

        public Growing​(int capacity,
                       int growby)
      • Growing

        public Growing​(boolean insensitive,
                       int capacity,
                       int growby)
    • Method Detail

      • put

        public boolean put​(V v)
        Description copied from interface: Trie
        Put a value as both a key and a value.
        Specified by:
        put in interface Trie<V>
        Parameters:
        v - The value and key
        Returns:
        True if the Trie had capacity to add the field.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • remove

        public V remove​(java.lang.String s)
        Specified by:
        remove in interface Trie<V>
      • get

        public V get​(java.lang.String s)
        Description copied from interface: Trie
        Get an exact match from a String key
        Specified by:
        get in interface Trie<V>
        Parameters:
        s - The key
        Returns:
        the value for the string key
      • get

        public V get​(java.nio.ByteBuffer b)
        Description copied from interface: Trie
        Get an exact match from a segment of a ByteBuufer as key
        Specified by:
        get in interface Trie<V>
        Parameters:
        b - The buffer
        Returns:
        The value or null if not found
      • getBest

        public V getBest​(byte[] b,
                         int offset,
                         int len)
        Description copied from interface: Trie
        Get the best match from key in a byte array. The key is assumed to by ISO_8859_1 characters.
        Specified by:
        getBest in interface Trie<V>
        Parameters:
        b - The buffer
        offset - The offset within the array of the key
        len - the length of the key
        Returns:
        The value or null if not found
      • isCaseInsensitive

        public boolean isCaseInsensitive()
        Specified by:
        isCaseInsensitive in interface Trie<V>
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • clear

        public void clear()
        Specified by:
        clear in interface Trie<V>
      • put

        public boolean put​(java.lang.String s,
                           V v)
        Description copied from interface: Trie
        Put an entry into the Trie
        Specified by:
        put in interface Trie<V>
        Parameters:
        s - The key for the entry
        v - The value of the entry
        Returns:
        True if the Trie had capacity to add the field.
      • get

        public V get​(java.lang.String s,
                     int offset,
                     int len)
        Description copied from interface: Trie
        Get an exact match from a String key
        Specified by:
        get in interface Trie<V>
        Parameters:
        s - The key
        offset - The offset within the string of the key
        len - the length of the key
        Returns:
        the value for the string / offset / length
      • get

        public V get​(java.nio.ByteBuffer b,
                     int offset,
                     int len)
        Description copied from interface: Trie
        Get an exact match from a segment of a ByteBuufer as key
        Specified by:
        get in interface Trie<V>
        Parameters:
        b - The buffer
        offset - The offset within the buffer of the key
        len - the length of the key
        Returns:
        The value or null if not found
      • getBest

        public V getBest​(java.lang.String s)
        Description copied from interface: Trie
        Get the best match from key in a String.
        Specified by:
        getBest in interface Trie<V>
        Parameters:
        s - The string
        Returns:
        The value or null if not found
      • getBest

        public V getBest​(java.lang.String s,
                         int offset,
                         int length)
        Description copied from interface: Trie
        Get the best match from key in a String.
        Specified by:
        getBest in interface Trie<V>
        Parameters:
        s - The string
        offset - The offset within the string of the key
        length - the length of the key
        Returns:
        The value or null if not found
      • getBest

        public V getBest​(java.nio.ByteBuffer b,
                         int offset,
                         int len)
        Description copied from interface: Trie
        Get the best match from key in a byte buffer. The key is assumed to by ISO_8859_1 characters.
        Specified by:
        getBest in interface Trie<V>
        Parameters:
        b - The buffer
        offset - The offset within the buffer of the key
        len - the length of the key
        Returns:
        The value or null if not found
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • keySet

        public java.util.Set<java.lang.String> keySet()
        Specified by:
        keySet in interface Trie<V>
      • isFull

        public boolean isFull()
        Specified by:
        isFull in interface Trie<V>
      • dump

        public void dump()
      • isEmpty

        public boolean isEmpty()
      • size

        public int size()