adams.data.conversion
Class AbstractSpreadSheetColumnConverter<T>

java.lang.Object
  extended by adams.core.ConsoleObject
      extended by adams.core.option.AbstractOptionHandler
          extended by adams.data.conversion.AbstractConversion
              extended by adams.data.conversion.AbstractSpreadSheetConversion
                  extended by adams.data.conversion.AbstractInPlaceSpreadSheetConversion
                      extended by adams.data.conversion.AbstractSpreadSheetColumnConverter<T>
Type Parameters:
T - the type of class to convert the cell values to
All Implemented Interfaces:
CleanUpHandler, Debuggable, Destroyable, OptionHandler, QuickInfoSupporter, ShallowCopySupporter<AbstractConversion>, SizeOfHandler, Conversion, InPlaceProcessing, Serializable
Direct Known Subclasses:
SpreadSheetAnyColumnToString, SpreadSheetDoubleColumnToLong, SpreadSheetDoubleColumnToString, SpreadSheetStringColumnToBoolean, SpreadSheetStringColumnToDate, SpreadSheetStringColumnToDateTime, SpreadSheetStringColumnToDouble, SpreadSheetStringColumnToLong, SpreadSheetStringColumnToTime

public abstract class AbstractSpreadSheetColumnConverter<T>
extends AbstractInPlaceSpreadSheetConversion

Ancestor for column converter schemes.

Version:
$Revision: 6291 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form

Field Summary
protected  Index m_Column
          the column to process.
 
Fields inherited from class adams.data.conversion.AbstractInPlaceSpreadSheetConversion
m_NoCopy
 
Fields inherited from class adams.data.conversion.AbstractConversion
m_Input, m_Output, m_Owner
 
Fields inherited from class adams.core.option.AbstractOptionHandler
m_DebugLevel, m_OptionManager
 
Constructor Summary
AbstractSpreadSheetColumnConverter()
           
 
Method Summary
abstract  String columnTipText()
          Returns the tip text for this property.
protected abstract  void convert(Cell cellOld, Cell cellNew)
          Converts the cell's content to a new format.
protected  SpreadSheet convert(SpreadSheet input)
          Generates the new spreadsheet from the input.
 void defineOptions()
          Adds options to the internal list of options.
 Index getColumn()
          Returns the column to convert.
protected  void preConvert(SpreadSheet input)
          Prepares the conversion.
 void setColumn(Index value)
          Sets the column to convert.
 
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, getInput, getOutput, getOwner, getQuickInfo, reset, setInput, setOwner, shallowCopy, shallowCopy
 
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, debug, debug, debugLevelTipText, destroy, finishInit, getDebugLevel, getOptionManager, globalInfo, initialize, isDebugOn, newOptionManager, setDebugLevel, toCommandLine, toString
 
Methods inherited from class adams.core.ConsoleObject
getDebugging, getSystemErr, getSystemOut, sizeOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_Column

protected Index m_Column
the column to process.

Constructor Detail

AbstractSpreadSheetColumnConverter

public AbstractSpreadSheetColumnConverter()
Method Detail

defineOptions

public void defineOptions()
Adds options to the internal list of options.

Specified by:
defineOptions in interface OptionHandler
Overrides:
defineOptions in class AbstractInPlaceSpreadSheetConversion

setColumn

public void setColumn(Index value)
Sets the column to convert.

Parameters:
value - the index

getColumn

public Index 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.

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 cell
cellNew - 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:
convert in class AbstractSpreadSheetConversion
Parameters:
input - the incoming spreadsheet
Returns:
the generated spreadsheet
Throws:
Exception - if conversion fails for some reason


Copyright © 2013 University of Waikato, Hamilton, NZ. All Rights Reserved.