Class ByteTrieNode
java.lang.Object
ch.randelshofer.fastdoubleparser.bte.ByteTrieNode
Represents a node in a
ByteTrieOfFew-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget(byte ch) Gets the child not for the given character, if it exists.private intindexOf(byte ch) Returns the index of the specified character in this node.insert(byte ch) Insert a character into this node if it does not already exist.insert(byte ch, ByteTrieNode forcedNode) Insert a character into this node if it does not already exist.booleanisEnd()voidsetEnd()
-
Field Details
-
chars
private byte[] chars -
children
-
isEnd
private boolean isEnd
-
-
Constructor Details
-
ByteTrieNode
public ByteTrieNode()
-
-
Method Details
-
insert
Insert a character into this node if it does not already exist. Returns the child node corresponding to the char.- Parameters:
ch- the character- Returns:
- the child node corresponding to the char
-
insert
Insert a character into this node if it does not already exist. Forces the node 'forceNode' to be inserted.- Parameters:
ch- the characterforcedNode- the forced node- Returns:
- the forced node
-
get
Gets the child not for the given character, if it exists.- Parameters:
ch- the character- Returns:
- the child node corresponding to the char, or the sentinel node
-
indexOf
private int indexOf(byte ch) Returns the index of the specified character in this node.- Parameters:
ch- the character- Returns:
- the index or -1
-
setEnd
public void setEnd() -
isEnd
public boolean isEnd()
-