public class CSVSaver extends AbstractFileSaver implements BatchConverter, IncrementalConverter, FileSourcedConverter
-F <separator> The field separator to be used. '\t' can be used as well. (default: ',')
-M <str> The string representing a missing value. (default: ?)
-N Don't write a header row.
-decimal <num> The maximum number of digits to print after the decimal place for numeric values (default: 6)
-i <the input file> The input file
-o <the output file> The output file
Saver,
Serialized FormBATCH, INCREMENTAL, NONE| Constructor and Description |
|---|
CSVSaver()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
String |
fieldSeparatorTipText()
Returns the tip text for this property.
|
Capabilities |
getCapabilities()
Returns the Capabilities of this saver.
|
String |
getFieldSeparator()
Returns the character used as column separator.
|
String |
getFileDescription()
Returns a description of the file type.
|
int |
getMaxDecimalPlaces()
Get the maximum number of decimal places to print
|
String |
getMissingValue()
Returns the current placeholder for missing values.
|
boolean |
getNoHeaderRow()
Get whether to not write the header row
|
String[] |
getOptions()
Gets the current settings of the Classifier.
|
String |
getRevision()
Returns the revision string.
|
String |
globalInfo()
Returns a string describing this Saver.
|
Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(String[] args)
Main method.
|
String |
maxDecimalPlacesTipText()
Returns the tip text for this property.
|
String |
missingValueTipText()
Returns the tip text for this property.
|
String |
noHeaderRowTipText()
Returns the tip text for this property.
|
void |
resetOptions()
Resets the Saver.
|
void |
setFieldSeparator(String value)
Sets the character used as column separator.
|
void |
setMaxDecimalPlaces(int maxDecimal)
Set the maximum number of decimal places to print
|
void |
setMissingValue(String value)
Sets the placeholder for missing values.
|
void |
setNoHeaderRow(boolean b)
Set whether to not write the header row
|
void |
setOptions(String[] options)
Valid options are:
|
void |
writeBatch()
Writes a Batch of instances.
|
void |
writeIncremental(Instance inst)
Saves an instances incrementally.
|
cancel, filePrefix, getFileExtension, getFileExtensions, getUseRelativePath, getWriter, resetWriter, retrieveDir, retrieveFile, runFileSaver, setDestination, setDestination, setDir, setDirAndPrefix, setEnvironment, setFile, setFilePrefix, setUseRelativePath, useRelativePathTipTextgetInstances, getWriteMode, resetStructure, setInstances, setRetrieval, setStructureequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetFileExtension, getFileExtensions, getUseRelativePath, retrieveFile, setFile, setUseRelativePathpublic String globalInfo()
public Enumeration listOptions()
listOptions in interface OptionHandlerlistOptions in class AbstractFileSaverpublic void setOptions(String[] options) throws Exception
-F <separator> The field separator to be used. '\t' can be used as well. (default: ',')
-M <str> The string representing a missing value. (default: ?)
-N Don't write a header row.
-decimal <num> The maximum number of digits to print after the decimal place for numeric values (default: 6)
-i <the input file> The input file
-o <the output file> The output file
setOptions in interface OptionHandlersetOptions in class AbstractFileSaveroptions - the list of options as an array of stringsException - if an option is not supportedpublic String[] getOptions()
getOptions in interface OptionHandlergetOptions in class AbstractFileSaverpublic String noHeaderRowTipText()
public void setNoHeaderRow(boolean b)
b - true if no header row is to be writtenpublic boolean getNoHeaderRow()
public void setMaxDecimalPlaces(int maxDecimal)
maxDecimal - the maximum number of decimal places to printpublic int getMaxDecimalPlaces()
public String maxDecimalPlacesTipText()
public void setFieldSeparator(String value)
value - the character to usepublic String getFieldSeparator()
public String fieldSeparatorTipText()
public void setMissingValue(String value)
value - the placeholderpublic String getMissingValue()
public String missingValueTipText()
public String getFileDescription()
getFileDescription in interface FileSourcedConvertergetFileDescription in class AbstractFileSaverpublic void resetOptions()
resetOptions in class AbstractFileSaverpublic Capabilities getCapabilities()
getCapabilities in interface CapabilitiesHandlergetCapabilities in class AbstractSaverCapabilitiespublic void writeIncremental(Instance inst) throws IOException
writeIncremental in interface SaverwriteIncremental in class AbstractSaverinst - the instance to saveIOException - throws IOEXception if an instance cannot be saved
incrementally.public void writeBatch()
throws IOException
writeBatch in interface SaverwriteBatch in class AbstractSaverIOException - throws IOException if saving in batch mode is not
possiblepublic String getRevision()
getRevision in interface RevisionHandlerpublic static void main(String[] args)
args - should contain the options of a Saver.Copyright © 2013 University of Waikato, Hamilton, NZ. All Rights Reserved.