laser.util.argument
Class Parameter

java.lang.Object
  extended by laser.util.argument.Argument
      extended by laser.util.argument.Parameter
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
BooleanParameter, ClassParameter, FloatParameter, IntegerParameter, LongParameter, StringParameter

public abstract class Parameter
extends Argument

The Parameter class defines a user-defined parameter. A parameter must be specified by the user. It has no default value.

Author:
Heather M. Conboy (laser-software@cs.umass.edu)
See Also:
Serialized Form

Field Summary
static char NOT_REPEATABLE_CHAR
          Signals the Parameter is not repeatable
static char REPEATABLE_CHAR
          Signals the Parameter is repeatable
 
Fields inherited from class laser.util.argument.Argument
FIRST, HELP_DEFAULT, HELP_PREFIX, REPEATABLE_DEFAULT, TYPE_PREFIX, TYPE_SUFFIX
 
Constructor Summary
protected Parameter(java.lang.String name)
          Creates a new Parameter with the given name.
protected Parameter(java.lang.String name, boolean isRepeatable, java.lang.String helpMessage)
          Creates a new Parameter with the given name.
 
Method Summary
 void check()
          Checks whether or not the user correctly specified a value for this parameter.
 java.lang.String getHelp()
          Gets the help for this Parameter.
 char getRepeatableChar()
          Gets the repeatable character.
 
Methods inherited from class laser.util.argument.Argument
checkValue, clear, clone, equals, fromStringValue, getHelpMessage, getName, getType, getValue, getValue, getValues, initialize, isRepeatable, numberOfActualValues, numberOfValues, parseValue, save, setValue, toString, toStringValue, toStringValue
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

REPEATABLE_CHAR

public static final char REPEATABLE_CHAR
Signals the Parameter is repeatable

See Also:
Constant Field Values

NOT_REPEATABLE_CHAR

public static final char NOT_REPEATABLE_CHAR
Signals the Parameter is not repeatable

See Also:
Constant Field Values
Constructor Detail

Parameter

protected Parameter(java.lang.String name,
                    boolean isRepeatable,
                    java.lang.String helpMessage)
Creates a new Parameter with the given name. It will be multi-valued if isRepeatable is true and single-valued otherwise. The help message will be made available to the user upon request.

Parameters:
name - The name for the option
isRepeatable - If true then this parameter is multi-valued otherwise it is single-valued
helpMessage - The help message to report to the user upon request

Parameter

protected Parameter(java.lang.String name)
Creates a new Parameter with the given name. It will have the default setting for isRepeatable and helpMessage.

Parameters:
name - The name for the option
See Also:
Argument.REPEATABLE_DEFAULT, Argument.HELP_DEFAULT
Method Detail

check

public void check()
           throws ArgumentFormatException
Checks whether or not the user correctly specified a value for this parameter.

NOTE: A parameter must have at least one value.

Specified by:
check in class Argument
Throws:
ArgumentFormatException - if the parameter has no values

getRepeatableChar

public char getRepeatableChar()
Gets the repeatable character.

Specified by:
getRepeatableChar in class Argument
Returns:
The repeatable character

getHelp

public java.lang.String getHelp()
Gets the help for this Parameter.

Overrides:
getHelp in class Argument
Returns:
The help