edu.wpi.cs.dsrg.xmldb.xat.common.treestructure
Interface DOMPattern

All Known Implementing Classes:
DOMPatternImp

public interface DOMPattern
extends Pattern

This Class defines the DOMpattern data structure.

Since:
1.0

Method Summary
 void addNode(DOMPatternNode child, DOMPatternNode newparent)
          Add a new parent node for a given DOMPatternNode node.
 RootNode getRoot()
          Get the root node of this DOMTree.
 boolean isInTree(DOMPatternNode node)
          Check the tree for a specific node
 void removeNode(DOMPatternNode node)
          Delete the given DOMPatternNode.
 void setRoot(RootNode new_root)
          Set root node of DOMPattern.
 java.lang.String toIndentString()
          Get the indented print output of the result.
 ListPattern toListPattern(DOMPatternNode node)
          Convert the tree into a list by calling toString() on each node.
 java.lang.String toString()
          Convert the tree into a String.
 
Methods inherited from interface edu.wpi.cs.dsrg.xmldb.xat.common.treestructure.Pattern
containsColumn, getColumnNames
 

Method Detail

addNode

public void addNode(DOMPatternNode child,
                    DOMPatternNode newparent)
Add a new parent node for a given DOMPatternNode node. The parent node is updated to have a link to the child node. The child node is updates to have a link to the parent node.
Parameters:
parent - The parent node it attached to.
child - The child node attached.
Returns:
void
Since:
1.0

getRoot

public RootNode getRoot()
Get the root node of this DOMTree.
Since:
1.0

isInTree

public boolean isInTree(DOMPatternNode node)
Check the tree for a specific node
Parameters:
node - the node you are looking for in the tree
Returns:
boolean True: The given DOMPatternNode is in the tree. False: Otherwise.
Since:
1.0

removeNode

public void removeNode(DOMPatternNode node)
Delete the given DOMPatternNode. It will affect number of nodes. All the children nodes of the to-be-deleted node will be the children of the parent node of the to-be-delete node.
Parameters:
node - the to-be-deleted child node.
Returns:
void
Since:
1.0

setRoot

public void setRoot(RootNode new_root)
Set root node of DOMPattern.
Parameters:
new_root - The new root node.
Returns:
void.
Since:
1.0

toIndentString

public java.lang.String toIndentString()
Get the indented print output of the result. This method is used for the GUI.
Returns:
String The indented print output of the result.
Since:
1.0

toListPattern

public ListPattern toListPattern(DOMPatternNode node)
Convert the tree into a list by calling toString() on each node.
Parameters:
node - The DOMPatternNode translate for.
Returns:
ListPattern The result listPattern of given DOMPattern Node.
Since:
1.0

toString

public java.lang.String toString()
Convert the tree into a String.
Overrides:
toString in class java.lang.Object
Returns:
String
Since:
1.0