Class ByteTrie


  • public class ByteTrie
    extends Object
    • Constructor Detail

      • ByteTrie

        public ByteTrie()
    • Method Detail

      • size

        public int size()
      • getHashCode

        public int getHashCode​(String s)
        Returns unique hash code for a string.
        Returns:
        negative - an error occured, 0 - no such string in trie, positive - actual hashcode
      • getString

        public String getString​(int hashCode)
        Returns string by unique hash code.
      • getHashCodeForReversedString

        public int getHashCodeForReversedString​(String s)
        Returns unique hash code for a reversed string.
      • getReversedString

        public String getReversedString​(int hashCode)
        Returns reversed string by unique hash code.
      • getHashCode

        public int getHashCode​(byte[] bytes)
      • getHashCode

        public int getHashCode​(byte[] bytes,
                               int offset,
                               int length)
      • getMaximumMatch

        public long getMaximumMatch​(byte[] bytes,
                                    int offset,
                                    int length)
      • getBytes

        public byte[] getBytes​(int hashCode)
      • getHashCodeForReversedBytes

        public int getHashCodeForReversedBytes​(byte[] bytes)
      • getHashCodeForReversedBytes

        public int getHashCodeForReversedBytes​(byte[] bytes,
                                               int offset,
                                               int length)
      • getReversedBytes

        public byte[] getReversedBytes​(int hashCode)