Package edu.ucsb.nceas.metacat
Class BasicNode
java.lang.Object
edu.ucsb.nceas.metacat.BasicNode
A Class that represents an XML node and its contents
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addChildNode
(BasicNode child) Add a child node to this nodegetAttribute
(String attName) Get an attribute value by nameGet the attributes as a stringGet the an enumeration of the children of this nodegetDocID()
Get the doc id of this nodegetNamespace
(String prefix) Get an uri of the namespace prefixlong
Get the id of this nodeint
Get nodeIndex of the nodeGet the type of this nodelong
Get the parent id of this nodelong
Get the root node id of this nodeGet the name of this nodeint
increase childNum when new child for the node is createdvoid
setAttribute
(String attName, String attValue) Add a new attribute to this node, or set its valuevoid
Set the doc id of this nodevoid
setNamespace
(String prefix, String uri) Add a namespace to this nodevoid
setNodeID
(long node_id) Set the id of this nodevoid
setNodeIndex
(int nodeIndex) Set the node index of this nodevoid
setNodeType
(String type) Set the type of this nodevoid
setParentID
(long parent_id) Set the parent id of this nodevoid
setRootNodeID
(long rootnode_id) Set the root node id of this nodevoid
setTagName
(String tagname) Set the name of this node
-
Constructor Details
-
BasicNode
public BasicNode()Construct a Basic Node -
BasicNode
Construct a Basic Node- Parameters:
tagname
- the name of the node
-
BasicNode
Construct a Basic Node- Parameters:
tagname
- the name of the nodeparent_id
- the id number of the parent nodenodeIndex
- - index of node among siblings in parent node Every node initializes childNum to 0 when created and has interface incChildNum when new child is created
-
BasicNode
Construct a Basic Node- Parameters:
node_id
- the id number of the nodetagname
- the name of the nodeparent_id
- the id number of the parent node
-
-
Method Details
-
getNodeID
public long getNodeID()Get the id of this node -
setNodeID
public void setNodeID(long node_id) Set the id of this node -
getParentID
public long getParentID()Get the parent id of this node -
setParentID
public void setParentID(long parent_id) Set the parent id of this node -
getRootNodeID
public long getRootNodeID()Get the root node id of this node -
setRootNodeID
public void setRootNodeID(long rootnode_id) Set the root node id of this node -
getDocID
Get the doc id of this node -
setDocID
Set the doc id of this node -
getTagName
Get the name of this node -
setTagName
Set the name of this node -
getAttributes
Get the attributes as a string -
setAttribute
Add a new attribute to this node, or set its value -
getAttribute
Get an attribute value by name -
setNamespace
Add a namespace to this node -
getNamespace
Get an uri of the namespace prefix -
getNodeIndex
public int getNodeIndex()Get nodeIndex of the node -
setNodeIndex
public void setNodeIndex(int nodeIndex) Set the node index of this node -
getNodeType
Get the type of this node -
setNodeType
Set the type of this node -
addChildNode
Add a child node to this node -
getChildren
Get the an enumeration of the children of this node -
incChildNum
public int incChildNum()increase childNum when new child for the node is created
-