public class TrieArc<T> extends Object
Modifier and Type | Field and Description |
---|---|
protected char[] |
code
Character that match this arc.
|
protected TrieArc<T> |
next
Next alternative node if this node does not match.
|
protected TrieNode<T> |
target
Target node at the end of this arc.
|
Constructor and Description |
---|
TrieArc(TrieNode<T> target,
char code)
Creates a new instance of TrieArc.
|
Modifier and Type | Method and Description |
---|---|
int |
length()
Number of characters to be consumed if this arc matches the input.
|
int |
match(CharSequence seq,
int i)
Returns length() if this arc matches the input, 0 otherwise.
|
void |
pack()
Merge neighbour nodes if they are degenerated trees.
|
String |
toString() |
public void pack()
public int length()
public int match(CharSequence seq, int i)
Copyright © 2013 Oracle Corporation. All rights reserved.