|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.planx.xmlstore.docnodes.DocNode
public class DocNode
DocNode is an occurrence of a Node in a document.
DocNode provides the ability to locate the parent, root,
and siblings of a node.
A DocNode object is unique in an instance of a document
with respect to the Object.equals(Object) and
Object.hashCode()
methods. Note, however, that if a document is created multiple
times using the same root Node, the documents are
considered to be distinct and each document will
have its own set of DocNode objects.
| Field Summary |
|---|
| Fields inherited from interface org.planx.xmlstore.Node |
|---|
CHARDATA, ELEMENT |
| Constructor Summary | |
|---|---|
DocNode(Node node)
Create a DocNode which is the root of a document. |
|
| Method Summary | |
|---|---|
int |
attributeCount()
Returns the number of attributes of this node. |
int |
childCount()
Returns the number of children of this node. |
DocAttribute |
getAttribute(int index)
Returns the attribute with the specified index. |
String |
getAttribute(String attrName)
Returns the attribute with the given name. |
String[] |
getAttributeNames()
Returns the names of this Node's attributes. |
List<Attribute> |
getAttributes()
Returns the attributes of this Node. |
DocNode |
getChild(int index)
Returns the child with the specified index. |
List<? extends Node> |
getChildren()
Returns the children of this Node. |
List<DocAttribute> |
getDocAttributes()
|
List<DocNode> |
getDocChildren()
Returns a list that contains the children of this node as DocNodes. |
int |
getIndex()
Returns the index of this node in the parent's list of children. |
String |
getNodeValue()
Returns the value of this Node. |
DocNode |
getParent()
Returns the parent DocNode of this DocNode. |
int[] |
getPath()
Returns an integer array containing the path from the root to this node. |
DocNode |
getRoot()
Returns the root DocNode of the document that contains this DocNode. |
byte |
getType()
Returns the node type of this Node. |
boolean |
isMutable()
Returns true if this Node is mutable,
false otherwise. |
DocNode |
nextSibling()
Returns the sibling node immediately following this node. |
DocNode |
previousSibling()
Returns the sibling node immediately preceding this node. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.planx.xmlstore.Node |
|---|
equals, hashCode |
| Constructor Detail |
|---|
public DocNode(Node node)
node - the DVM Node| Method Detail |
|---|
public int[] getPath()
public DocNode getRoot()
public DocNode getParent()
null is returned.
public int getIndex()
public DocNode getChild(int index)
public int childCount()
public List<DocNode> getDocChildren()
DocNodes.
public DocNode nextSibling()
public DocNode previousSibling()
public int attributeCount()
public DocAttribute getAttribute(int index)
public List<DocAttribute> getDocAttributes()
public boolean isMutable()
Nodetrue if this Node is mutable,
false otherwise.
isMutable in interface Nodetrue if mutable, false if immutable.public byte getType()
NodeNode.
getType in interface Nodepublic String getNodeValue()
NodeNode. When the node represents
a character data node, the returned value will be the character data.
When the node represents an element node, the returned value will
by the tag name of the element.
getNodeValue in interface Nodepublic String getAttribute(String attrName)
Node
getAttribute in interface Nodepublic String[] getAttributeNames()
NodeNode's attributes.
If the node represents character data the returned array is empty.
getAttributeNames in interface Nodepublic List<? extends Node> getChildren()
NodeNode.
If the node represents character data the empty list is returned.
getChildren in interface NodeNode.public List<Attribute> getAttributes()
NodeNode. In case
the node represents character data, the empty list is returned.
getAttributes in interface NodeNode.public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||