public class CommandLineOption
extends java.lang.Object
implements java.io.Serializable
CommandLineOptions are those parts of a command line with dashes ("-") prefixing them. They are usually optional (hence the name) and specify various modifiers and such for the command line program.
For our purposes, all CommandLineOptions can be specified two ways: as a brief, single character prefixed by a single dash ("-f"), or as a long, more meaningful word prefixed by two dashes ("--filename").
Some options are switches, and need no arguments. If present, they are on; if not they are off. Others have one or more arguments. These are listed after the option identifier.
| Constructor and Description |
|---|
CommandLineOption() |
CommandLineOption(java.lang.String shortName,
java.lang.String longName,
java.lang.String description)
Constructs a switch option (no arguments)
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getDefaultValue() |
java.lang.String |
getDescription() |
java.lang.String |
getLongName() |
java.lang.String |
getShortName() |
boolean |
isSwitch() |
void |
setDefaultValue(java.lang.String newDefaultValue) |
void |
setDescription(java.lang.String newDescription) |
void |
setLongName(java.lang.String newLongName) |
void |
setShortName(java.lang.String newShortName) |
void |
setSwitch(boolean newSwitch) |
java.lang.String |
toString() |
public CommandLineOption()
public CommandLineOption(java.lang.String shortName,
java.lang.String longName,
java.lang.String description)
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getShortName()
public void setShortName(java.lang.String newShortName)
public java.lang.String getLongName()
public void setLongName(java.lang.String newLongName)
public java.lang.String getDescription()
public void setDescription(java.lang.String newDescription)
public boolean isSwitch()
public void setSwitch(boolean newSwitch)
public java.lang.String getDefaultValue()
public void setDefaultValue(java.lang.String newDefaultValue)