Class ByteTrie<T>

java.lang.Object
org.apache.pdfbox.util.filetypedetector.ByteTrie<T>
Type Parameters:
T - the type of value to store for byte sequences

class ByteTrie<T> extends Object
  • Field Details

  • Constructor Details

    • ByteTrie

      ByteTrie()
  • Method Details

    • find

      public T find(byte[] bytes)
      Return the most specific value stored for this byte sequence. If not found, returns null or a default values as specified by calling setDefaultValue(T).
      Parameters:
      bytes -
      Returns:
    • addPath

      public void addPath(T value, byte[]... parts)
      Store the given value at the specified path.
      Parameters:
      value -
      parts -
    • setDefaultValue

      public void setDefaultValue(T defaultValue)
      Sets the default value to use in find(byte[]) when no path matches.
      Parameters:
      defaultValue -
    • getMaxDepth

      public int getMaxDepth()
      Gets the maximum depth stored in this trie.
      Returns: