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_Containersthe located property containers.protected booleanm_InvertMatchingwhether to invert the matching sense.protected BaseRegExpm_RegExpthe 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 voidaddContainer(PropertyPath.PropertyContainer value)Stores the container.voiddefineOptions()Adds options to the internal list of options.List<PropertyPath.PropertyContainer>getContainers()The stored property container(s).booleangetInvertMatching()Returns whether to invert the matching sense of the path regexp.BaseRegExpgetRegExp()Returns the regular expression to match the path against.booleanhandles(PropertyPath.Path path, Object obj)Checks whether this object is handled by this discovery handler.protected abstract booleanhandles(Object obj)Checks whether this object is handled by this discovery handler.StringinvertMatchingTipText()Returns the tip text for this property.StringregExpTipText()Returns the tip text for this property.protected voidreset()Resets the handler.voidsetInvertMatching(boolean value)Sets whether to invert the matching sense of the path regexp.voidsetRegExp(BaseRegExp value)Sets the regular expression to match the path against.AbstractDiscoveryHandlershallowCopy()Returns a shallow copy of itself, i.e., based on the commandline options.AbstractDiscoveryHandlershallowCopy(boolean expand)Returns a shallow copy of itself, i.e., based on the commandline options.StringtoString()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:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractOptionHandler
-
reset
protected void reset()
Resets the handler.- Overrides:
resetin 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:
shallowCopyin 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:
shallowCopyin 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:
toStringin classAbstractOptionHandler- Returns:
- the description
-
-