|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.wpi.cs.dsrg.xmldb.xat.common.operator.XATPropertiesImp | +--edu.wpi.cs.dsrg.xmldb.xat.common.operator.XATQueryObjectImp | +--edu.wpi.cs.dsrg.xmldb.xat.common.treestructure.XATTreeImp
This class implemented the XATTree.
Field Summary | |
protected BindingTable |
bindingTable
The binding table of XATTree. |
protected java.util.ArrayList |
root
The array containing all the roots of XATTree. |
Fields inherited from class edu.wpi.cs.dsrg.xmldb.xat.common.operator.XATQueryObjectImp |
stats,
statsPresent |
Constructor Summary | |
XATTreeImp()
The default XATTreeImp constructor. |
Method Summary | |
void |
addNode(XATNode newNode,
XATNode parentNode)
Add a new parent node for a given DOMPatternNode node. |
void |
addXATTree(XATTree subtree)
For all the leaves, add the subtree to it. |
protected void |
appendChildLeaves(java.util.Vector v,
XATNode node)
Append all the decendent nodes of given XAT Node into a vector. |
protected void |
appendNodes(java.util.Vector v,
XATNode node)
Append all the distinct decendent nodes of given XAT Node into a vector. |
void |
appendXATNode(XATNode leaf)
Append a node to all the leaves of the current XATTree. |
protected java.lang.String |
childrenString(XATNode node,
java.lang.String indent)
Convert all the children of the given XATNode into a string with indent format. |
java.lang.Object |
clone()
Clone the XATTree. |
XATNode[] |
convertToArray()
Converts this tree into an array, similar to getLeaves() |
void |
copy(XATTreeImp tree)
Copy the specified tree as current tree. |
void |
deleteNode(XATNode node)
Delete node. |
java.util.Vector |
getAllLeafNodes(XATNode root)
Get all the leaf node of given XATTree, which is rooted at given root node. |
BindingTable |
getBindingTable()
Get the binding table of this Tree. |
XATNode[] |
getLeaves()
Get all the leaves of this XATTree. |
XATLeaf[] |
getLeavesWithDepth()
Get all the leaves of this XATTree along with their depth. |
XATNode |
getRoot()
Get the root node of this XATTree. |
java.util.Iterator |
getRoots()
Assuming the XATTree is a forest sometime, this method get all the roots of XAT. |
void |
insertRoot(XATNode newroot)
Insert a new node as the root of this tree. |
boolean |
isDebug()
Get the value of the propertity "DEBUG_XATTreeImp". |
void |
moveNode(XATNode child,
XATNode newParent)
Move node. |
void |
moveNode(XATNode child,
XATNode new_parent,
int position)
Move node. |
void |
replaceNode(XATNode oldNode,
XATNode newNode)
Replace oldNode in Tree with newNode. |
void |
setBindingTable(BindingTable bind)
Set the binding table of this Tree. |
protected void |
setDefaultProperties()
Called by the constructor. |
protected void |
setDefaultStatistics()
Called by the constructor. |
XATNode |
setRoot(XATNode newRoot)
Set root node. |
int |
size()
Give number of nodes in this tree. |
java.lang.String |
toString()
|
boolean |
validate()
This going to validate the parent-child relationship. |
Methods inherited from class edu.wpi.cs.dsrg.xmldb.xat.common.operator.XATQueryObjectImp |
addStatistic,
compareTo,
getStatistics,
isValidStatistic |
Methods inherited from class edu.wpi.cs.dsrg.xmldb.xat.common.operator.XATPropertiesImp |
addProperty,
getProperties,
getProperty,
isValidPropertyName,
setNewPropertyValue,
setProperty |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected java.util.ArrayList root
protected BindingTable bindingTable
Constructor Detail |
public XATTreeImp()
Method Detail |
public void addNode(XATNode newNode, XATNode parentNode)
parent
- The parent node it attached to.child
- The child node attached.public void addXATTree(XATTree subtree)
childTree
- The XATTree attached.protected void appendChildLeaves(java.util.Vector v, XATNode node)
v
- The vector contains all decendent nodes.node
- The node searching for.protected void appendNodes(java.util.Vector v, XATNode node)
v
- The vector contains all decendent nodes.node
- The node searching for.public void appendXATNode(XATNode leaf)
leaf
- The node searching for.protected java.lang.String childrenString(XATNode node, java.lang.String indent)
node
- The XATNode searching for.indent
- The indent format.public java.lang.Object clone()
public XATNode[] convertToArray()
public void copy(XATTreeImp tree)
tree
- The new XATTree.public void deleteNode(XATNode node) throws XATTreeNodeHasNoParentException
node
- the to-be-deleted child node.public java.util.Vector getAllLeafNodes(XATNode root)
This method is used to find all of the Source operators in an XATTree Looks at all of the root's children and adds them to the vector if that nodes' operator is an XML source . The function is then recurvsively called on each of root's children until there are no more nodes to look at.
root
- The root of a tree to iterate overpublic BindingTable getBindingTable()
public XATNode[] getLeaves()
public XATLeaf[] getLeavesWithDepth()
public XATNode getRoot()
public java.util.Iterator getRoots()
public void insertRoot(XATNode newroot)
root
- The root will be inserted in.public boolean isDebug()
public void moveNode(XATNode child, XATNode newParent)
The child node will always move to the end of the children of the parent node.
child
- The to-be-moved child node.new_parent
- The new parent node.public void moveNode(XATNode child, XATNode new_parent, int position)
The child node will always move to the end of the children of the parent node.
child
- The to-be-moved child node.new_parent
- The new parent node.public void replaceNode(XATNode oldNode, XATNode newNode)
oldNode
- The old XATNode will be replaced.newNode
- The new XATNode used to replace the old one.public void setBindingTable(BindingTable bind)
bind
- The new binding table for this tree.protected void setDefaultProperties()
protected void setDefaultStatistics()
public XATNode setRoot(XATNode newRoot)
new_root
- The new root node.public int size()
public java.lang.String toString()
public boolean validate()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |