public class ByteArrayNodeNonLeafVoidValue extends Object implements Node
CharArrayNodeNonLeafVoidValue
but represents
each character in UTF-8, instead of Java's default 2-byte UFT-16 encoding.
Supports only characters which can be represented as a single byte in UTF-8. Throws an exception if characters
are encountered which cannot be represented as a single byte.Constructor and Description |
---|
ByteArrayNodeNonLeafVoidValue(CharSequence edgeCharSequence,
List<Node> outgoingEdges) |
Modifier and Type | Method and Description |
---|---|
CharSequence |
getIncomingEdge()
Returns all characters of the "edge" encoded in this node, belonging to the connection from a parent node to this
node.
|
Character |
getIncomingEdgeFirstCharacter()
Returns the first character of the "edge" encoded in this node, belonging to the connection from a parent node to
this node.
|
Node |
getOutgoingEdge(Character edgeFirstCharacter)
Returns the child of this node whose edge starts with the given first character.
|
List<Node> |
getOutgoingEdges()
Returns a read-only list of the child nodes to which this node has outgoing edges, i.e.
|
Object |
getValue()
Returns a value object which has been associated with a key and which is stored in this node, or returns
null if no value is stored in this node. |
String |
toString() |
void |
updateOutgoingEdge(Node childNode)
Updates the child node reference for a given edge (identified by its first character) to point to a different
child node.
|
public ByteArrayNodeNonLeafVoidValue(CharSequence edgeCharSequence, List<Node> outgoingEdges)
public CharSequence getIncomingEdge()
Node
getIncomingEdge
in interface Node
public Character getIncomingEdgeFirstCharacter()
Node
getIncomingEdgeFirstCharacter
in interface Node
getIncomingEdgeFirstCharacter
in interface NodeCharacterProvider
public Object getValue()
Node
null
if no value is stored in this node.public Node getOutgoingEdge(Character edgeFirstCharacter)
Node
Node.updateOutgoingEdge(Node)
.getOutgoingEdge
in interface Node
edgeFirstCharacter
- The first character of the edge for which the associated child node is requirednull
if this
node has no such outgoing edgepublic void updateOutgoingEdge(Node childNode)
Node
Node.getOutgoingEdge(Character)
.updateOutgoingEdge
in interface Node
childNode
- The new child node to associated with this edgepublic List<Node> getOutgoingEdges()
Node
getOutgoingEdges
in interface Node
Copyright © 2017. All Rights Reserved.