Package adams.data.conversion
Class SpreadSheetJoinColumns
-
- All Implemented Interfaces:
AdditionalInformationHandler
,CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,ShallowCopySupporter<AbstractConversion>
,SizeOfHandler
,Stoppable
,Conversion
,Serializable
public class SpreadSheetJoinColumns extends AbstractSpreadSheetConversion
Merges two or more columns in a spreadsheet into a single column.
Columns can be out-of-order.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-columns <adams.data.spreadsheet.SpreadSheetUnorderedColumnRange> (property: columns) The range of columns to merge into a single one default: first-last example: A range is a comma-separated list of single 1-based indices or sub-ranges of indices ('start-end'); 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.
-glue <java.lang.String> (property: glue) The 'glue' string to use between two values that get merged. default:
-column-name <java.lang.String> (property: columnName) The new column name; if left empty, a name is generated from the processed columns. default:
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String
m_ColumnName
the new column name.protected SpreadSheetUnorderedColumnRange
m_Columns
the columns to merge.protected String
m_Glue
the concatenation string to use.-
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 SpreadSheetJoinColumns()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
columnNameTipText()
Returns the tip text for this property.String
columnsTipText()
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
getColumnName()
Returns the new column name.SpreadSheetUnorderedColumnRange
getColumns()
Returns the range of columns to merge.String
getGlue()
Returns the "glue" to use between two columns.String
globalInfo()
Returns a string describing the object.String
glueTipText()
Returns the tip text for this property.void
setColumnName(String value)
Sets the new column name.void
setColumns(SpreadSheetUnorderedColumnRange value)
Sets the range of columns to merge.void
setGlue(String value)
Sets the "glue" to use between two columns.-
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, getQuickInfo, 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_Columns
protected SpreadSheetUnorderedColumnRange m_Columns
the columns to merge.
-
m_Glue
protected String m_Glue
the concatenation string to use.
-
m_ColumnName
protected String m_ColumnName
the new column name.
-
-
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
-
setColumns
public void setColumns(SpreadSheetUnorderedColumnRange value)
Sets the range of columns to merge.- Parameters:
value
- the range
-
getColumns
public SpreadSheetUnorderedColumnRange getColumns()
Returns the range of columns to merge.- Returns:
- true range
-
columnsTipText
public String columnsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setGlue
public void setGlue(String value)
Sets the "glue" to use between two columns.- Parameters:
value
- the glue
-
getGlue
public String getGlue()
Returns the "glue" to use between two columns.- Returns:
- the glue
-
glueTipText
public String glueTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setColumnName
public void setColumnName(String value)
Sets the new column name.- Parameters:
value
- the column name
-
getColumnName
public String getColumnName()
Returns the new column name.- Returns:
- the column name
-
columnNameTipText
public String columnNameTipText()
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
-
-