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 VariablesInspectionHandlerm_Inspectionthe inspection class.protected HashSet<String>variablesfor 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 booleancanHandle(AbstractOption option)Returns whether the traverser is allowed to "handle" this option.booleancanRecurse(Class cls)Returns whether the traverser can recurse the specified class (base class from a ClassOption).booleancanRecurse(Object obj)Returns whether the traverser can recurse the specified object.HashSet<String>getResult()Returns the result of the traversal.StringglobalInfo()Returns a string describing the object.voidhandleArgumentOption(AbstractArgumentOption option, OptionTraversalPath path)Handles the encountered argument option.voidhandleBooleanOption(BooleanOption option, OptionTraversalPath path)Handles the encountered boolean option.voidhandleClassOption(ClassOption option, OptionTraversalPath path)Handles the encountered class option.protected voidinitialize()Initializes the members.protected booleanisSkipped(AbstractOption option)Checks whether to skip this option.voidresetResult()Resets the result before traversing.voidsetInspection(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:
globalInfoin interfaceGlobalInfoSupporter- Overrides:
globalInfoin classAbstractOptionTraverser- Returns:
- a description suitable for displaying in the gui
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initializein classAbstractOptionHandler
-
setInspection
public void setInspection(VariablesInspectionHandler value)
Sets the inspection handler.
-
resetResult
public void resetResult()
Resets the result before traversing.- Specified by:
resetResultin interfaceOptionTraverserWithResult<HashSet<String>>- Specified by:
resetResultin classAbstractOptionTraverserWithResult<HashSet<String>>
-
handleBooleanOption
public void handleBooleanOption(BooleanOption option, OptionTraversalPath path)
Handles the encountered boolean option.- Specified by:
handleBooleanOptionin interfaceOptionTraverser- Specified by:
handleBooleanOptionin 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:
handleClassOptionin interfaceOptionTraverser- Specified by:
handleClassOptionin 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:
handleArgumentOptionin interfaceOptionTraverser- Specified by:
handleArgumentOptionin 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:
canHandlein interfaceOptionTraverser- Specified by:
canHandlein 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:
canRecursein interfaceOptionTraverser- Specified by:
canRecursein 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:
canRecursein interfaceOptionTraverser- Specified by:
canRecursein 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:
getResultin interfaceOptionTraverserWithResult<HashSet<String>>- Specified by:
getResultin classAbstractOptionTraverserWithResult<HashSet<String>>- Returns:
- the result
-
-