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 fromorigintothisgetNode(int index) Get a specific node from the listgetNodes()Get the list of child nodes.<T> List<T> getNodes(NodeFilter<T> filter) booleanhasNodes()Does this node have children?intThe number of nodes in the listintnodeIndexOf(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 listbooleanremoveNode(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, waitMethods 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:ParentGet 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:ParentDoes this node have children? -
nodeCount
public int nodeCount()Description copied from interface:ParentThe number of nodes in the list -
nodeIndexOf
Description copied from interface:ParentThe index of the node in the node list or -1 if it isn't in the list- Specified by:
nodeIndexOfin interfaceParent
-
getNode
Description copied from interface:ParentGet a specific node from the list -
removeNode
Description copied from interface:ParentRemove a node from the list- Specified by:
removeNodein interfaceParent- Returns:
- The removed node.
-
removeNode
Description copied from interface:ParentRemove a node from the list- Specified by:
removeNodein interfaceParent- Returns:
- true, if the node is in the list
-
getNodes
-
clearNodes
Description copied from interface:ParentRemove all nodes- Specified by:
clearNodesin interfaceParent
-
toXML
Description copied from interface:NodeSlow way to convert a node to XML -
toXML
Description copied from interface:NodeFast way to convert many nodes to XML- Specified by:
toXMLin interfaceNode- Throws:
IOException
-
toString
-
copy
Description copied from interface:NodeCopy all data fromorigintothis -
copy
Description copied from interface:NodeSimulate clone()
-