org.hackystat.sensor.xmldata.option
Class AbstractOption

java.lang.Object
  extended by org.hackystat.sensor.xmldata.option.AbstractOption
All Implemented Interfaces:
Option
Direct Known Subclasses:
ArgListOption, FileOption, MigrationOption, MultiShellOption, ResourceOption, SdtOption, SetRuntimeOption, UniqueTstampOption, VerboseOption

public abstract class AbstractOption
extends java.lang.Object
implements Option

The skeletal implementation of an option, which provides default implementations for the basic accessor methods. Sub-classes must override the abstract methods to provide functionality specific to their class type.

Author:
aito

Constructor Summary
AbstractOption(XmlDataController controller, java.lang.String name, java.util.List<java.lang.String> parameters)
          Constructs this option with a controller, option name, and a list of parameters used to execute this option.
 
Method Summary
 void execute()
          Implements the execute method with the default execute behavior, which is to do nothing.
 XmlDataController getController()
          Returns the controller which provides access to parameters processed in other options and global sensor operations.
 java.lang.String getName()
          Returns the name of this option.
 java.util.List<java.lang.String> getParameters()
          Returns a list of parameters used to execute this option.
abstract  boolean isValid()
          Returns true if this option's parameters are valid.
 void process()
          Implements the process method to provide the default process behavior, which is perform no parameter processing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractOption

public AbstractOption(XmlDataController controller,
                      java.lang.String name,
                      java.util.List<java.lang.String> parameters)
Constructs this option with a controller, option name, and a list of parameters used to execute this option.

Parameters:
controller - the specified controller.
name - the specified option name.
parameters - the specified parameters.
Method Detail

getName

public java.lang.String getName()
Returns the name of this option.

Specified by:
getName in interface Option
Returns:
the option name.

getParameters

public java.util.List<java.lang.String> getParameters()
Returns a list of parameters used to execute this option.

Specified by:
getParameters in interface Option
Returns:
the list of parameters.

process

public void process()
Implements the process method to provide the default process behavior, which is perform no parameter processing.

Specified by:
process in interface Option

isValid

public abstract boolean isValid()
Returns true if this option's parameters are valid.

Specified by:
isValid in interface Option
Returns:
true if all parameters are valid.

getController

public XmlDataController getController()
Returns the controller which provides access to parameters processed in other options and global sensor operations.

Returns:
the controller instance.

execute

public void execute()
Implements the execute method with the default execute behavior, which is to do nothing.

Specified by:
execute in interface Option