Package adams.data.objectfinder
Class AbstractObjectFinder
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.objectfinder.AbstractObjectFinder
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LenientModeSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,QuickInfoSupporter,SizeOfHandler,ObjectFinder,ObjectPrefixHandler,Serializable
- Direct Known Subclasses:
AbstractMetaObjectFinder,AllFinder,ByMetaDataNumericValue,ByMetaDataStringValue,HasMetaDataValue,MultiObjectFinder,NullFinder,ObjectsInPolygon,ObjectsInRegion,PolygonPoints,Size
public abstract class AbstractObjectFinder extends AbstractOptionHandler implements ObjectFinder, QuickInfoSupporter, LenientModeSupporter, ObjectPrefixHandler
Ancestor for finders that locate objects in the report of an image.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanm_Lenientwhether to be lenient with indices.protected Stringm_Prefixthe prefix of the objects in the report.protected booleanm_Quietwhether to suppress warning messages.protected booleanm_ResetIndicesIfNecessarywhether to reset indices if necessary.-
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 AbstractObjectFinder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected Stringcheck(LocatedObjects objects)Hook method for performing checks.voiddefineOptions()Adds options to the internal list of options.protected abstract int[]doFind(LocatedObjects objects)Performs the actual finding of the objects in the list.Reportfilter(Report report)Filters the objects in the report.int[]find(Report report)Finds the objects in the report.int[]find(LocatedObjects objects)Finds the objects in the list of objects.LocatedObjectsfindObjects(Report report)Finds the objects in the report.LocatedObjectsfindObjects(LocatedObjects objects)Finds the objects in the list of objects.booleangetLenient()Returns whether to suppress error if -1 indices found.StringgetPrefix()Returns the field prefix used in the report.StringgetQuickInfo()Returns a quick info about the object, which can be displayed in the GUI.booleangetQuiet()Returns whether to suppress warning messages if -1 indices found.booleangetResetIndicesIfNecessary()Returns whether to reset the indices of the objects if necessary, e.g., when missing or duplicates.StringlenientTipText()Returns the tip text for this property.StringprefixTipText()Returns the tip text for this property.StringquietTipText()Returns the tip text for this property.StringresetIndicesIfNecessaryTipText()Returns the tip text for this property.voidsetLenient(boolean value)Sets whether to suppress error if -1 indices found.voidsetPrefix(String value)Sets the field prefix used in the report.voidsetQuiet(boolean value)Sets whether to suppress warning messages if -1 indices found.voidsetResetIndicesIfNecessary(boolean value)Sets whether to reset the indices of the objects if necessary, e.g., when missing or duplicates.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, 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.Destroyable
destroy
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
-
-
-
Field Detail
-
m_Prefix
protected String m_Prefix
the prefix of the objects in the report.
-
m_ResetIndicesIfNecessary
protected boolean m_ResetIndicesIfNecessary
whether to reset indices if necessary.
-
m_Lenient
protected boolean m_Lenient
whether to be lenient with indices.
-
m_Quiet
protected boolean m_Quiet
whether to suppress warning messages.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractOptionHandler
-
setPrefix
public void setPrefix(String value)
Sets the field prefix used in the report.- Specified by:
setPrefixin interfaceObjectFinder- Specified by:
setPrefixin interfaceObjectPrefixHandler- Parameters:
value- the field prefix
-
getPrefix
public String getPrefix()
Returns the field prefix used in the report.- Specified by:
getPrefixin interfaceObjectFinder- Specified by:
getPrefixin interfaceObjectPrefixHandler- Returns:
- the field prefix
-
prefixTipText
public String prefixTipText()
Returns the tip text for this property.- Specified by:
prefixTipTextin interfaceObjectFinder- Specified by:
prefixTipTextin interfaceObjectPrefixHandler- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setResetIndicesIfNecessary
public void setResetIndicesIfNecessary(boolean value)
Sets whether to reset the indices of the objects if necessary, e.g., when missing or duplicates.- Specified by:
setResetIndicesIfNecessaryin interfaceObjectFinder- Parameters:
value- true if to reset
-
getResetIndicesIfNecessary
public boolean getResetIndicesIfNecessary()
Returns whether to reset the indices of the objects if necessary, e.g., when missing or duplicates.- Specified by:
getResetIndicesIfNecessaryin interfaceObjectFinder- Returns:
- true if to reset
-
resetIndicesIfNecessaryTipText
public String resetIndicesIfNecessaryTipText()
Returns the tip text for this property.- Specified by:
resetIndicesIfNecessaryTipTextin interfaceObjectFinder- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setLenient
public void setLenient(boolean value)
Sets whether to suppress error if -1 indices found.- Specified by:
setLenientin interfaceLenientModeSupporter- Parameters:
value- true if to suppress
-
getLenient
public boolean getLenient()
Returns whether to suppress error if -1 indices found.- Specified by:
getLenientin interfaceLenientModeSupporter- Returns:
- true if to suppress
-
lenientTipText
public String lenientTipText()
Returns the tip text for this property.- Specified by:
lenientTipTextin interfaceLenientModeSupporter- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setQuiet
public void setQuiet(boolean value)
Sets whether to suppress warning messages if -1 indices found.- Parameters:
value- true if to suppress
-
getQuiet
public boolean getQuiet()
Returns whether to suppress warning messages if -1 indices found.- Returns:
- true if to suppress
-
quietTipText
public String quietTipText()
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.- Specified by:
getQuickInfoin interfaceQuickInfoSupporter- Returns:
- null if no info available, otherwise short string
-
check
protected String check(LocatedObjects objects)
Hook method for performing checks.
Default implementation returns null.- Parameters:
objects- the list of objects to check- Returns:
- null if successful check, otherwise error message
-
doFind
protected abstract int[] doFind(LocatedObjects objects)
Performs the actual finding of the objects in the list.- Parameters:
objects- the list of objects to process- Returns:
- the indices
-
find
public int[] find(LocatedObjects objects)
Finds the objects in the list of objects.- Specified by:
findin interfaceObjectFinder- Parameters:
objects- the list of objects to process- Returns:
- the indices
-
find
public int[] find(Report report)
Finds the objects in the report.- Specified by:
findin interfaceObjectFinder- Parameters:
report- the report to process- Returns:
- the indices
-
findObjects
public LocatedObjects findObjects(LocatedObjects objects)
Finds the objects in the list of objects.- Specified by:
findObjectsin interfaceObjectFinder- Parameters:
objects- the list of objects to process- Returns:
- the indices
-
findObjects
public LocatedObjects findObjects(Report report)
Finds the objects in the report.- Specified by:
findObjectsin interfaceObjectFinder- Parameters:
report- the report to process- Returns:
- the indices
-
filter
public Report filter(Report report)
Filters the objects in the report.- Specified by:
filterin interfaceObjectFinder- Parameters:
report- the report to process- Returns:
- the filtered report
-
-