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 String
m_MissingValue
the string to use for missing values.protected String
m_Separator
the 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 void
defineOptions()
Adds options to the internal list of options.protected String
doGenerateHeader(HeaderDefinition header)
Performs the actual generation of the header data structure using the supplied header definition.protected String
doGenerateRow(List data)
Performs the actual generation of a row from the raw data.Class
getDatasetFormat()
Returns the class of the dataset that the converter generates.String
getMissingValue()
Returns the string to use for missing values.String
getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.Class
getRowFormat()
Returns the class of the row that the converter generates.String
getSeparator()
Returns the separator in use.String
globalInfo()
Returns a string describing the object.String
missingValueTipText()
Returns the tip text for this property.String
separatorTipText()
Returns the tip text for this property.void
setMissingValue(String value)
Sets the string to use for missing values.void
setSeparator(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:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in 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:
getQuickInfo
in interfaceQuickInfoSupporter
- Overrides:
getQuickInfo
in 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:
getDatasetFormat
in classAbstractFeatureConverter<String,String>
- Returns:
- the format
-
getRowFormat
public Class getRowFormat()
Returns the class of the row that the converter generates.- Specified by:
getRowFormat
in 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:
doGenerateHeader
in 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:
doGenerateRow
in classAbstractFeatureConverter<String,String>
- Parameters:
data
- the data of the row, elements can be null (= missing)- Returns:
- the dataset structure
-
-