org.incava.jagol

Class Option

Known Direct Subclasses:
BooleanOption, ListOption, NonBooleanOption

public abstract class Option
extends java.lang.Object

Base class of all options.

Field Summary

protected String
longName
protected char
shortName

Constructor Summary

Option(String longName, String description)

Method Summary

String
getDescription()
Returns the description.
String
getLongName()
Returns the long option name.
char
getShortName()
Returns the short option name.
abstract boolean
set(String arg, List args)
Sets from a list of command-line arguments.
void
setLongName(String longName)
void
setShortName(char shortName)
abstract void
setValue(String value)
Sets the value from the string, for this option type.

Field Details

longName

protected String longName

shortName

protected char shortName

Constructor Details

Option

public Option(String longName,
              String description)

Method Details

getDescription

public String getDescription()
Returns the description.

getLongName

public String getLongName()
Returns the long option name.

getShortName

public char getShortName()
Returns the short option name.

set

public abstract boolean set(String arg,
                            List args)
            throws OptionException
Sets from a list of command-line arguments. Returns whether this option could be set from the current head of the list.

setLongName

public void setLongName(String longName)

setShortName

public void setShortName(char shortName)

setValue

public abstract void setValue(String value)
            throws InvalidTypeException
Sets the value from the string, for this option type.