Package de.pdark.decentxml
Class NodeWithChildren
java.lang.Object
de.pdark.decentxml.NodeWithChildren
This class contains all the code necessary to implement nodes
which can have child nodes (like Document or Element).
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddNodes
(int index, Collection<? extends Node> nodes) addNodes
(Collection<? extends Node> nodes) Remove all nodescopy()
Simulate clone()Copy all data fromorig
intothis
getNode
(int index) Get a specific node from the listgetNodes()
Get the list of child nodes.<T> List
<T> getNodes
(NodeFilter<T> filter) boolean
hasNodes()
Does this node have children?int
The number of nodes in the listint
nodeIndexOf
(Node node) The index of the node in the node list or -1 if it isn't in the listremoveNode
(int index) Remove a node from the listboolean
removeNode
(Node n) Remove a node from the listtoString()
toXML()
Slow way to convert a node to XMLFast way to convert many nodes to XMLMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface de.pdark.decentxml.Node
createClone, getType
-
Field Details
-
nodes
-
-
Constructor Details
-
NodeWithChildren
public NodeWithChildren()
-
-
Method Details
-
addNode
-
addNode
-
addNodes
-
addNodes
-
addNodes
-
addNodes
-
getNodes
Description copied from interface:Parent
Get the list of child nodes.CAUTION: Changes to this list will modify the actual data structure! So don't do this unless you know what you're doing!
-
hasNodes
public boolean hasNodes()Description copied from interface:Parent
Does this node have children? -
nodeCount
public int nodeCount()Description copied from interface:Parent
The number of nodes in the list -
nodeIndexOf
Description copied from interface:Parent
The index of the node in the node list or -1 if it isn't in the list- Specified by:
nodeIndexOf
in interfaceParent
-
getNode
Description copied from interface:Parent
Get a specific node from the list -
removeNode
Description copied from interface:Parent
Remove a node from the list- Specified by:
removeNode
in interfaceParent
- Returns:
- The removed node.
-
removeNode
Description copied from interface:Parent
Remove a node from the list- Specified by:
removeNode
in interfaceParent
- Returns:
- true, if the node is in the list
-
getNodes
-
clearNodes
Description copied from interface:Parent
Remove all nodes- Specified by:
clearNodes
in interfaceParent
-
toXML
Description copied from interface:Node
Slow way to convert a node to XML -
toXML
Description copied from interface:Node
Fast way to convert many nodes to XML- Specified by:
toXML
in interfaceNode
- Throws:
IOException
-
toString
-
copy
Description copied from interface:Node
Copy all data fromorig
intothis
-
copy
Description copied from interface:Node
Simulate clone()
-