edu.ucsb.nceas.metacat
Class BasicNode

java.lang.Object
  |
  +--edu.ucsb.nceas.metacat.BasicNode
Direct Known Subclasses:
DBSAXNode, ElementNode, TextNode

public class BasicNode
extends java.lang.Object

A Class that represents an XML node and its contents


Constructor Summary
BasicNode()
          Construct a Basic Node
BasicNode(long node_id, java.lang.String tagname, long parent_id, int nodeIndex)
          Construct a Basic Node
BasicNode(java.lang.String tagname)
          Construct a Basic Node
BasicNode(java.lang.String tagname, long parent_id, int nodeIndex)
          Construct a Basic Node
 
Method Summary
 void addChildNode(BasicNode child)
          Add a child node to this node
 java.lang.String getAttribute(java.lang.String attName)
          Get an attribute value by name
 java.lang.String getAttributes()
          Get the attributes as a string
 java.util.Enumeration getChildren()
          Get the an enumeration of the children of this node
 java.lang.String getDocID()
          Get the doc id of this node
 long getNodeID()
          Get the id of this node
 int getNodeIndex()
          Get nodeIndex of the node
 java.lang.String getNodeType()
          Get the type of this node
 long getParentID()
          Get the parent id of this node
 long getRootNodeID()
          Get the root node id of this node
 java.lang.String getTagName()
          Get the name of this node
 int incChildNum()
          increase childNum when new child for the node is created
 void setAttribute(java.lang.String attName, java.lang.String attValue)
          Add a new attribute to this node, or set its value
 void setDocID(java.lang.String doc_id)
          Set the doc id of this node
 void setNodeID(long node_id)
          Set the id of this node
 void setNodeIndex(int nodeIndex)
          Set the node index of this node
 void setNodeType(java.lang.String type)
          Set the type of this node
 void setParentID(long parent_id)
          Set the parent id of this node
 void setRootNodeID(long rootnode_id)
          Set the root node id of this node
 void setTagName(java.lang.String tagname)
          Set the name of this node
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicNode

public BasicNode()
Construct a Basic Node

BasicNode

public BasicNode(java.lang.String tagname)
Construct a Basic Node
Parameters:
tagname - the name of the node

BasicNode

public BasicNode(java.lang.String tagname,
                 long parent_id,
                 int nodeIndex)
Construct a Basic Node
Parameters:
tagname - the name of the node
parent_id - the id number of the parent node
nodeIndex - - 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

public BasicNode(long node_id,
                 java.lang.String tagname,
                 long parent_id,
                 int nodeIndex)
Construct a Basic Node
Parameters:
node_id - the id number of the node
tagname - the name of the node
parent_id - the id number of the parent node
Method Detail

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

public java.lang.String getDocID()
Get the doc id of this node

setDocID

public void setDocID(java.lang.String doc_id)
Set the doc id of this node

getTagName

public java.lang.String getTagName()
Get the name of this node

setTagName

public void setTagName(java.lang.String tagname)
Set the name of this node

getAttributes

public java.lang.String getAttributes()
Get the attributes as a string

setAttribute

public void setAttribute(java.lang.String attName,
                         java.lang.String attValue)
Add a new attribute to this node, or set its value

getAttribute

public java.lang.String getAttribute(java.lang.String attName)
Get an attribute value by name

getNodeIndex

public int getNodeIndex()
Get nodeIndex of the node

setNodeIndex

public void setNodeIndex(int nodeIndex)
Set the node index of this node

getNodeType

public java.lang.String getNodeType()
Get the type of this node

setNodeType

public void setNodeType(java.lang.String type)
Set the type of this node

addChildNode

public void addChildNode(BasicNode child)
Add a child node to this node

getChildren

public java.util.Enumeration 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


Copyright © 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.