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 boolean
m_Lenient
whether to be lenient with indices.protected String
m_Prefix
the prefix of the objects in the report.protected boolean
m_Quiet
whether to suppress warning messages.protected boolean
m_ResetIndicesIfNecessary
whether 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 String
check(LocatedObjects objects)
Hook method for performing checks.void
defineOptions()
Adds options to the internal list of options.protected abstract int[]
doFind(LocatedObjects objects)
Performs the actual finding of the objects in the list.Report
filter(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.LocatedObjects
findObjects(Report report)
Finds the objects in the report.LocatedObjects
findObjects(LocatedObjects objects)
Finds the objects in the list of objects.boolean
getLenient()
Returns whether to suppress error if -1 indices found.String
getPrefix()
Returns the field prefix used in the report.String
getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.boolean
getQuiet()
Returns whether to suppress warning messages if -1 indices found.boolean
getResetIndicesIfNecessary()
Returns whether to reset the indices of the objects if necessary, e.g., when missing or duplicates.String
lenientTipText()
Returns the tip text for this property.String
prefixTipText()
Returns the tip text for this property.String
quietTipText()
Returns the tip text for this property.String
resetIndicesIfNecessaryTipText()
Returns the tip text for this property.void
setLenient(boolean value)
Sets whether to suppress error if -1 indices found.void
setPrefix(String value)
Sets the field prefix used in the report.void
setQuiet(boolean value)
Sets whether to suppress warning messages if -1 indices found.void
setResetIndicesIfNecessary(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:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
setPrefix
public void setPrefix(String value)
Sets the field prefix used in the report.- Specified by:
setPrefix
in interfaceObjectFinder
- Specified by:
setPrefix
in interfaceObjectPrefixHandler
- Parameters:
value
- the field prefix
-
getPrefix
public String getPrefix()
Returns the field prefix used in the report.- Specified by:
getPrefix
in interfaceObjectFinder
- Specified by:
getPrefix
in interfaceObjectPrefixHandler
- Returns:
- the field prefix
-
prefixTipText
public String prefixTipText()
Returns the tip text for this property.- Specified by:
prefixTipText
in interfaceObjectFinder
- Specified by:
prefixTipText
in 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:
setResetIndicesIfNecessary
in 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:
getResetIndicesIfNecessary
in interfaceObjectFinder
- Returns:
- true if to reset
-
resetIndicesIfNecessaryTipText
public String resetIndicesIfNecessaryTipText()
Returns the tip text for this property.- Specified by:
resetIndicesIfNecessaryTipText
in 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:
setLenient
in interfaceLenientModeSupporter
- Parameters:
value
- true if to suppress
-
getLenient
public boolean getLenient()
Returns whether to suppress error if -1 indices found.- Specified by:
getLenient
in interfaceLenientModeSupporter
- Returns:
- true if to suppress
-
lenientTipText
public String lenientTipText()
Returns the tip text for this property.- Specified by:
lenientTipText
in 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:
getQuickInfo
in 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:
find
in 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:
find
in 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:
findObjects
in 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:
findObjects
in interfaceObjectFinder
- Parameters:
report
- the report to process- Returns:
- the indices
-
filter
public Report filter(Report report)
Filters the objects in the report.- Specified by:
filter
in interfaceObjectFinder
- Parameters:
report
- the report to process- Returns:
- the filtered report
-
-