Package adams.core.discovery
Class AbstractDiscoveryHandler
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.core.discovery.AbstractDiscoveryHandler
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,ShallowCopySupporter<AbstractDiscoveryHandler>
,SizeOfHandler
,Serializable
- Direct Known Subclasses:
AbstractGeneticDiscoveryHandler
,Actor
public abstract class AbstractDiscoveryHandler extends AbstractOptionHandler implements ShallowCopySupporter<AbstractDiscoveryHandler>
Ancestor for discovery algorithms.- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected List<PropertyPath.PropertyContainer>
m_Containers
the located property containers.protected boolean
m_InvertMatching
whether to invert the matching sense.protected BaseRegExp
m_RegExp
the regular expression on the property path.-
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 AbstractDiscoveryHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addContainer(PropertyPath.PropertyContainer value)
Stores the container.void
defineOptions()
Adds options to the internal list of options.List<PropertyPath.PropertyContainer>
getContainers()
The stored property container(s).boolean
getInvertMatching()
Returns whether to invert the matching sense of the path regexp.BaseRegExp
getRegExp()
Returns the regular expression to match the path against.boolean
handles(PropertyPath.Path path, Object obj)
Checks whether this object is handled by this discovery handler.protected abstract boolean
handles(Object obj)
Checks whether this object is handled by this discovery handler.String
invertMatchingTipText()
Returns the tip text for this property.String
regExpTipText()
Returns the tip text for this property.protected void
reset()
Resets the handler.void
setInvertMatching(boolean value)
Sets whether to invert the matching sense of the path regexp.void
setRegExp(BaseRegExp value)
Sets the regular expression to match the path against.AbstractDiscoveryHandler
shallowCopy()
Returns a shallow copy of itself, i.e., based on the commandline options.AbstractDiscoveryHandler
shallowCopy(boolean expand)
Returns a shallow copy of itself, i.e., based on the commandline options.String
toString()
Returns a short description of the handler.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine
-
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_RegExp
protected BaseRegExp m_RegExp
the regular expression on the property path.
-
m_InvertMatching
protected boolean m_InvertMatching
whether to invert the matching sense.
-
m_Containers
protected transient List<PropertyPath.PropertyContainer> m_Containers
the located property containers.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
reset
protected void reset()
Resets the handler.- Overrides:
reset
in classAbstractOptionHandler
-
setRegExp
public void setRegExp(BaseRegExp value)
Sets the regular expression to match the path against.- Parameters:
value
- the regular expression
-
getRegExp
public BaseRegExp getRegExp()
Returns the regular expression to match the path against.- Returns:
- the regular expression
-
regExpTipText
public String regExpTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setInvertMatching
public void setInvertMatching(boolean value)
Sets whether to invert the matching sense of the path regexp.- Parameters:
value
- true if to invert
-
getInvertMatching
public boolean getInvertMatching()
Returns whether to invert the matching sense of the path regexp.- Returns:
- true if to invert
-
invertMatchingTipText
public String invertMatchingTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
addContainer
public void addContainer(PropertyPath.PropertyContainer value)
Stores the container.- Parameters:
value
- the container
-
getContainers
public List<PropertyPath.PropertyContainer> getContainers()
The stored property container(s).- Returns:
- the container(s)
-
handles
protected abstract boolean handles(Object obj)
Checks whether this object is handled by this discovery handler.- Parameters:
obj
- the object to check- Returns:
- true if handled
-
handles
public boolean handles(PropertyPath.Path path, Object obj)
Checks whether this object is handled by this discovery handler.- Parameters:
path
- the associated pathobj
- the object to check- Returns:
- true if handled
-
shallowCopy
public AbstractDiscoveryHandler shallowCopy()
Returns a shallow copy of itself, i.e., based on the commandline options.- Specified by:
shallowCopy
in interfaceShallowCopySupporter<AbstractDiscoveryHandler>
- Returns:
- the shallow copy
-
shallowCopy
public AbstractDiscoveryHandler shallowCopy(boolean expand)
Returns a shallow copy of itself, i.e., based on the commandline options.- Specified by:
shallowCopy
in interfaceShallowCopySupporter<AbstractDiscoveryHandler>
- Parameters:
expand
- whether to expand variables to their current values- Returns:
- the shallow copy
-
toString
public String toString()
Returns a short description of the handler.- Overrides:
toString
in classAbstractOptionHandler
- Returns:
- the description
-
-