Class TrieNode

java.lang.Object
com.digicert.validation.psl.TrieNode

public class TrieNode extends Object
A node in the Trie. Each node represents a single character in a word.

This class is used to construct a Trie data structure, which is a type of search tree used to store a dynamic set or associative array where the keys are usually strings. Each node in the Trie represents a single character of a word, and the path from the root to a node represents a prefix of the word.

  • Field Details

    • children

      final Map<Character,TrieNode> children
      The children of this node, where each key is a character and the value is the corresponding child node.

      This map is used to store the links to the child nodes, allowing the Trie to branch out for each character in the alphabet. The keys in this map are characters, and the values are the TrieNode instances that represent the next character in the sequence.

    • isEndOfWord

      boolean isEndOfWord
      Indicates whether this node represents the end of a word.

      This boolean flag is used to mark the end of a valid word in the Trie. When this flag is true, it means that the path from the root to this node forms a complete word that is stored in the Trie.

  • Constructor Details

    • TrieNode

      public TrieNode()
      Default constructor for TrieNode.