Package adams.core.option
Class VariablesInstanceLister
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,OptionTraverser
,OptionTraverserWithResult<String>
,SizeOfHandler
,Serializable
public class VariablesInstanceLister extends AbstractOptionTraverserWithResult<String>
Lists the hashcodes of the adams.core.Variables objects in use by the adams.core.option.OptionManager objects.
Valid options are:
-D <int> (property: debugLevel) The greater the number the more additional info the scheme may output to the console (0 = off). default: 0 minimum: 0
- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected StringBuilder
m_Result
for storing the result.-
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 VariablesInstanceLister()
-
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.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.void
resetResult()
Resets the result before traversing.-
Methods inherited from class adams.core.option.AbstractOptionTraverserWithResult
reset
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, 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_Result
protected StringBuilder m_Result
for storing the result.
-
-
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
-
resetResult
public void resetResult()
Resets the result before traversing.- Specified by:
resetResult
in interfaceOptionTraverserWithResult<String>
- Specified by:
resetResult
in classAbstractOptionTraverserWithResult<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
-
getResult
public String getResult()
Returns the result of the traversal.- Specified by:
getResult
in interfaceOptionTraverserWithResult<String>
- Specified by:
getResult
in classAbstractOptionTraverserWithResult<String>
- Returns:
- the result
-
-