Class TernaryNode

java.lang.Object
org.passay.dictionary.TernaryNode

public class TernaryNode extends Object
Implementation of a node contained in a ternary tree.
  • Field Details

    • splitchar

      private int splitchar
      code point of this node.
    • endOfWord

      private boolean endOfWord
      whether this character is the end of a word.
    • lokid

      private TernaryNode lokid
      low child of this node.
    • eqkid

      private TernaryNode eqkid
      equal child of this node.
    • hikid

      private TernaryNode hikid
      high child of this node.
  • Constructor Details

    • TernaryNode

      public TernaryNode(int cp)
      Create a new ternary node with the supplied code point.
      Parameters:
      cp - code point
  • Method Details

    • getSplitChar

      public int getSplitChar()
      Returns the split character.
      Returns:
      code point
    • setSplitChar

      public void setSplitChar(int cp)
      Sets the split character.
      Parameters:
      cp - code point
    • isEndOfWord

      public boolean isEndOfWord()
      Returns whether this node is at the end of a word.
      Returns:
      whether this node is at the end of a word
    • setEndOfWord

      public void setEndOfWord(boolean b)
      Sets whether this node is at the end of a word.
      Parameters:
      b - whether this node is at the end of a word
    • getLokid

      public TernaryNode getLokid()
      Returns the lokid node in relation to this node.
      Returns:
      ternary node
    • setLokid

      public void setLokid(TernaryNode node)
      Sets the lokid node in relation to this node.
      Parameters:
      node - ternary node
    • getEqkid

      public TernaryNode getEqkid()
      Returns the eqkid node in relation to this node.
      Returns:
      ternary node
    • setEqkid

      public void setEqkid(TernaryNode node)
      Sets the eqkid node in relation to this node.
      Parameters:
      node - ternary node
    • getHikid

      public TernaryNode getHikid()
      Returns the hikid node in relation to this node.
      Returns:
      ternary node
    • setHikid

      public void setHikid(TernaryNode node)
      Sets the hikid node in relation to this node.
      Parameters:
      node - ternary node