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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChildNode(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 prefixlongGet the id of this nodeintGet nodeIndex of the nodeGet the type of this nodelongGet the parent id of this nodelongGet the root node id of this nodeGet the name of this nodeintincrease childNum when new child for the node is createdvoidsetAttribute(String attName, String attValue) Add a new attribute to this node, or set its valuevoidSet the doc id of this nodevoidsetNamespace(String prefix, String uri) Add a namespace to this nodevoidsetNodeID(long node_id) Set the id of this nodevoidsetNodeIndex(int nodeIndex) Set the node index of this nodevoidsetNodeType(String type) Set the type of this nodevoidsetParentID(long parent_id) Set the parent id of this nodevoidsetRootNodeID(long rootnode_id) Set the root node id of this nodevoidsetTagName(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
-