Package it.unimi.dsi.big.util
Class ImmutableBinaryTrie.Node
- java.lang.Object
-
- it.unimi.dsi.big.util.ImmutableBinaryTrie.Node
-
- All Implemented Interfaces:
java.io.Serializable
- Enclosing class:
- ImmutableBinaryTrie<T>
protected static class ImmutableBinaryTrie.Node extends java.lang.Object implements java.io.Serializable
A node in the trie.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description ImmutableBinaryTrie.Node
left
long[]
path
An array containing the path compacted in this node (null
if there is no compaction at this node).int
pathLength
The length of the path compacted in this node (0 if there is no compaction at this node).ImmutableBinaryTrie.Node
right
long
word
If nonnegative, this node represent theword
-th word.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isLeaf()
Returns true if this node is a leaf.java.lang.String
toString()
-
-
-
Field Detail
-
left
public ImmutableBinaryTrie.Node left
-
right
public ImmutableBinaryTrie.Node right
-
path
public final long[] path
An array containing the path compacted in this node (null
if there is no compaction at this node).
-
pathLength
public final int pathLength
The length of the path compacted in this node (0 if there is no compaction at this node).
-
word
public final long word
If nonnegative, this node represent theword
-th word.
-
-
Constructor Detail
-
Node
public Node(BitVector path, int word)
Creates a node representing a word.Note that the long array contained in
path
will be stored inside the node.- Parameters:
path
- the path compacted in this node, ornull
for the empty path.word
- the index of the word represented by this node.
-
Node
public Node(BitVector path)
Creates a node that does not represent a word.- Parameters:
path
- the path compacted in this node, ornull
for the empty path.
-
-