edu.iastate.anthill.indus.iterator
Class DB2Tree

java.lang.Object
  extended byedu.iastate.anthill.indus.iterator.DB2Tree
Direct Known Subclasses:
EC2Tree, Go2Tree, MIPS2Tree, Scop2Tree

public abstract class DB2Tree
extends java.lang.Object

Since:
1.0 2005-03-11
Author:
Jie Bao

Field Summary
protected  java.sql.Connection db
           
 
Constructor Summary
DB2Tree(java.sql.Connection db)
           
 
Method Summary
protected  void buildTree(TypedTree tree, int cutoff, DBTreeNode from)
           
 DBTreeNode createNode(java.lang.String id)
           
protected  java.lang.String defaultFindComments(java.lang.String commentTable, java.lang.String id_col, java.lang.String comment_col, java.lang.String id)
          Query over a table commentTable(id_col, comment_col)
protected  java.util.Vector defaultGetChildren(java.lang.String relationTable, java.lang.String childCol, java.lang.String parentCol, java.lang.String from_id, java.lang.String relationCol, java.lang.String relationType)
           
protected  java.util.Vector defaultGetParent(java.lang.String relationTable, java.lang.String childCol, java.lang.String parentCol, java.lang.String from_id, java.lang.String relationCol, java.lang.String relationType)
           
protected abstract  java.lang.String findComments(java.lang.String id)
           
protected abstract  java.util.Vector getChildren(java.lang.String from_id)
           
protected  java.lang.String getFirstParent(java.lang.String from_id)
           
protected  java.util.Vector getFirstParentPath(java.lang.String from_id)
          Get the first parent of a given node we expect to extend the design for DAG latter on, that's why "first parent"
protected abstract  java.util.Vector getParent(java.lang.String from_id)
           
abstract  java.lang.String getRootId()
           
 TypedTree getTree(java.lang.String from_id, int cutoff)
           
protected  void insertPath(TypedTree tree, java.util.Vector path)
          Insert a path into a tree
 void insertSet(TypedTree tree, java.util.Set values)
          Insert a set of values to a tree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

db

protected java.sql.Connection db
Constructor Detail

DB2Tree

public DB2Tree(java.sql.Connection db)
Method Detail

findComments

protected abstract java.lang.String findComments(java.lang.String id)

defaultFindComments

protected java.lang.String defaultFindComments(java.lang.String commentTable,
                                               java.lang.String id_col,
                                               java.lang.String comment_col,
                                               java.lang.String id)
Query over a table commentTable(id_col, comment_col)

Parameters:
commentTable - String
id_col - String
comment_col - String
id - String
Returns:
String
Since:
2005-03-30

getRootId

public abstract java.lang.String getRootId()

getChildren

protected abstract java.util.Vector getChildren(java.lang.String from_id)

defaultGetChildren

protected java.util.Vector defaultGetChildren(java.lang.String relationTable,
                                              java.lang.String childCol,
                                              java.lang.String parentCol,
                                              java.lang.String from_id,
                                              java.lang.String relationCol,
                                              java.lang.String relationType)
Parameters:
relationTable - String
childCol - String
parentCol - String
from_id - String
relationCol - String
relationType - String
Returns:
Vector
Since:
2005-03-30

getParent

protected abstract java.util.Vector getParent(java.lang.String from_id)

defaultGetParent

protected java.util.Vector defaultGetParent(java.lang.String relationTable,
                                            java.lang.String childCol,
                                            java.lang.String parentCol,
                                            java.lang.String from_id,
                                            java.lang.String relationCol,
                                            java.lang.String relationType)
Parameters:
relationTable - String
childCol - String
parentCol - String
from_id - String
relationCol - String
relationType - String
Returns:
Vector
Since:
2005-03-30

getFirstParent

protected java.lang.String getFirstParent(java.lang.String from_id)

getFirstParentPath

protected java.util.Vector getFirstParentPath(java.lang.String from_id)
Get the first parent of a given node we expect to extend the design for DAG latter on, that's why "first parent"

Parameters:
from_id - String
Returns:
Vector the path from root to the given node
Since:
2005-03-30

insertPath

protected void insertPath(TypedTree tree,
                          java.util.Vector path)
Insert a path into a tree

Parameters:
tree - TypedTree
path - Vector - of String, from high to low
Since:
2005-03-30

insertSet

public void insertSet(TypedTree tree,
                      java.util.Set values)
Insert a set of values to a tree

Parameters:
tree - TypedTree
values - Set
Since:
2005-03-30

createNode

public DBTreeNode createNode(java.lang.String id)
Parameters:
id - String
Returns:
DBTreeNode

buildTree

protected void buildTree(TypedTree tree,
                         int cutoff,
                         DBTreeNode from)
Parameters:
cutoff - int , < 0 if no cutoff, >=0 the cutoff depth
from - DBTreeNode
Since:
2005-03-11

getTree

public TypedTree getTree(java.lang.String from_id,
                         int cutoff)
Returns:
TypedTree
Since:
2005-03-11