Class ByteTrieNode<T>

java.lang.Object
ghidra.util.search.trie.ByteTrieNode<T>
Type Parameters:
T - the user item type
All Implemented Interfaces:
ByteTrieNodeIfc<T>
Direct Known Subclasses:
CaseInsensitiveByteTrieNode

public class ByteTrieNode<T> extends Object implements ByteTrieNodeIfc<T>
Class to represent a (possibly non-terminal!) node within the ByteTrie.
  • Method Summary

    Modifier and Type
    Method
    Description
    getChild(byte value)
    Returns the child node (successor in the byte sequence) which has byte value, or null if no such child exists.
    protected byte
    Returns the final byte in the byte sequence represented by this node (fast, but uses a bitmask).
    Returns the user item stored in a terminal node (or null in an internal node).
    byte[]
    Returns a new byte array with the value of the byte sequence represented by this node (slow, built from scratch every time).
    boolean
    Returns whether this node represents a byte sequence in the trie or just an internal node on our way down to one.
    int
    Returns the length of the byte sequence represented by this node (cached integer, very fast).
     
    protected byte
    transformByte(byte v)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Method Details

    • transformByte

      protected byte transformByte(byte v)
    • isTerminal

      public boolean isTerminal()
      Returns whether this node represents a byte sequence in the trie or just an internal node on our way down to one.
      Specified by:
      isTerminal in interface ByteTrieNodeIfc<T>
      Returns:
      whether this node represents a terminal value
    • getItem

      public T getItem()
      Returns the user item stored in a terminal node (or null in an internal node).
      Specified by:
      getItem in interface ByteTrieNodeIfc<T>
      Returns:
      the user item
    • length

      public int length()
      Returns the length of the byte sequence represented by this node (cached integer, very fast).
      Specified by:
      length in interface ByteTrieNodeIfc<T>
      Returns:
      the length of the byte sequence
    • getValue

      public byte[] getValue()
      Returns a new byte array with the value of the byte sequence represented by this node (slow, built from scratch every time).
      Specified by:
      getValue in interface ByteTrieNodeIfc<T>
      Returns:
      the byte sequence
    • getId

      protected byte getId()
      Returns the final byte in the byte sequence represented by this node (fast, but uses a bitmask).
      Returns:
      the final byte in the byte sequence
    • getChild

      public ByteTrieNode<T> getChild(byte value)
      Returns the child node (successor in the byte sequence) which has byte value, or null if no such child exists.
      Parameters:
      value - the byte value
      Returns:
      the child node if present or null
    • toString

      public String toString()
      Overrides:
      toString in class Object