|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.experiment.CSVResultListener
CSVResultListener outputs the received results in csv format to a Writer
Field Summary | |
protected java.io.PrintWriter |
m_Out
The destination for results (typically connected to the output file) |
protected java.io.File |
m_OutputFile
The destination output file, null sends to System.out |
protected ResultProducer |
m_RP
The ResultProducer sending us results |
Constructor Summary | |
CSVResultListener()
|
Method Summary | |
void |
acceptResult(ResultProducer rp,
java.lang.Object[] key,
java.lang.Object[] result)
Just prints out each result as it is received. |
java.lang.String[] |
determineColumnConstraints(ResultProducer rp)
Determines if there are any constraints (imposed by the destination) on the result columns to be produced by resultProducers. |
java.lang.String[] |
getOptions()
Gets the current settings of the Classifier. |
java.io.File |
getOutputFile()
Get the value of OutputFile. |
java.lang.String |
globalInfo()
Returns a string describing this result listener |
boolean |
isResultRequired(ResultProducer rp,
java.lang.Object[] key)
Always says a result is required. |
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options.. |
java.lang.String |
outputFileTipText()
Returns the tip text for this property |
void |
postProcess(ResultProducer rp)
Perform any postprocessing. |
void |
preProcess(ResultProducer rp)
Prepare for the results to be received. |
private void |
printResultNames(ResultProducer rp)
Prints the names of each field out as the first row of the CSV output. |
void |
setOptions(java.lang.String[] options)
Parses a given list of options. |
void |
setOutputFile(java.io.File newOutputFile)
Set the value of OutputFile. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected ResultProducer m_RP
protected java.io.File m_OutputFile
protected transient java.io.PrintWriter m_Out
Constructor Detail |
public CSVResultListener()
Method Detail |
public java.lang.String globalInfo()
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-O filename
The filename where output will be stored. Use - for stdout.
(default stdout)
setOptions
in interface OptionHandler
options
- the list of options as an array of strings
java.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface OptionHandler
public java.lang.String outputFileTipText()
public java.io.File getOutputFile()
public void setOutputFile(java.io.File newOutputFile)
newOutputFile
- Value to assign to OutputFile.public void preProcess(ResultProducer rp) throws java.lang.Exception
preProcess
in interface ResultListener
rp
- the ResultProducer that will generate the results
java.lang.Exception
- if an error occurs during preprocessing.public void postProcess(ResultProducer rp) throws java.lang.Exception
postProcess
in interface ResultListener
rp
- the ResultProducer that generated the results
java.lang.Exception
- if an error occurspublic java.lang.String[] determineColumnConstraints(ResultProducer rp) throws java.lang.Exception
determineColumnConstraints
in interface ResultListener
rp
- the ResultProducer to which the constraints will apply
java.lang.Exception
- if an error occurs.public void acceptResult(ResultProducer rp, java.lang.Object[] key, java.lang.Object[] result) throws java.lang.Exception
acceptResult
in interface ResultListener
rp
- the ResultProducer that generated the resultkey
- The key for the results.result
- The actual results.
java.lang.Exception
- if the result could not be accepted.public boolean isResultRequired(ResultProducer rp, java.lang.Object[] key) throws java.lang.Exception
isResultRequired
in interface ResultListener
rp
- the ResultProducer wanting to generate the resultkey
- The key for which a result may be needed.
java.lang.Exception
- if it could not be determined if the result
is needed.private void printResultNames(ResultProducer rp) throws java.lang.Exception
rp
- the ResultProducer generating our results.
java.lang.Exception
- if the field names could not be determined.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |