Package adams.data.conversion
Class SpreadSheetSplitColumn
-
- All Implemented Interfaces:
AdditionalInformationHandler
,CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,ShallowCopySupporter<AbstractConversion>
,SizeOfHandler
,Stoppable
,Conversion
,Serializable
public class SpreadSheetSplitColumn extends AbstractSpreadSheetConversion
Splits the string representation of the cells of a column into multiple columns using a regular expression.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-column <adams.data.spreadsheet.SpreadSheetColumnIndex> (property: column) The column to split. default: first example: An index is a number starting with 1; column names (case-sensitive) as well as the following placeholders can be used: first, second, third, last_2, last_1, last; numeric indices can be enforced by preceding them with '#' (eg '#12'); column names can be surrounded by double quotes.
-expression <java.lang.String> (property: expression) The regular expression used for splitting the column; \t\n\r\b\f get automatically converted into their character counterparts. default: \\t
-delimiter <DISCARD|APPEND|PREPEND> (property: delimiter) Defines what to do with the delimiters (= expression). default: DISCARD
- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected SpreadSheetColumnIndex
m_Column
the column to process.protected StringSplit.Delimiter
m_Delimiter
what to do with the delimiters.protected String
m_Expression
the regular expression to use for splitting the string.-
Fields inherited from class adams.data.conversion.AbstractConversion
m_Input, m_Output, m_Owner, m_Stopped
-
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 SpreadSheetSplitColumn()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
columnTipText()
Returns the tip text for this property.protected SpreadSheet
convert(SpreadSheet input)
Returns a string describing the object.void
defineOptions()
Adds options to the internal list of options.String
delimiterTipText()
Returns the tip text for this property.String
expressionTipText()
Returns the tip text for this property.SpreadSheetColumnIndex
getColumn()
Returns the column to split.StringSplit.Delimiter
getDelimiter()
Returns what to do with the delimiter (= expression).String
getExpression()
Returns the regular expression for splitting the string.String
getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.String
globalInfo()
Returns a string describing the object.void
setColumn(SpreadSheetColumnIndex value)
Sets the column to split.void
setDelimiter(StringSplit.Delimiter value)
Sets what to do with the delimiter (= expression).void
setExpression(String value)
Sets the regular expression used for splitting the string.-
Methods inherited from class adams.data.conversion.AbstractSpreadSheetConversion
accepts, doConvert, generates
-
Methods inherited from class adams.data.conversion.AbstractConversion
checkData, cleanUp, convert, getAdditionalInformation, getInput, getInput, getOutput, getOutput, getOwner, reset, setInput, setOwner, shallowCopy, shallowCopy, stopExecution
-
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
-
-
-
-
Field Detail
-
m_Column
protected SpreadSheetColumnIndex m_Column
the column to process.
-
m_Expression
protected String m_Expression
the regular expression to use for splitting the string.
-
m_Delimiter
protected StringSplit.Delimiter m_Delimiter
what to do with the delimiters.
-
-
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 classAbstractOptionHandler
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.- Specified by:
getQuickInfo
in interfaceQuickInfoSupporter
- Overrides:
getQuickInfo
in classAbstractConversion
- Returns:
- null if no info available, otherwise short string
-
setColumn
public void setColumn(SpreadSheetColumnIndex value)
Sets the column to split.- Parameters:
value
- the index
-
getColumn
public SpreadSheetColumnIndex getColumn()
Returns the column to split.- Returns:
- the index
-
columnTipText
public String columnTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setExpression
public void setExpression(String value)
Sets the regular expression used for splitting the string.- Parameters:
value
- the expression
-
getExpression
public String getExpression()
Returns the regular expression for splitting the string.- Returns:
- the expression
-
expressionTipText
public String expressionTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setDelimiter
public void setDelimiter(StringSplit.Delimiter value)
Sets what to do with the delimiter (= expression).- Parameters:
value
- the action
-
getDelimiter
public StringSplit.Delimiter getDelimiter()
Returns what to do with the delimiter (= expression).- Returns:
- the action
-
delimiterTipText
public String delimiterTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
convert
protected SpreadSheet convert(SpreadSheet input) throws Exception
Returns a string describing the object.- Specified by:
convert
in classAbstractSpreadSheetConversion
- Parameters:
input
- the incoming spreadsheet- Returns:
- a description suitable for displaying in the gui
- Throws:
Exception
- if conversion fails for some reason
-
-