Package org.passay.dictionary
Class TernaryNode
java.lang.Object
org.passay.dictionary.TernaryNode
Implementation of a node contained in a ternary tree.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanwhether this character is the end of a word.private TernaryNodeequal child of this node.private TernaryNodehigh child of this node.private TernaryNodelow child of this node.private intcode point of this node. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetEqkid()Returns the eqkid node in relation to this node.getHikid()Returns the hikid node in relation to this node.getLokid()Returns the lokid node in relation to this node.intReturns the split character.booleanReturns whether this node is at the end of a word.voidsetEndOfWord(boolean b) Sets whether this node is at the end of a word.voidsetEqkid(TernaryNode node) Sets the eqkid node in relation to this node.voidsetHikid(TernaryNode node) Sets the hikid node in relation to this node.voidsetLokid(TernaryNode node) Sets the lokid node in relation to this node.voidsetSplitChar(int cp) Sets the split character.
-
Field Details
-
splitchar
private int splitcharcode point of this node. -
endOfWord
private boolean endOfWordwhether this character is the end of a word. -
lokid
low child of this node. -
eqkid
equal child of this node. -
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
Returns the lokid node in relation to this node.- Returns:
- ternary node
-
setLokid
Sets the lokid node in relation to this node.- Parameters:
node- ternary node
-
getEqkid
Returns the eqkid node in relation to this node.- Returns:
- ternary node
-
setEqkid
Sets the eqkid node in relation to this node.- Parameters:
node- ternary node
-
getHikid
Returns the hikid node in relation to this node.- Returns:
- ternary node
-
setHikid
Sets the hikid node in relation to this node.- Parameters:
node- ternary node
-