edu.wpi.cs.dsrg.xmldb.xat.common.xatnode
Interface XATNode

All Known Implementing Classes:
XATNodeImp

public interface XATNode
extends Visitable

The class defines the node of XATTree.

Since:
1.0

Method Summary
 int addChild(XATNode new_child)
          Add one child to this node.
 int addChild(XATNode new_child, int position)
          Add one child to this node at specified position.
 java.util.Set clearSchema()
          Clear the schema of this XATNode.
 java.lang.Object clone()
          Deep clone this XATNode.
 int deleteChild(XATNode child)
          Delete a child from this node.
 XATNode getChild(int position)
          Get a specific child node of this node by their position.
 XATNode[] getChildren()
          Get all the children nodes of this node.
 int getChildrenSize()
          Returns how many children this node has
 int getIndexOf(XATNode node)
          Return the index of a node.
 XATOperator getOperator()
          Get the operator in this Node.
 XATNode getParent()
          Get the parent node of this node.
 java.util.Iterator getParents()
          Get an Iterator of all of the parents.
 java.util.Set getSchema()
          Get the schema of this XATNode.
 int locateChild(XATNode child)
          Get a position for a specific child node.
 XATNode setChild(int position, XATNode new_child)
          Set a specific child to be a new child node.
 XATNode[] setChildren(XATNode[] new_children)
          Set all the children nodes of this node.
 XATOperator setOperator(XATOperator new_operator)
          Set the operator in this Node.
 XATNode setParent(XATNode new_parent)
          Set the parent node of this node.
 java.util.Set setSchema(java.util.Set new_schema)
          Set the schema for current node.
 

Method Detail

addChild

public int addChild(XATNode new_child)
Add one child to this node. This should be called only by the XATTree.addNode(). Remember the children are order unsensitive.
Parameters:
new_child - The new child node added.
Returns:
int The number of children.
Since:
1.0

addChild

public int addChild(XATNode new_child,
                    int position)
Add one child to this node at specified position. This method should be called only by the XATTree.addNode(). The children are order unsensitive.
Parameters:
new_child - The new child node.
position - The position of new added node.
Returns:
The number of children.
Since:
1.0

clearSchema

public java.util.Set clearSchema()
Clear the schema of this XATNode.
Returns:
Set The old schema of this XATNode.
Since:
1.0

clone

public java.lang.Object clone()
Deep clone this XATNode.
Overrides:
clone in class java.lang.Object
Returns:
Object The cloned result.
Since:
1.0

deleteChild

public int deleteChild(XATNode child)
Delete a child from this node.
Parameters:
child - The to-be-deleted child node.
Returns:
int The number of children.
Since:
1.0

getChild

public XATNode getChild(int position)
                 throws XATNodeDoesNotExistException
Get a specific child node of this node by their position.
Parameters:
position - The position of the child node.
Returns:
XATNode The child node got.
Throws:
XATNodeDoesNotExistException -  
Since:
1.0

getChildren

public XATNode[] getChildren()
Get all the children nodes of this node.
Returns:
XATNode[] The array of all the children.
Since:
1.0

getChildrenSize

public int getChildrenSize()
Returns how many children this node has
Returns:
int The number of children.
Since:
1.0

getIndexOf

public int getIndexOf(XATNode node)
Return the index of a node.
Parameters:
node - The XATNode computing index for.
Returns:
int The index number of given node.
Since:
1.0

getOperator

public XATOperator getOperator()
Get the operator in this Node.
Returns:
XATOperator The operator of this node.
Since:
1.0

getParent

public XATNode getParent()
Get the parent node of this node.
Returns:
XATNode The parent of this node.
Since:
1.0

getParents

public java.util.Iterator getParents()
Get an Iterator of all of the parents. The XATNode only has one parent, thus this iterator will only contain one element. However, subclasses may have multiple parents, thus nothing is lost by placing this method here.
Returns:
Iterator Including all the parents.
Since:
1.0

getSchema

public java.util.Set getSchema()
Get the schema of this XATNode.
Returns:
Set The schema of this XATNode.
Since:
1.0

locateChild

public int locateChild(XATNode child)
Get a position for a specific child node. If not found, return -1.
Parameters:
child - The reference of child node searching for.
Returns:
int The position of this child.
Since:
1.0

setChild

public XATNode setChild(int position,
                        XATNode new_child)
                 throws XATNodeDoesNotExistException
Set a specific child to be a new child node.
Parameters:
position - The position of the child node.
new_child - The new child node.
Returns:
XATNode The original child node.
Since:
1.0

setChildren

public XATNode[] setChildren(XATNode[] new_children)
Set all the children nodes of this node.
Parameters:
new_children - The new children nodes.
Returns:
XATNode[] The array containing all the old children.
Since:
1.0

setOperator

public XATOperator setOperator(XATOperator new_operator)
Set the operator in this Node.
Parameters:
new_operator - The new operator in this node.
Returns:
XATOperator The old operator in this node.
Since:
1.0

setParent

public XATNode setParent(XATNode new_parent)
Set the parent node of this node.
Parameters:
new_parent - The new parent node of this node.
Returns:
XATNode The original parent of this node.
Since:
1.0

setSchema

public java.util.Set setSchema(java.util.Set new_schema)
Set the schema for current node.
Parameters:
new_schema - The new schema for this node.
Returns:
Set The old schema of this node.
Since:
1.0