Class BasicNode

java.lang.Object
edu.ucsb.nceas.metacat.BasicNode

public class BasicNode extends Object
A Class that represents an XML node and its contents
  • Constructor Details

    • BasicNode

      public BasicNode()
      Construct a Basic Node
    • BasicNode

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

      public BasicNode(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, 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 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

      public String getDocID()
      Get the doc id of this node
    • setDocID

      public void setDocID(String doc_id)
      Set the doc id of this node
    • getTagName

      public String getTagName()
      Get the name of this node
    • setTagName

      public void setTagName(String tagname)
      Set the name of this node
    • getAttributes

      public String getAttributes()
      Get the attributes as a string
    • setAttribute

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

      public String getAttribute(String attName)
      Get an attribute value by name
    • setNamespace

      public void setNamespace(String prefix, String uri)
      Add a namespace to this node
    • getNamespace

      public String getNamespace(String prefix)
      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

      public String getNodeType()
      Get the type of this node
    • setNodeType

      public void setNodeType(String type)
      Set the type of this node
    • addChildNode

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

      public 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