Class Node


  • public class Node
    extends java.lang.Object
    A node in the tree that is used to store all key-value pairs.
    • Constructor Summary

      Constructors 
      Constructor Description
      Node()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @NotNull Node define​(char ch)
      Looks up or defines the next node for a given character.
      byte getId()
      Returns the id for this node.
      @Nullable Node lookup​(char ch)
      Looks up the next node for a given character.
      void setId​(byte id)
      Sets the id to return for this node.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Node

        public Node()
    • Method Detail

      • define

        @NotNull
        public @NotNull Node define​(char ch)
        Looks up or defines the next node for a given character.
        Parameters:
        ch - the character
        Returns:
        the next node
        Throws:
        java.lang.IndexOutOfBoundsException - if the character is not withing MIN..MAX
      • lookup

        @Nullable
        public @Nullable Node lookup​(char ch)
        Looks up the next node for a given character.
        Parameters:
        ch - the character
        Returns:
        the next node, or null if no key matching exists
      • setId

        public void setId​(byte id)
        Sets the id to return for this node.
        Parameters:
        id - the ide to set
      • getId

        public byte getId()
        Returns the id for this node.
        Returns:
        this id, or token.NULL if no key matches this node