public interface Node extends Comparable<Node>
Modifier and Type | Interface and Description |
---|---|
static interface |
Node.Iterable
Represents a
NearIterable that returns node items. |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Node other) |
Node.Iterable |
findChildren()
Returns an iterable that contains the child nodes of this node.
|
Node |
findOrCreate(Symbol symbol,
Direction direction)
Finds or creates a child node of this node with the given symbol and direction.
|
int |
getDepth()
Returns the depth of the node in the tree.
|
Direction |
getDirection()
Returns the direction associated with this node.
|
boolean |
getExtensible()
Returns a flag that indicates whether the tree may be extended beyond this node.
|
Node |
getParent()
Returns the parent node of this node.
|
Structure |
getStructure()
Returns the structure that contains this node.
|
Symbol |
getSymbol()
Returns the symbol associated with this node.
|
boolean |
isPrefixOf(Node other)
Returns a flag that indicates whether this node is a prefix of the given node
|
void |
showPath(StringBuilder builder)
Appends a representation of the path to this node to the given string builder.
|
void |
showPathReverse(StringBuilder builder)
Appends a representation of the path to this node to the given string builder.
|
Structure getStructure()
Node getParent()
Encounter
Node.Iterable findChildren()
Symbol getSymbol()
Direction getDirection()
int getDepth()
boolean getExtensible()
true
if the tree may be extended beyond this node; false
otherwiseNode findOrCreate(Symbol symbol, Direction direction)
symbol
- The symbol associated with the requested nodedirection
- The direction associated with the requested nodeIllegalStateException
- if this node is not extensibleboolean isPrefixOf(Node other)
other
- The node to compare againsttrue
if this node is a prefix of the other node; false
otherwisevoid showPath(StringBuilder builder)
builder
- The builder to usevoid showPathReverse(StringBuilder builder)
builder
- The builder to useint compareTo(Node other)
compareTo
in interface Comparable<Node>
Copyright © 2013. All Rights Reserved.