Interface ByteTrie


public interface ByteTrie
Interface for a data retrieval tree (trie) of bytes.
  • Method Summary

    Modifier and Type
    Method
    Description
    static ByteTrie
    copyOf(Set<String> set, boolean ignoreCase)
    Creates a new ByteTrie from the provided set.
    static ByteTrie
    copyOfChars(Set<Character> set, boolean ignoreCase)
    Creates a new ByteTrie from the provided set.
    default int
    match(byte[] str)
    Searches for the longest matching string in the trie that matches the provided string.
    int
    match(byte[] str, int startIndex, int endIndex)
    Searches for the longest matching string in the trie that matches the provided string.
  • Method Details

    • match

      default int match(byte[] str)
      Searches for the longest matching string in the trie that matches the provided string.
      Parameters:
      str - a string in the form of a byte array
      Returns:
      the length of the longest matching string, or 0 if no string matches
    • match

      int match(byte[] str, int startIndex, int endIndex)
      Searches for the longest matching string in the trie that matches the provided string.
      Parameters:
      str - a string
      startIndex - start index (inclusive)
      endIndex - end index (exclusive)
      Returns:
      the length of the longest matching string, or 0 if no string matches
    • copyOf

      static ByteTrie copyOf(Set<String> set, boolean ignoreCase)
      Creates a new ByteTrie from the provided set.
      Parameters:
      set - a set of strings
      ignoreCase - whether the ByteTrie shall ignore the case of the characters
      Returns:
      a new ByteTrie instance
    • copyOfChars

      static ByteTrie copyOfChars(Set<Character> set, boolean ignoreCase)
      Creates a new ByteTrie from the provided set.
      Parameters:
      set - a set of characters
      ignoreCase - whether the ByteTrie shall ignore the case of the characters
      Returns:
      a new ByteTrie instance