org.incava.jagol

Class ListOption

public class ListOption extends Option

Represents a list of objects that comprise this option.
Constructor Summary
ListOption(String longName, String description)
Creates the option.
ListOption(String longName, String description, List value)
Creates the option, with a default list.
Method Summary
protected Objectconvert(String str)
Returns the string, possibly converted to a different Object type.
ListgetValue()
Returns the value.
protected voidparse(String str)
Parses the value into the value list.
booleanset(String arg, List args)
Sets from a list of command-line arguments.
voidsetValue(List value)
Sets the value.
voidsetValue(String value)
Sets the value from the string, for a list type.
StringtoString()

Constructor Detail

ListOption

public ListOption(String longName, String description)
Creates the option.

ListOption

public ListOption(String longName, String description, List value)
Creates the option, with a default list.

Method Detail

convert

protected Object convert(String str)
Returns the string, possibly converted to a different Object type. Subclasses can convert the string to their own data type.

getValue

public List getValue()
Returns the value. This is empty by default.

parse

protected void parse(String str)
Parses the value into the value list. If subclasses want to convert the string to their own data type, override the convert method.

See Also: convert

set

public boolean set(String arg, List args)
Sets from a list of command-line arguments. Returns whether this option could be set from the current head of the list. Assumes whitespace or comma delimiter.

setValue

public void setValue(List value)
Sets the value.

setValue

public void setValue(String value)
Sets the value from the string, for a list type. Assumes whitespace or comma delimiter

toString

public String toString()