Package adams.data.conversion
Class AbstractSpreadSheetColumnConverter<T>
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.conversion.AbstractConversion
-
- adams.data.conversion.AbstractSpreadSheetConversion
-
- adams.data.conversion.AbstractInPlaceSpreadSheetConversion
-
- adams.data.conversion.AbstractSpreadSheetColumnConverter<T>
-
- Type Parameters:
T- the type of class to convert the cell values to
- All Implemented Interfaces:
AdditionalInformationHandler,CleanUpHandler,Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,QuickInfoSupporter,ShallowCopySupporter<AbstractConversion>,SizeOfHandler,Stoppable,Conversion,InPlaceProcessing,Serializable
- Direct Known Subclasses:
ExcelDoubleColumnToDate,ExcelDoubleColumnToDateTime,SpreadSheetAnyColumnToString,SpreadSheetDoubleColumnToLong,SpreadSheetDoubleColumnToString,SpreadSheetLongColumnToDouble,SpreadSheetObjectColumnToString,SpreadSheetStringColumnToBoolean,SpreadSheetStringColumnToDate,SpreadSheetStringColumnToDateTime,SpreadSheetStringColumnToDateTimeMsec,SpreadSheetStringColumnToDouble,SpreadSheetStringColumnToLong,SpreadSheetStringColumnToObject,SpreadSheetStringColumnToTime,SpreadSheetStringColumnToTimeMsec
public abstract class AbstractSpreadSheetColumnConverter<T> extends AbstractInPlaceSpreadSheetConversion
Ancestor for column converter schemes.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected SpreadSheetColumnIndexm_Columnthe column to process.protected booleanm_KeepFailedwhether to keep cell values of failed conversions rather than setting them to zero.-
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 AbstractSpreadSheetColumnConverter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract StringcolumnTipText()Returns the tip text for this property.protected abstract voidconvert(Cell cellOld, Cell cellNew)Converts the cell's content to a new format.protected SpreadSheetconvert(SpreadSheet input)Generates the new spreadsheet from the input.voiddefineOptions()Adds options to the internal list of options.SpreadSheetColumnIndexgetColumn()Returns the column to convert.booleangetKeepFailed()Returns whether to keep cells with failed conversion rather than setting them to missing.StringkeepFailedTipText()Returns the tip text for this property.protected voidpreConvert(SpreadSheet input)Prepares the conversion.voidsetColumn(SpreadSheetColumnIndex value)Sets the column to convert.voidsetKeepFailed(boolean value)Sets whether to keep cells with failed conversion rather than setting them to missing.-
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, getQuickInfo, reset, setInput, setOwner, shallowCopy, shallowCopy, stopExecution
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, 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_KeepFailed
protected boolean m_KeepFailed
whether to keep cell values of failed conversions rather than setting them to zero.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractInPlaceSpreadSheetConversion
-
setColumn
public void setColumn(SpreadSheetColumnIndex value)
Sets the column to convert.- Parameters:
value- the index
-
getColumn
public SpreadSheetColumnIndex getColumn()
Returns the column to convert.- Returns:
- the index
-
columnTipText
public abstract 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.
-
setKeepFailed
public void setKeepFailed(boolean value)
Sets whether to keep cells with failed conversion rather than setting them to missing.- Parameters:
value- if true failed cells are kept
-
getKeepFailed
public boolean getKeepFailed()
Returns whether to keep cells with failed conversion rather than setting them to missing.- Returns:
- true if to keep them
-
keepFailedTipText
public String keepFailedTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
preConvert
protected void preConvert(SpreadSheet input)
Prepares the conversion.- Parameters:
input- the spreadsheet to convert
-
convert
protected abstract void convert(Cell cellOld, Cell cellNew) throws Exception
Converts the cell's content to a new format.- Parameters:
cellOld- the current cellcellNew- the new cell with the converted content- Throws:
Exception- if conversion fails
-
convert
protected SpreadSheet convert(SpreadSheet input) throws Exception
Generates the new spreadsheet from the input.- Specified by:
convertin classAbstractSpreadSheetConversion- Parameters:
input- the incoming spreadsheet- Returns:
- the generated spreadsheet
- Throws:
Exception- if conversion fails for some reason
-
-