adams.flow.transformer.plotgenerator
Class AbstractPlotGenerator

java.lang.Object
  extended by adams.core.ConsoleObject
      extended by adams.core.option.AbstractOptionHandler
          extended by adams.flow.transformer.plotgenerator.AbstractPlotGenerator
All Implemented Interfaces:
Debuggable, Destroyable, OptionHandler, QuickInfoSupporter, SizeOfHandler, Serializable
Direct Known Subclasses:
NamedPlotGenerator, SimplePlotGenerator, XYPlotGenerator

public abstract class AbstractPlotGenerator
extends AbstractOptionHandler
implements QuickInfoSupporter

Ancestor for generators that use data from a spreadsheet to create plot containers for the SequencePlotter sink.

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

Field Summary
protected  double m_DefaultCellValue
          the default value for missing or non-numeric cells.
static String MISSING_CELL_VALUE
          the default string value for cells that are missing.
 
Fields inherited from class adams.core.option.AbstractOptionHandler
m_DebugLevel, m_OptionManager
 
Constructor Summary
AbstractPlotGenerator()
           
 
Method Summary
protected  void check(SpreadSheet sheet)
          Checks the spreadsheet.
 String defaultCellValueTipText()
          Returns the tip text for this property.
 void defineOptions()
          Adds options to the internal list of options.
protected abstract  List<SequencePlotterContainer> doGenerate(SpreadSheet sheet)
          Performs the actual generation of containers.
 List<SequencePlotterContainer> generate(SpreadSheet sheet)
          Generates plot containers from the provided spreadsheet.
protected  String getCellString(Row row, int index)
          Returns the string value for the specified cell.
protected  double getCellValue(Row row, int index)
          Returns the cell value for the specified column index.
 double getDefaultCellValue()
          Returns the default value for missing or non-numeric cells.
 String getQuickInfo()
          Returns a quick info about the object, which can be displayed in the GUI.
 void setDefaultCellValue(double value)
          Sets the default value for missing or non-numeric cells.
 
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, debug, debug, debugLevelTipText, destroy, finishInit, getDebugLevel, getOptionManager, globalInfo, initialize, isDebugOn, newOptionManager, reset, 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

MISSING_CELL_VALUE

public static final String MISSING_CELL_VALUE
the default string value for cells that are missing.

See Also:
Constant Field Values

m_DefaultCellValue

protected double m_DefaultCellValue
the default value for missing or non-numeric cells.

Constructor Detail

AbstractPlotGenerator

public AbstractPlotGenerator()
Method Detail

defineOptions

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

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

setDefaultCellValue

public void setDefaultCellValue(double value)
Sets the default value for missing or non-numeric cells.

Parameters:
value - the default value

getDefaultCellValue

public double getDefaultCellValue()
Returns the default value for missing or non-numeric cells.

Returns:
the default value

defaultCellValueTipText

public String defaultCellValueTipText()
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 object, which can be displayed in the GUI.

Default implementation returns null.

Specified by:
getQuickInfo in interface QuickInfoSupporter
Returns:
null if no info available, otherwise short string

check

protected void check(SpreadSheet sheet)
Checks the spreadsheet.

Default implementation only checks whether any data was provided.

Parameters:
sheet - the sheet to check

getCellString

protected String getCellString(Row row,
                               int index)
Returns the string value for the specified cell.

Parameters:
row - the row to get the cell from
index - the column index
Returns:
the string value

getCellValue

protected double getCellValue(Row row,
                              int index)
Returns the cell value for the specified column index. Uses the default value if the cell is missing or non-numeric.

Parameters:
row - the row to get the cell from
index - the column index
Returns:
the cell value
See Also:
m_DefaultCellValue

doGenerate

protected abstract List<SequencePlotterContainer> doGenerate(SpreadSheet sheet)
Performs the actual generation of containers.

Parameters:
sheet - the basis for the containers
Returns:
the generated containers

generate

public List<SequencePlotterContainer> generate(SpreadSheet sheet)
Generates plot containers from the provided spreadsheet.

Parameters:
sheet - the data to use
Returns:
the generated containers


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