Package adams.core.command
Class AbstractExternalCommandWithOptions
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.core.command.AbstractExternalCommand
-
- adams.core.command.AbstractExternalCommandWithOptions
-
- All Implemented Interfaces:
CleanUpHandler
,ExternalCommand
,ExternalCommandWithOptions
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,SizeOfHandler
,Stoppable
,StoppableWithFeedback
,FlowContextHandler
,Serializable
public abstract class AbstractExternalCommandWithOptions extends AbstractExternalCommand implements ExternalCommandWithOptions
Ancestor for commands that take options.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected BaseString[]
m_Options
the options for the command.protected BaseText
m_OptionsString
the options as single string.-
Fields inherited from class adams.core.command.AbstractExternalCommand
m_Executed, m_FlowContext, m_LastCommand, m_Output, m_OutputFormatter, m_OutputType, m_Running, m_StdErrProcessor, m_StdOutProcessor, m_Stopped
-
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 AbstractExternalCommandWithOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.String[]
getActualOptions()
Returns the actual options to use.BaseString[]
getOptions()
Returns the options for the command.BaseText
getOptionsString()
Returns the options for the command as single string.String
getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.String
optionsStringTipText()
Returns the tip text for this property.String
optionsTipText()
Returns the tip text for this property.void
setOptions(BaseString[] value)
Sets the options for the command.void
setOptions(String[] value)
Sets the options for the command.void
setOptions(List<String> value)
Sets the options for the command.void
setOptionsString(BaseText value)
Sets the options for the command.void
setOptionsString(String value)
Sets the options for the command.-
Methods inherited from class adams.core.command.AbstractExternalCommand
addFormattedOutput, buildCommand, check, cleanUp, commandResultToError, doAsyncExecute, doBlockingExecute, execute, generates, getDefaultOutputFormatter, getDefaultOutputType, getDefaultStdErrProcessor, getDefaultStdOutProcessor, getFlowContext, getLastCommand, getOutputFormatter, getOutputType, getStdErrProcessor, getStdOutProcessor, hasLastCommand, hasOutput, initialize, isExecuted, isFinished, isRunning, isStopped, log, log, log, output, outputFormatterTipText, outputTypeTipText, reset, setFlowContext, setOutputFormatter, setOutputType, setStdErrProcessor, setStdOutProcessor, stdErrProcessorTipText, stdOutProcessorTipText, stopExecution
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, 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.Destroyable
destroy
-
Methods inherited from interface adams.core.command.ExternalCommand
addFormattedOutput, cleanUp, execute, generates, getLastCommand, getOutputFormatter, getOutputType, getStdErrProcessor, getStdOutProcessor, hasLastCommand, hasOutput, isExecuted, isFinished, isRunning, isUsingBlocking, output, outputFormatterTipText, outputTypeTipText, setOutputFormatter, setOutputType, setStdErrProcessor, setStdOutProcessor, stdErrProcessorTipText, stdOutProcessorTipText
-
Methods inherited from interface adams.flow.core.FlowContextHandler
getFlowContext, setFlowContext
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
Methods inherited from interface adams.core.Stoppable
stopExecution
-
Methods inherited from interface adams.core.StoppableWithFeedback
isStopped
-
-
-
-
Field Detail
-
m_Options
protected BaseString[] m_Options
the options for the command.
-
m_OptionsString
protected BaseText m_OptionsString
the options as single string.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractExternalCommand
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.- Specified by:
getQuickInfo
in interfaceQuickInfoSupporter
- Overrides:
getQuickInfo
in classAbstractExternalCommand
- Returns:
- null if no info available, otherwise short string
-
setOptions
public void setOptions(List<String> value)
Sets the options for the command.- Specified by:
setOptions
in interfaceExternalCommandWithOptions
- Parameters:
value
- the options
-
setOptions
public void setOptions(String[] value)
Sets the options for the command.- Specified by:
setOptions
in interfaceExternalCommandWithOptions
- Parameters:
value
- the options
-
setOptions
public void setOptions(BaseString[] value)
Sets the options for the command.- Specified by:
setOptions
in interfaceExternalCommandWithOptions
- Parameters:
value
- the options
-
getOptions
public BaseString[] getOptions()
Returns the options for the command.- Specified by:
getOptions
in interfaceExternalCommandWithOptions
- Returns:
- the options
-
optionsTipText
public String optionsTipText()
Returns the tip text for this property.- Specified by:
optionsTipText
in interfaceExternalCommandWithOptions
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setOptionsString
public void setOptionsString(String value)
Sets the options for the command.- Specified by:
setOptionsString
in interfaceExternalCommandWithOptions
- Parameters:
value
- the options
-
setOptionsString
public void setOptionsString(BaseText value)
Sets the options for the command.- Specified by:
setOptionsString
in interfaceExternalCommandWithOptions
- Parameters:
value
- the options
-
getOptionsString
public BaseText getOptionsString()
Returns the options for the command as single string.- Specified by:
getOptionsString
in interfaceExternalCommandWithOptions
- Returns:
- the options
-
optionsStringTipText
public String optionsStringTipText()
Returns the tip text for this property.- Specified by:
optionsStringTipText
in interfaceExternalCommandWithOptions
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getActualOptions
public String[] getActualOptions()
Returns the actual options to use. The options string takes precendence over the array.- Specified by:
getActualOptions
in interfaceExternalCommandWithOptions
- Returns:
- the options
-
-