Class AbstractCellFinder
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.spreadsheet.cellfinder.AbstractCellFinder
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,SizeOfHandler
,CellFinder
,Serializable
- Direct Known Subclasses:
AbstractRowCellFinder
,ColumnFinderRange
,CorrespondingColumn
,RowFinderRange
public abstract class AbstractCellFinder extends AbstractOptionHandler implements CellFinder
Ancestor for schemes that locate cells of interest in a spreadsheet.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
-
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 AbstractCellFinder()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
check(SpreadSheet sheet)
Checks whether the spreadsheet can be processed.protected abstract Iterator<CellLocation>
doFindCells(SpreadSheet sheet)
Performs the actual locating.Iterator<CellLocation>
findCells(SpreadSheet sheet)
Locates the cells in the spreadsheet.static CellFinder
forCommandLine(String cmdline)
Instantiates the cell finder from the given commandline (i.e., classname and optional options).static CellFinder
forName(String classname, String[] options)
Instantiates the cell finder with the given options.static String[]
getCellFinders()
Returns a list with classnames of cell finders.String
getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.CellFinder
shallowCopy()
Returns a shallow copy of itself, i.e., based on the commandline options.CellFinder
shallowCopy(boolean expand)
Returns a shallow copy of itself, i.e., based on the commandline options.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, 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
-
-
-
-
Method Detail
-
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 interfaceQuickInfoSupporter
- Returns:
- null if no info available, otherwise short string
-
check
protected void check(SpreadSheet sheet)
Checks whether the spreadsheet can be processed.
Default implementation only checks whether a spreadsheet was provided.- Parameters:
sheet
- the spreadsheet to check
-
doFindCells
protected abstract Iterator<CellLocation> doFindCells(SpreadSheet sheet)
Performs the actual locating.- Parameters:
sheet
- the sheet to locate the cells in- Returns:
- the iterator over the locations
-
findCells
public Iterator<CellLocation> findCells(SpreadSheet sheet)
Locates the cells in the spreadsheet.- Specified by:
findCells
in interfaceCellFinder
- Parameters:
sheet
- the sheet to locate the cells in- Returns:
- the iterator over the locations
-
shallowCopy
public CellFinder shallowCopy()
Returns a shallow copy of itself, i.e., based on the commandline options.- Returns:
- the shallow copy
-
shallowCopy
public CellFinder shallowCopy(boolean expand)
Returns a shallow copy of itself, i.e., based on the commandline options.- Parameters:
expand
- whether to expand variables to their current values- Returns:
- the shallow copy
-
getCellFinders
public static String[] getCellFinders()
Returns a list with classnames of cell finders.- Returns:
- the cell finder classnames
-
forName
public static CellFinder forName(String classname, String[] options)
Instantiates the cell finder with the given options.- Parameters:
classname
- the classname of the cell finder to instantiateoptions
- the options for the cell finder- Returns:
- the instantiated cell finder or null if an error occurred
-
forCommandLine
public static CellFinder forCommandLine(String cmdline)
Instantiates the cell finder from the given commandline (i.e., classname and optional options).- Parameters:
cmdline
- the classname (and optional options) of the cell finder to instantiate- Returns:
- the instantiated cell finder or null if an error occurred
-
-