public class Node
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Node.Type |
static interface |
Node.Visitor |
Modifier and Type | Field and Description |
---|---|
java.util.List<Node> |
children |
int |
end |
Node |
parent |
int |
start |
int |
type |
java.lang.Object |
userData |
static java.util.concurrent.atomic.AtomicInteger |
UserNodeStart |
java.lang.String |
value |
java.lang.StringBuilder |
whitespace |
Constructor and Description |
---|
Node(int type) |
Node(int type,
java.lang.String value) |
Node(Node parent,
int type,
java.lang.String value) |
Modifier and Type | Method and Description |
---|---|
Node.Visitor.Status |
accept(Node.Visitor vis)
Apply a visitor to this node and it's children
|
void |
addChild(Node node)
Adds a child to node...
|
void |
addChildren(java.util.List<Node> children2)
Adds all the children to this node
|
Node |
child(int i) |
void |
dump(java.io.PrintStream writer)
Dump the node informatoin to a writer
|
void |
dump(java.io.PrintWriter writer)
Dump the node informatoin to a writer
|
Collector |
find(Collector c)
Like accept by returns the collector for convenience
|
Node |
last()
Return the last child node
|
Node |
nextSibling()
Find the sibling that is adjacent after us
|
Node |
prevSibling()
Find the sibling that is adjacent before us
|
void |
removeChild(Node node)
Removes a child from our children, if it exists.
|
java.lang.String |
toFormattedString() |
java.lang.String |
toFormattedString(ToStringVisitor.Transformer transformer) |
java.lang.String |
toFormattedStringChildrenOnly() |
java.lang.String |
toFormattedStringChildrenOnly(ToStringVisitor.Transformer transformer) |
java.lang.String |
toString() |
Node.Visitor.Status |
visitChildren(Node.Visitor vis,
Node parent)
Applies the visitor to the children of the given Parent, but NOT the
parent itself.
|
public static java.util.concurrent.atomic.AtomicInteger UserNodeStart
public java.util.List<Node> children
public Node parent
public int type
public int start
public int end
public java.lang.String value
public java.lang.Object userData
public java.lang.StringBuilder whitespace
public Node(int type)
public Node(int type, java.lang.String value)
public Node(Node parent, int type, java.lang.String value)
public void addChild(Node node)
node
- public void removeChild(Node node)
node
- public Node.Visitor.Status accept(Node.Visitor vis) throws java.rmi.RemoteException, MXException
vis
- java.rmi.RemoteException
- , MXException to have it compatible with MXException typesMXException
public Node.Visitor.Status visitChildren(Node.Visitor vis, Node parent) throws java.rmi.RemoteException, MXException
vis
- parent
- java.rmi.RemoteException
MXException
public Node nextSibling()
public Node prevSibling()
public void dump(java.io.PrintStream writer)
writer
- public void dump(java.io.PrintWriter writer)
writer
- public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toFormattedString()
public java.lang.String toFormattedString(ToStringVisitor.Transformer transformer)
public java.lang.String toFormattedStringChildrenOnly()
public java.lang.String toFormattedStringChildrenOnly(ToStringVisitor.Transformer transformer)
public Node child(int i)
public Collector find(Collector c) throws java.rmi.RemoteException, MXException
c
- java.rmi.RemoteException
MXException
public void addChildren(java.util.List<Node> children2)
children2
- public Node last()