edu.ksu.cis.kdd.data
Class JDBCTally

java.lang.Object
  extended byedu.ksu.cis.kdd.data.DatabaseTally
      extended byedu.ksu.cis.kdd.data.JDBCTally
All Implemented Interfaces:
Tally

public class JDBCTally
extends DatabaseTally

Author:
Roby Joehanes

Field Summary
protected  java.lang.String[] attrNames
           
protected  java.lang.String constraints
           
protected  java.lang.String[] tableNames
           
protected  java.util.HashSet tablesInvolved
           
 
Fields inherited from class edu.ksu.cis.kdd.data.DatabaseTally
allAttributeIndices, attributeCache, attributeIndices, attributes, db, numTables, tableBaseIndex, tables, tallies
 
Method Summary
protected static java.lang.String concatConstraints(java.lang.String constraints, java.lang.String newCondition)
           
 Tally createSubTally(int[] indices, int[] values)
           
 Tally createSubTally(int attr, int value)
           
protected  java.lang.String getInvolvedTableNames()
           
 java.util.List groupedTally(int[] attrs)
           
 java.util.List groupedTally(int[] attrs, int[] values)
           
protected  void preprocess()
          This big chunk of code is for preprocessing the database.
 int size()
           
 int tally(int[] indices, int[] values)
           
 int tally(int attr, int value)
           
 
Methods inherited from class edu.ksu.cis.kdd.data.DatabaseTally
dumpTallyStatus, getAllAttributeIndices, getAtttribute, getRelevantAttributeIndices, getTables, getTallies, getUnderlyingData, groupedTally, setUnderlyingData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

constraints

protected java.lang.String constraints

tablesInvolved

protected java.util.HashSet tablesInvolved

tableNames

protected java.lang.String[] tableNames

attrNames

protected java.lang.String[] attrNames
Method Detail

createSubTally

public Tally createSubTally(int[] indices,
                            int[] values)

size

public int size()

tally

public int tally(int[] indices,
                 int[] values)

preprocess

protected void preprocess()
Description copied from class: DatabaseTally

This big chunk of code is for preprocessing the database. The process is roughly as follows:

  1. Sort the table according to the dependency (see Database.getSortedTables)
  2. After sorting, assign each attribute of each table a number in ascending order.
  3. Find the linking reference index (on either forward or backward reference).

Note to self: Do NOT call this method in the constructor as it would slow down the createSubTally.

Overrides:
preprocess in class DatabaseTally

tally

public int tally(int attr,
                 int value)
Specified by:
tally in interface Tally
Specified by:
tally in class DatabaseTally
See Also:
DatabaseTally.tally(int, int)

groupedTally

public java.util.List groupedTally(int[] attrs,
                                   int[] values)

groupedTally

public java.util.List groupedTally(int[] attrs)
Specified by:
groupedTally in interface Tally
Overrides:
groupedTally in class DatabaseTally
See Also:
edu.ksu.cis.kdd.data.TallyInterface#groupedTally(int[])

getInvolvedTableNames

protected java.lang.String getInvolvedTableNames()

concatConstraints

protected static java.lang.String concatConstraints(java.lang.String constraints,
                                                    java.lang.String newCondition)

createSubTally

public Tally createSubTally(int attr,
                            int value)
See Also:
Tally.createSubTally(int, int)