Class CorrespondingColumn
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.spreadsheet.cellfinder.AbstractCellFinder
-
- adams.data.spreadsheet.cellfinder.CorrespondingColumn
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,QuickInfoSupporter,SizeOfHandler,CellFinder,Serializable
public class CorrespondingColumn extends AbstractCellFinder
Rather than return a cell that was located using the given cell finder, you can return a corresponding cell (within the same row).
This allows you to locate cells with certain value but then update a different column in the same row. You can specify whether the position of the corresponding column is relative (+3 or -4) or absolute (5th).
Valid options are:
-D <int> (property: debugLevel) The greater the number the more additional info the scheme may output to the console (0 = off). default: 0 minimum: 0
-finder <adams.data.spreadsheet.cellfinder.CellFinder> (property: finder) The base cell finder to locate the cells. default: adams.data.spreadsheet.cellfinder.ColumnFinderRange -column-finder adams.data.spreadsheet.columnfinder.ByIndex
-corresponding-position <ABSOLUTE|RELATIVE> (property: correspondingPosition) How to interpret the column position. default: RELATIVE
-corresponding-column <int> (property: correspondingColumn) The location of the column: 1-based if absolute mode; 0 in relative mode is the column itself. default: 0
- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCorrespondingColumn.CorrespondingColumnIteratorCell iterator that returns the locations for the corresponding cells.
-
Field Summary
Fields Modifier and Type Field Description protected intm_CorrespondingColumnthe position of the corresponding column.protected PositionTypem_CorrespondingPositionwhether the corresponding column is relative or absolute.protected CellFinderm_Finderthe base cell finder to use.-
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 CorrespondingColumn()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringcorrespondingColumnTipText()Returns the tip text for this property.StringcorrespondingPositionTipText()Returns the tip text for this property.voiddefineOptions()Adds options to the internal list of options.protected Iterator<CellLocation>doFindCells(SpreadSheet sheet)Performs the actual locating.StringfinderTipText()Returns the tip text for this property.intgetCorrespondingColumn()Returns the column location (abs/rel).PositionTypegetCorrespondingPosition()Returns how to interpret the column position.CellFindergetFinder()Returns the base cell finder.StringgetQuickInfo()Returns a quick info about the object, which can be displayed in the GUI.StringglobalInfo()Returns a string describing the object.voidsetCorrespondingColumn(int value)Sets the column location (abs/rel).voidsetCorrespondingPosition(PositionType value)Sets how to interpret the column position.voidsetFinder(CellFinder value)Sets the base cell finder.-
Methods inherited from class adams.data.spreadsheet.cellfinder.AbstractCellFinder
check, findCells, forCommandLine, forName, getCellFinders, shallowCopy, shallowCopy
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, 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_Finder
protected CellFinder m_Finder
the base cell finder to use.
-
m_CorrespondingPosition
protected PositionType m_CorrespondingPosition
whether the corresponding column is relative or absolute.
-
m_CorrespondingColumn
protected int m_CorrespondingColumn
the position of the corresponding column.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Description copied from class:AbstractOptionHandlerReturns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractOptionHandler
-
setFinder
public void setFinder(CellFinder value)
Sets the base cell finder.- Parameters:
value- the finder
-
getFinder
public CellFinder getFinder()
Returns the base cell finder.- Returns:
- the finder
-
finderTipText
public String finderTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setCorrespondingPosition
public void setCorrespondingPosition(PositionType value)
Sets how to interpret the column position.- Parameters:
value- the position type
-
getCorrespondingPosition
public PositionType getCorrespondingPosition()
Returns how to interpret the column position.- Returns:
- the position type
-
correspondingPositionTipText
public String correspondingPositionTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setCorrespondingColumn
public void setCorrespondingColumn(int value)
Sets the column location (abs/rel).- Parameters:
value- the location
-
getCorrespondingColumn
public int getCorrespondingColumn()
Returns the column location (abs/rel).- Returns:
- the location
-
correspondingColumnTipText
public String correspondingColumnTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.- Specified by:
getQuickInfoin interfaceQuickInfoSupporter- Overrides:
getQuickInfoin classAbstractCellFinder- Returns:
- null if no info available, otherwise short string
-
doFindCells
protected Iterator<CellLocation> doFindCells(SpreadSheet sheet)
Performs the actual locating.- Specified by:
doFindCellsin classAbstractCellFinder- Parameters:
sheet- the sheet to locate the cells in- Returns:
- the iterator over the locations
-
-