Constructor and Description |
---|
NodeWithChildren() |
Modifier and Type | Method and Description |
---|---|
NodeWithChildren |
addNode(int index,
Node node) |
NodeWithChildren |
addNode(Node node) |
NodeWithChildren |
addNodes(Collection<? extends Node> nodes) |
NodeWithChildren |
addNodes(int index,
Collection<? extends Node> nodes) |
NodeWithChildren |
addNodes(int index,
Node... nodes) |
NodeWithChildren |
addNodes(Node... nodes) |
NodeWithChildren |
clearNodes()
Remove all nodes
|
NodeWithChildren |
copy()
Simulate clone()
|
NodeWithChildren |
copy(Node orig)
Copy all data from
orig into this |
Node |
getNode(int index)
Get a specific node from the list
|
List<Node> |
getNodes()
Get the list of child nodes.
|
<T> List<T> |
getNodes(NodeFilter<T> filter) |
boolean |
hasNodes()
Does this node have children?
|
int |
nodeCount()
The number of nodes in the list
|
int |
nodeIndexOf(Node node)
The index of the node in the node list or -1 if it isn't in the list
|
Node |
removeNode(int index)
Remove a node from the list
|
boolean |
removeNode(Node n)
Remove a node from the list
|
String |
toString() |
String |
toXML()
Slow way to convert a node to XML
|
NodeWithChildren |
toXML(XMLWriter writer)
Fast way to convert many nodes to XML
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createClone, getType
public NodeWithChildren addNode(Node node)
public NodeWithChildren addNode(int index, Node node)
public NodeWithChildren addNodes(Collection<? extends Node> nodes)
public NodeWithChildren addNodes(int index, Collection<? extends Node> nodes)
public NodeWithChildren addNodes(Node... nodes)
public NodeWithChildren addNodes(int index, Node... nodes)
public List<Node> getNodes()
Parent
CAUTION: Changes to this list will modify the actual data structure! So don't do this unless you know what you're doing!
public boolean hasNodes()
Parent
public int nodeCount()
Parent
public int nodeIndexOf(Node node)
Parent
nodeIndexOf
in interface Parent
public Node getNode(int index)
Parent
public Node removeNode(int index)
Parent
removeNode
in interface Parent
public boolean removeNode(Node n)
Parent
removeNode
in interface Parent
public <T> List<T> getNodes(NodeFilter<T> filter)
public NodeWithChildren clearNodes()
Parent
clearNodes
in interface Parent
public String toXML()
Node
public NodeWithChildren toXML(XMLWriter writer) throws IOException
Node
toXML
in interface Node
IOException
public NodeWithChildren copy(Node orig)
Node
orig
into this
public NodeWithChildren copy()
Node
Copyright © 2008–2021. All rights reserved.