All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home

Class weka.experiment.DatabaseResultListener

java.lang.Object
    |
    +----weka.experiment.DatabaseUtils
            |
            +----weka.experiment.DatabaseResultListener

public class DatabaseResultListener
extends DatabaseUtils
implements ResultListener
DatabaseResultListener takes the results from a ResultProducer and submits them to a central database.

Version:
$Revision: 1.7 $
Author:
Len Trigg (trigg@cs.waikato.ac.nz)

Constructor Index

 o DatabaseResultListener()
Sets up the database drivers

Method Index

 o acceptResult(ResultProducer, Object[], Object[])
Submit the result to the appropriate table of the database
 o cacheKeyNameTipText()
Returns the tip text for this property
 o determineColumnConstraints(ResultProducer)
Determines if there are any constraints (imposed by the destination) on any additional measures produced by resultProducers.
 o getCacheKeyName()
Get the value of CacheKeyName.
 o globalInfo()
Returns a string describing this result listener
 o isResultRequired(ResultProducer, Object[])
Always says a result is required.
 o postProcess(ResultProducer)
Perform any postprocessing.
 o preProcess(ResultProducer)
Prepare for the results to be received.
 o setCacheKeyName(String)
Set the value of CacheKeyName.

Constructor Detail

 o DatabaseResultListener
public DatabaseResultListener() throws java.lang.Exception
          Sets up the database drivers
Throws:
java.lang.Exception - if an error occurs

Method Detail

 o globalInfo
public java.lang.String globalInfo()
          Returns a string describing this result listener
Returns:
a description of the result listener suitable for displaying in the explorer/experimenter gui
 o preProcess
public void preProcess(ResultProducer rp) throws java.lang.Exception
          Prepare for the results to be received.
Parameters:
rp - the ResultProducer that will generate the results
Throws:
java.lang.Exception - if an error occurs during preprocessing.
 o postProcess
public void postProcess(ResultProducer rp) throws java.lang.Exception
          Perform any postprocessing. When this method is called, it indicates that no more results will be sent that need to be grouped together in any way.
Parameters:
rp - the ResultProducer that generated the results
Throws:
java.lang.Exception - if an error occurs
 o determineColumnConstraints
public java.lang.String[] determineColumnConstraints(ResultProducer rp) throws java.lang.Exception
          Determines if there are any constraints (imposed by the destination) on any additional measures produced by resultProducers. Null should be returned if there are NO constraints, otherwise a list of column names should be returned as an array of Strings. In the case of DatabaseResultListener, the structure of an existing database will impose constraints.
Parameters:
rp - the ResultProducer to which the constraints will apply
Returns:
an array of column names to which resutltProducer's results will be restricted.
Throws:
java.lang.Exception - if an error occurs.
 o acceptResult
public void acceptResult(ResultProducer rp,
                         java.lang.Object key[],
                         java.lang.Object result[]) throws java.lang.Exception
          Submit the result to the appropriate table of the database
Parameters:
rp - the ResultProducer that generated the result
key - The key for the results.
result - The actual results.
Throws:
java.lang.Exception - if the result couldn't be sent to the database
 o isResultRequired
public boolean isResultRequired(ResultProducer rp,
                                java.lang.Object key[]) throws java.lang.Exception
          Always says a result is required. If this is the first call, prints out the header for the Database output.
Parameters:
rp - the ResultProducer wanting to generate the result
key - The key for which a result may be needed.
Returns:
true if the result should be calculated.
Throws:
java.lang.Exception - if the database couldn't be queried
 o cacheKeyNameTipText
public java.lang.String cacheKeyNameTipText()
          Returns the tip text for this property
Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui
 o getCacheKeyName
public java.lang.String getCacheKeyName()
          Get the value of CacheKeyName.
Returns:
Value of CacheKeyName.
 o setCacheKeyName
public void setCacheKeyName(java.lang.String newCacheKeyName)
          Set the value of CacheKeyName.
Parameters:
newCacheKeyName - Value to assign to CacheKeyName.

All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home