public class Option extends Object
It's inspiration was for command-line argument processing, but it can be used for any other purpose.
The GNU Lesser General Public License for details.
Modifier and Type | Field and Description |
---|---|
private ArgumentType |
argumentType |
private DataType |
dataType |
private String |
defaultValue |
private String |
description |
private String |
longName |
private char |
shortName |
Constructor and Description |
---|
Option(String description,
ArgumentType argumentType,
DataType dataType,
char shortName)
Create an Option with a short name, having no default value.
|
Option(String description,
ArgumentType argumentType,
DataType dataType,
char shortName,
String longName)
Create an Option with both short and long names, having no default value.
|
Option(String description,
ArgumentType argumentType,
DataType dataType,
char shortName,
String longName,
String defaultValue)
Create an Option with both short and long names of a given DataType
having a default value.
|
Option(String description,
ArgumentType argumentType,
DataType dataType,
String longName)
Create an Option with a long name, having no default value.
|
Option(String description,
char shortName)
Create a BOOLEAN Option with a short name, having no default value.
|
Option(String description,
char shortName,
String longName)
Create a BOOLEAN Option with both short and long names, having no default
value.
|
Option(String description,
char shortName,
String longName,
String defaultValue)
Create an Option with both short and long names of a given DataType
having a default value.
|
Option(String description,
String longName)
Create a BOOLEAN Option with a long name, having no default value.
|
Modifier and Type | Method and Description |
---|---|
ArgumentType |
getArgumentType()
The ArgumentType indicates this Option's ability to use a following
argument.
|
DataType |
getDataType() |
String |
getDefaultValue() |
String |
getDescription()
The description provides a brief explanation of the option.
|
String |
getLongName()
The long name of an Option is the single character by which this Option
is known.
|
char |
getShortName()
The short name of an Option is the single character by which this Option
is known.
|
private String description
private char shortName
private String longName
private DataType dataType
private ArgumentType argumentType
private String defaultValue
public Option(String description, char shortName)
description
- the descriptionshortName
- the short namepublic Option(String description, String longName)
description
- the descriptionlongName
- the long namepublic Option(String description, char shortName, String longName)
description
- the descriptionshortName
- the short namelongName
- the long namepublic Option(String description, char shortName, String longName, String defaultValue)
description
- the descriptionshortName
- the short namelongName
- the long namedefaultValue
- the default value for this Optionpublic Option(String description, ArgumentType argumentType, DataType dataType, char shortName)
description
- the descriptionargumentType
- the type of the argumentdataType
- the type of argument's datashortName
- the short namepublic Option(String description, ArgumentType argumentType, DataType dataType, String longName)
description
- the descriptionargumentType
- the type of the argumentdataType
- the type of argument's datalongName
- the long namepublic Option(String description, ArgumentType argumentType, DataType dataType, char shortName, String longName)
description
- the descriptionargumentType
- the type of the argumentdataType
- the type of argument's datashortName
- the short namelongName
- the long namepublic Option(String description, ArgumentType argumentType, DataType dataType, char shortName, String longName, String defaultValue)
description
- the descriptionargumentType
- the type of the argumentdataType
- the type of argument's datashortName
- the short namelongName
- the long namedefaultValue
- the default value for this Optionpublic String getDescription()
public char getShortName()
public String getLongName()
public ArgumentType getArgumentType()
public DataType getDataType()
public String getDefaultValue()