|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.pdark.decentxml.NodeWithChildren
public abstract class NodeWithChildren
This class contains all the code necessary to implement nodes which can have child nodes (like Document or Element).
| Constructor Summary | |
|---|---|
NodeWithChildren()
|
|
| Method Summary | |
|---|---|
NodeWithChildren |
addNode(int index,
Node node)
|
NodeWithChildren |
addNode(Node node)
|
NodeWithChildren |
addNodes(java.util.Collection<? extends Node> nodes)
|
NodeWithChildren |
addNodes(int index,
java.util.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 |
java.util.List<Node> |
getNodes()
Get the list of child nodes. |
java.util.List<Node> |
getNodes(NodeFilter 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 |
java.lang.String |
toString()
|
java.lang.String |
toXML()
Slow way to convert a node to XML |
NodeWithChildren |
toXML(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.Parent |
|---|
getChild |
| Methods inherited from interface de.pdark.decentxml.Node |
|---|
createClone, getType |
| Constructor Detail |
|---|
public NodeWithChildren()
| Method Detail |
|---|
public NodeWithChildren addNode(Node node)
addNode in interface Parent
public NodeWithChildren addNode(int index,
Node node)
addNode in interface Parentpublic NodeWithChildren addNodes(java.util.Collection<? extends Node> nodes)
addNodes in interface Parent
public NodeWithChildren addNodes(int index,
java.util.Collection<? extends Node> nodes)
addNodes in interface Parentpublic NodeWithChildren addNodes(Node... nodes)
addNodes in interface Parent
public NodeWithChildren addNodes(int index,
Node... nodes)
addNodes in interface Parentpublic java.util.List<Node> getNodes()
ParentCAUTION: Changes to this list will modify the actual data structure! So don't do this unless you know what you're doing!
getNodes in interface Parentpublic boolean hasNodes()
Parent
hasNodes in interface Parentpublic int nodeCount()
Parent
nodeCount in interface Parentpublic int nodeIndexOf(Node node)
Parent
nodeIndexOf in interface Parentpublic Node getNode(int index)
Parent
getNode in interface Parentpublic Node removeNode(int index)
Parent
removeNode in interface Parentpublic boolean removeNode(Node n)
Parent
removeNode in interface Parentpublic java.util.List<Node> getNodes(NodeFilter filter)
public NodeWithChildren clearNodes()
Parent
clearNodes in interface Parentpublic java.lang.String toXML()
Node
toXML in interface Node
public NodeWithChildren toXML(XMLWriter writer)
throws java.io.IOException
Node
toXML in interface Nodejava.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic NodeWithChildren copy(Node orig)
Nodeorig into this
copy in interface Nodepublic NodeWithChildren copy()
Node
copy in interface Node
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||