Package adams.core
Class VariablesFinder
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,OptionTraverser
,OptionTraverserWithResult<HashSet<String>>
,SizeOfHandler
,Serializable
- Direct Known Subclasses:
ActorVariablesFinder
public class VariablesFinder extends AbstractOptionTraverserWithResult<HashSet<String>>
Option traverser for locating variables.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected VariablesInspectionHandler
m_Inspection
the inspection class.protected HashSet<String>
variables
for storing the variables.-
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 VariablesFinder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canHandle(AbstractOption option)
Returns whether the traverser is allowed to "handle" this option.boolean
canRecurse(Class cls)
Returns whether the traverser can recurse the specified class (base class from a ClassOption).boolean
canRecurse(Object obj)
Returns whether the traverser can recurse the specified object.HashSet<String>
getResult()
Returns the result of the traversal.String
globalInfo()
Returns a string describing the object.void
handleArgumentOption(AbstractArgumentOption option, OptionTraversalPath path)
Handles the encountered argument option.void
handleBooleanOption(BooleanOption option, OptionTraversalPath path)
Handles the encountered boolean option.void
handleClassOption(ClassOption option, OptionTraversalPath path)
Handles the encountered class option.protected void
initialize()
Initializes the members.protected boolean
isSkipped(AbstractOption option)
Checks whether to skip this option.void
resetResult()
Resets the result before traversing.void
setInspection(VariablesInspectionHandler value)
Sets the inspection handler.-
Methods inherited from class adams.core.option.AbstractOptionTraverserWithResult
reset
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, 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
-
-
-
-
Field Detail
-
m_Inspection
protected VariablesInspectionHandler m_Inspection
the inspection class.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Overrides:
globalInfo
in classAbstractOptionTraverser
- Returns:
- a description suitable for displaying in the gui
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classAbstractOptionHandler
-
setInspection
public void setInspection(VariablesInspectionHandler value)
Sets the inspection handler.
-
resetResult
public void resetResult()
Resets the result before traversing.- Specified by:
resetResult
in interfaceOptionTraverserWithResult<HashSet<String>>
- Specified by:
resetResult
in classAbstractOptionTraverserWithResult<HashSet<String>>
-
handleBooleanOption
public void handleBooleanOption(BooleanOption option, OptionTraversalPath path)
Handles the encountered boolean option.- Specified by:
handleBooleanOption
in interfaceOptionTraverser
- Specified by:
handleBooleanOption
in classAbstractOptionTraverser
- Parameters:
option
- the option to handlepath
- the property path so far
-
handleClassOption
public void handleClassOption(ClassOption option, OptionTraversalPath path)
Handles the encountered class option. Precedence over argument option.- Specified by:
handleClassOption
in interfaceOptionTraverser
- Specified by:
handleClassOption
in classAbstractOptionTraverser
- Parameters:
option
- the option to handlepath
- the property path so far
-
handleArgumentOption
public void handleArgumentOption(AbstractArgumentOption option, OptionTraversalPath path)
Handles the encountered argument option.- Specified by:
handleArgumentOption
in interfaceOptionTraverser
- Specified by:
handleArgumentOption
in classAbstractOptionTraverser
- Parameters:
option
- the option to handlepath
- the property path so far
-
canHandle
public boolean canHandle(AbstractOption option)
Returns whether the traverser is allowed to "handle" this option.- Specified by:
canHandle
in interfaceOptionTraverser
- Specified by:
canHandle
in classAbstractOptionTraverser
- Parameters:
option
- the option to check whether it can be handled- Returns:
- true if handling via
handleArgumentOption(AbstractArgumentOption, OptionTraversalPath)
,handleClassOption(ClassOption, OptionTraversalPath)
orhandleBooleanOption(BooleanOption, OptionTraversalPath)
is allowed
-
canRecurse
public boolean canRecurse(Class cls)
Returns whether the traverser can recurse the specified class (base class from a ClassOption).- Specified by:
canRecurse
in interfaceOptionTraverser
- Specified by:
canRecurse
in classAbstractOptionTraverser
- Parameters:
cls
- the class to determine for whether recursing is possible or not- Returns:
- true if to traverse the options recursively
-
canRecurse
public boolean canRecurse(Object obj)
Returns whether the traverser can recurse the specified object.- Specified by:
canRecurse
in interfaceOptionTraverser
- Specified by:
canRecurse
in classAbstractOptionTraverser
- Parameters:
obj
- the Object to determine for whether recursing is possible or not- Returns:
- true if to traverse the options recursively
-
isSkipped
protected boolean isSkipped(AbstractOption option)
Checks whether to skip this option.
-
getResult
public HashSet<String> getResult()
Returns the result of the traversal.- Specified by:
getResult
in interfaceOptionTraverserWithResult<HashSet<String>>
- Specified by:
getResult
in classAbstractOptionTraverserWithResult<HashSet<String>>
- Returns:
- the result
-
-