Package adams.data.conversion
Class SpreadSheetUseRowAsHeader
-
- All Implemented Interfaces:
AdditionalInformationHandler
,CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,ShallowCopySupporter<AbstractConversion>
,SizeOfHandler
,Stoppable
,Conversion
,InPlaceProcessing
,Serializable
public class SpreadSheetUseRowAsHeader extends AbstractInPlaceSpreadSheetConversion
Uses the values of the specified data row for the header.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-no-copy <boolean> (property: noCopy) If enabled, no copy of the spreadsheet is created before processing it. default: false
-row <adams.data.spreadsheet.SpreadSheetRowIndex> (property: row) The row to use as the new header. default: 1 example: An index is a number starting with 1; the following placeholders can be used as well: first, second, third, last_2, last_1, last
-force-string <boolean> (property: forceString) If enabled, the value is set as string, even if it resembles a number. default: false
-delete <boolean> (property: delete) If enabled, the row gets deleted after updating the header. default: false
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
m_Delete
whether to delete the row after updating the header.protected boolean
m_ForceString
whether to set value as string.protected SpreadSheetRowIndex
m_Row
the row to use as header.-
Fields inherited from class adams.data.conversion.AbstractInPlaceSpreadSheetConversion
m_NoCopy
-
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 SpreadSheetUseRowAsHeader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SpreadSheet
convert(SpreadSheet input)
Generates the new spreadsheet from the input.void
defineOptions()
Adds options to the internal list of options.String
deleteTipText()
Returns the tip text for this property.String
forceStringTipText()
Returns the tip text for this property.boolean
getDelete()
Returns whether to delete the row after updating the header.boolean
getForceString()
Returns whether to force setting the value as string even if it resembles a number.String
getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.SpreadSheetRowIndex
getRow()
Returns the row to use as new header.String
globalInfo()
Returns a string describing the object.String
rowTipText()
Returns the tip text for this property.void
setDelete(boolean value)
Sets whether to delete the row after updating the header.void
setForceString(boolean value)
Sets whether to force setting the value as string even if it resembles a number.void
setRow(SpreadSheetRowIndex value)
Sets the row to use as new header.-
Methods inherited from class adams.data.conversion.AbstractInPlaceSpreadSheetConversion
getNoCopy, noCopyTipText, setNoCopy
-
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_Row
protected SpreadSheetRowIndex m_Row
the row to use as header.
-
m_ForceString
protected boolean m_ForceString
whether to set value as string.
-
m_Delete
protected boolean m_Delete
whether to delete the row after updating the header.
-
-
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 classAbstractInPlaceSpreadSheetConversion
-
setRow
public void setRow(SpreadSheetRowIndex value)
Sets the row to use as new header.- Parameters:
value
- the row
-
getRow
public SpreadSheetRowIndex getRow()
Returns the row to use as new header.- Returns:
- the row
-
rowTipText
public String rowTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setForceString
public void setForceString(boolean value)
Sets whether to force setting the value as string even if it resembles a number.- Parameters:
value
- true if to force string
-
getForceString
public boolean getForceString()
Returns whether to force setting the value as string even if it resembles a number.- Returns:
- true if string type is enforced
-
forceStringTipText
public String forceStringTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setDelete
public void setDelete(boolean value)
Sets whether to delete the row after updating the header.- Parameters:
value
- true if to delete the afterwards
-
getDelete
public boolean getDelete()
Returns whether to delete the row after updating the header.- Returns:
- true if to delete the row afterwards
-
deleteTipText
public String deleteTipText()
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 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
-
convert
protected SpreadSheet convert(SpreadSheet input) throws Exception
Generates the new spreadsheet from the input.- Specified by:
convert
in classAbstractSpreadSheetConversion
- Parameters:
input
- the incoming spreadsheet- Returns:
- the generated spreadsheet
- Throws:
Exception
- if conversion fails for some reason
-
-