Class ImmutableBinaryTrie.Node
java.lang.Object
it.unimi.dsi.util.ImmutableBinaryTrie.Node
- All Implemented Interfaces:
Serializable
- Enclosing class:
ImmutableBinaryTrie<T>
A node in the trie.
- Since:
- 0.9.2
- Author:
- Sebastiano Vigna
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal long[]An array containing the path compacted in this node (nullif there is no compaction at this node).final intThe length of the path compacted in this node (0 if there is no compaction at this node).final intIf nonnegative, this node represent theword-th word. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
left
-
right
-
path
public final long[] pathAn array containing the path compacted in this node (nullif there is no compaction at this node). -
pathLength
public final int pathLengthThe length of the path compacted in this node (0 if there is no compaction at this node). -
word
public final int wordIf nonnegative, this node represent theword-th word.
-
-
Constructor Details
-
Node
Creates a node representing a word.Note that the long array contained in
pathwill be stored inside the node.- Parameters:
path- the path compacted in this node, ornullfor the empty path.word- the index of the word represented by this node.
-
Node
Creates a node that does not represent a word.- Parameters:
path- the path compacted in this node, ornullfor the empty path.
-
-
Method Details
-
isLeaf
public boolean isLeaf()Returns true if this node is a leaf.- Returns:
- true if this node is a leaf.
-
toString
-