Package de.pdark.decentxml
Class NodeWithChildren
- java.lang.Object
-
- de.pdark.decentxml.NodeWithChildren
-
-
Constructor Summary
Constructors Constructor Description NodeWithChildren()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NodeWithChildrenaddNode(int index, Node node)NodeWithChildrenaddNode(Node node)NodeWithChildrenaddNodes(int index, Node... nodes)NodeWithChildrenaddNodes(int index, java.util.Collection<? extends Node> nodes)NodeWithChildrenaddNodes(Node... nodes)NodeWithChildrenaddNodes(java.util.Collection<? extends Node> nodes)NodeWithChildrenclearNodes()Remove all nodesNodeWithChildrencopy()Simulate clone()NodeWithChildrencopy(Node orig)Copy all data fromorigintothisNodegetNode(int index)Get a specific node from the listjava.util.List<Node>getNodes()Get the list of child nodes.<T> java.util.List<T>getNodes(NodeFilter<T> filter)booleanhasNodes()Does this node have children?intnodeCount()The 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 listNoderemoveNode(int index)Remove a node from the listbooleanremoveNode(Node n)Remove a node from the listjava.lang.StringtoString()java.lang.StringtoXML()Slow way to convert a node to XMLNodeWithChildrentoXML(XMLWriter writer)Fast way to convert many nodes to XML-
Methods 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 Detail
-
nodes
private java.util.List<Node> nodes
-
-
Method Detail
-
addNode
public NodeWithChildren addNode(Node node)
-
addNode
public NodeWithChildren addNode(int index, Node node)
-
addNodes
public NodeWithChildren addNodes(java.util.Collection<? extends Node> nodes)
-
addNodes
public NodeWithChildren addNodes(int index, java.util.Collection<? extends Node> nodes)
-
addNodes
public NodeWithChildren addNodes(Node... nodes)
-
addNodes
public NodeWithChildren addNodes(int index, Node... nodes)
-
getNodes
public java.util.List<Node> 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
public int nodeIndexOf(Node node)
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
public Node getNode(int index)
Description copied from interface:ParentGet a specific node from the list
-
removeNode
public Node removeNode(int index)
Description copied from interface:ParentRemove a node from the list- Specified by:
removeNodein interfaceParent- Returns:
- The removed node.
-
removeNode
public boolean removeNode(Node n)
Description copied from interface:ParentRemove a node from the list- Specified by:
removeNodein interfaceParent- Returns:
- true, if the node is in the list
-
getNodes
public <T> java.util.List<T> getNodes(NodeFilter<T> filter)
-
clearNodes
public NodeWithChildren clearNodes()
Description copied from interface:ParentRemove all nodes- Specified by:
clearNodesin interfaceParent
-
toXML
public java.lang.String toXML()
Description copied from interface:NodeSlow way to convert a node to XML
-
toXML
public NodeWithChildren toXML(XMLWriter writer) throws java.io.IOException
Description copied from interface:NodeFast way to convert many nodes to XML
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
copy
public NodeWithChildren copy(Node orig)
Description copied from interface:NodeCopy all data fromorigintothis
-
copy
public NodeWithChildren copy()
Description copied from interface:NodeSimulate clone()
-
-