Package adams.data.featureconverter
Class Text
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,QuickInfoSupporter,SizeOfHandler,Serializable
public class Text extends AbstractFeatureConverter<String,String>
Simple feature converter that generates a CSV-like textual output.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-separator <java.lang.String> (property: separator) The separator to use between cells. default: ,
-missing-value <java.lang.String> (property: missingValue) The value to use for missing values. default:
- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringm_MissingValuethe string to use for missing values.protected Stringm_Separatorthe separator to use.-
Fields inherited from class adams.data.featureconverter.AbstractFeatureConverter
m_Dataset, m_Header, m_HeaderDefinition
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description Text()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddefineOptions()Adds options to the internal list of options.protected StringdoGenerateHeader(HeaderDefinition header)Performs the actual generation of the header data structure using the supplied header definition.protected StringdoGenerateRow(List data)Performs the actual generation of a row from the raw data.ClassgetDatasetFormat()Returns the class of the dataset that the converter generates.StringgetMissingValue()Returns the string to use for missing values.StringgetQuickInfo()Returns a quick info about the object, which can be displayed in the GUI.ClassgetRowFormat()Returns the class of the row that the converter generates.StringgetSeparator()Returns the separator in use.StringglobalInfo()Returns a string describing the object.StringmissingValueTipText()Returns the tip text for this property.StringseparatorTipText()Returns the tip text for this property.voidsetMissingValue(String value)Sets the string to use for missing values.voidsetSeparator(String value)Sets the separator to use.-
Methods inherited from class adams.data.featureconverter.AbstractFeatureConverter
datasetTipText, generateHeader, generateRow, getDataset, getHeader, getHeaderDefinition, isInitialized, reset, setDataset
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractFeatureConverter<String,String>
-
setSeparator
public void setSeparator(String value)
Sets the separator to use.- Parameters:
value- the separator
-
getSeparator
public String getSeparator()
Returns the separator in use.- Returns:
- the separator
-
separatorTipText
public String separatorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setMissingValue
public void setMissingValue(String value)
Sets the string to use for missing values.- Parameters:
value- the missing value string
-
getMissingValue
public String getMissingValue()
Returns the string to use for missing values.- Returns:
- the missing value string
-
missingValueTipText
public String missingValueTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.- Specified by:
getQuickInfoin interfaceQuickInfoSupporter- Overrides:
getQuickInfoin classAbstractFeatureConverter<String,String>- Returns:
- null if no info available, otherwise short string
-
getDatasetFormat
public Class getDatasetFormat()
Returns the class of the dataset that the converter generates.- Specified by:
getDatasetFormatin classAbstractFeatureConverter<String,String>- Returns:
- the format
-
getRowFormat
public Class getRowFormat()
Returns the class of the row that the converter generates.- Specified by:
getRowFormatin classAbstractFeatureConverter<String,String>- Returns:
- the format
-
doGenerateHeader
protected String doGenerateHeader(HeaderDefinition header)
Performs the actual generation of the header data structure using the supplied header definition.- Specified by:
doGenerateHeaderin classAbstractFeatureConverter<String,String>- Parameters:
header- the header definition- Returns:
- the dataset structure
-
doGenerateRow
protected String doGenerateRow(List data)
Performs the actual generation of a row from the raw data.- Specified by:
doGenerateRowin classAbstractFeatureConverter<String,String>- Parameters:
data- the data of the row, elements can be null (= missing)- Returns:
- the dataset structure
-
-