public class SimpleSwitch extends AbstractSwitch
description, longForm, shortForm| Constructor and Description |
|---|
SimpleSwitch(java.lang.Character shortForm,
java.lang.String longForm,
java.lang.String description)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
found(char shortSwitch)
This switch appears in the command line in the given short form.
|
void |
found(java.lang.String longSwitch)
This switch appears in the command line in the given long form.
|
java.lang.String |
getAppearance()
Get the appearance of this switch or argument on the command line.
|
boolean |
hasAppeared()
Has the switch appeared on the command line?
|
boolean |
isVarLength()
Does this argument or switch have a variable length?
|
void |
setAppeared(boolean appeared)
Set whether this switch has appeared.
|
getDescription, getLongForms, getShortFormsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconsumeArgument, isOptional, isSwitch, needsArgumentspublic boolean isVarLength()
SwitchOrArgumenttrue: this argument or switch consumes the remaining items in the command linefalse: this argument or switch just consumes 1 item (for arguments) or 2 items (for switches) from the command line@NotNull public java.lang.String getAppearance()
SwitchOrArgumentpublic void found(char shortSwitch)
SwitchshortSwitch - short form in which this switch appearedpublic void found(@NotNull java.lang.String longSwitch)
SwitchlongSwitch - long formpublic boolean hasAppeared()
true: the switch was included on the command linefalse: the switch was not found on the command linepublic void setAppeared(boolean appeared)
found()
methods.appeared - true: the switch was included on the command linefalse: the switch was not found on the command line