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 Stringm_ColumnNamethe new column name.protected SpreadSheetUnorderedColumnRangem_Columnsthe columns to merge.protected Stringm_Gluethe 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 StringcolumnNameTipText()Returns the tip text for this property.StringcolumnsTipText()Returns the tip text for this property.protected SpreadSheetconvert(SpreadSheet input)Returns a string describing the object.voiddefineOptions()Adds options to the internal list of options.StringgetColumnName()Returns the new column name.SpreadSheetUnorderedColumnRangegetColumns()Returns the range of columns to merge.StringgetGlue()Returns the "glue" to use between two columns.StringglobalInfo()Returns a string describing the object.StringglueTipText()Returns the tip text for this property.voidsetColumnName(String value)Sets the new column name.voidsetColumns(SpreadSheetUnorderedColumnRange value)Sets the range of columns to merge.voidsetGlue(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:
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 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:
convertin classAbstractSpreadSheetConversion- Parameters:
input- the incoming spreadsheet- Returns:
- a description suitable for displaying in the gui
- Throws:
Exception- if conversion fails for some reason
-
-