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 class
CorrespondingColumn.CorrespondingColumnIterator
Cell iterator that returns the locations for the corresponding cells.
-
Field Summary
Fields Modifier and Type Field Description protected int
m_CorrespondingColumn
the position of the corresponding column.protected PositionType
m_CorrespondingPosition
whether the corresponding column is relative or absolute.protected CellFinder
m_Finder
the 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 String
correspondingColumnTipText()
Returns the tip text for this property.String
correspondingPositionTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.protected Iterator<CellLocation>
doFindCells(SpreadSheet sheet)
Performs the actual locating.String
finderTipText()
Returns the tip text for this property.int
getCorrespondingColumn()
Returns the column location (abs/rel).PositionType
getCorrespondingPosition()
Returns how to interpret the column position.CellFinder
getFinder()
Returns the base cell finder.String
getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.String
globalInfo()
Returns a string describing the object.void
setCorrespondingColumn(int value)
Sets the column location (abs/rel).void
setCorrespondingPosition(PositionType value)
Sets how to interpret the column position.void
setFinder(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:AbstractOptionHandler
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in 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:
getQuickInfo
in interfaceQuickInfoSupporter
- Overrides:
getQuickInfo
in classAbstractCellFinder
- Returns:
- null if no info available, otherwise short string
-
doFindCells
protected Iterator<CellLocation> doFindCells(SpreadSheet sheet)
Performs the actual locating.- Specified by:
doFindCells
in classAbstractCellFinder
- Parameters:
sheet
- the sheet to locate the cells in- Returns:
- the iterator over the locations
-
-