public class CSVResultListener extends Object implements ResultListener, OptionHandler, RevisionHandler
-O <file name> The filename where output will be stored. Use - for stdout. (default temp file)
Constructor and Description |
---|
CSVResultListener()
Sets temporary file.
|
Modifier and Type | Method and Description |
---|---|
void |
acceptResult(ResultProducer rp,
Object[] key,
Object[] result)
Just prints out each result as it is received.
|
String[] |
determineColumnConstraints(ResultProducer rp)
Determines if there are any constraints (imposed by the
destination) on the result columns to be produced by
resultProducers.
|
String[] |
getOptions()
Gets the current settings of the Classifier.
|
File |
getOutputFile()
Get the value of OutputFile.
|
String |
getRevision()
Returns the revision string.
|
String |
globalInfo()
Returns a string describing this result listener
|
boolean |
isResultRequired(ResultProducer rp,
Object[] key)
Always says a result is required.
|
Enumeration |
listOptions()
Returns an enumeration describing the available options..
|
String |
outputFileName()
Get the value of OutputFileName.
|
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.
|
void |
setOptions(String[] options)
Parses a given list of options.
|
void |
setOutputFile(File newOutputFile)
Set the value of OutputFile.
|
void |
setOutputFileName(String name)
Set the value of OutputFileName.
|
public String globalInfo()
public Enumeration listOptions()
listOptions
in interface OptionHandler
public void setOptions(String[] options) throws Exception
-O <file name> The filename where output will be stored. Use - for stdout. (default temp file)
setOptions
in interface OptionHandler
options
- the list of options as an array of stringsException
- if an option is not supportedpublic String[] getOptions()
getOptions
in interface OptionHandler
public String outputFileTipText()
public File getOutputFile()
public void setOutputFile(File newOutputFile)
newOutputFile
- Value to assign to OutputFile.public String outputFileName()
public void setOutputFileName(String name)
name
- the name of OutputFile.public void preProcess(ResultProducer rp) throws Exception
preProcess
in interface ResultListener
rp
- the ResultProducer that will generate the resultsException
- if an error occurs during preprocessing.public void postProcess(ResultProducer rp) throws Exception
postProcess
in interface ResultListener
rp
- the ResultProducer that generated the resultsException
- if an error occurspublic String[] determineColumnConstraints(ResultProducer rp) throws Exception
determineColumnConstraints
in interface ResultListener
rp
- the ResultProducer to which the constraints will applyException
- if an error occurs.public void acceptResult(ResultProducer rp, Object[] key, Object[] result) throws Exception
acceptResult
in interface ResultListener
rp
- the ResultProducer that generated the resultkey
- The key for the results.result
- The actual results.Exception
- if the result could not be accepted.public boolean isResultRequired(ResultProducer rp, Object[] key) throws Exception
isResultRequired
in interface ResultListener
rp
- the ResultProducer wanting to generate the resultkey
- The key for which a result may be needed.Exception
- if it could not be determined if the result
is needed.public String getRevision()
getRevision
in interface RevisionHandler
Copyright © 2019 University of Waikato, Hamilton, NZ. All rights reserved.