|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjoptsimple.OptionSet
public class OptionSet
Representation of a group of detected command line options, their arguments, and non-option arguments.
Field Summary | |
---|---|
private java.util.Map |
detectedOptions
|
private java.util.List |
nonOptionArguments
|
Constructor Summary | |
---|---|
OptionSet()
|
Method Summary | |
---|---|
(package private) void |
add(java.lang.String option)
|
(package private) void |
addAll(java.util.List options)
|
(package private) void |
addAllWithArgument(java.util.List options,
java.lang.Object argument)
|
(package private) void |
addNonOptionArgument(java.lang.String argument)
|
(package private) void |
addWithArgument(java.lang.String option,
java.lang.Object argument)
|
java.lang.String |
argumentOf(java.lang.String option)
Gives the argument associated with the given option. |
java.util.List |
argumentsOf(java.lang.String option)
Gives any arguments associated with the given option. |
boolean |
equals(java.lang.Object that)
|
boolean |
has(java.lang.String option)
Tells whether the given option was detected. |
boolean |
hasArgument(java.lang.String option)
Tells whether there are any arguments associated with the given option. |
int |
hashCode()
|
java.util.List |
nonOptionArguments()
Gives the detected non-option arguments. |
java.lang.Object |
valueOf(java.lang.String option)
Gives the argument associated with the given option. |
java.util.List |
valuesOf(java.lang.String option)
Gives any arguments associated with the given option. |
boolean |
wasDetected(java.lang.String option)
Deprecated. Use has instead. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final java.util.Map detectedOptions
private final java.util.List nonOptionArguments
Constructor Detail |
---|
OptionSet()
Method Detail |
---|
public boolean wasDetected(java.lang.String option)
has
instead.
Tells whether the given option was detected.
option
- the option to search for
true
if the option was detectedpublic boolean has(java.lang.String option)
Tells whether the given option was detected.
option
- the option to search for
true
if the option was detectedpublic boolean hasArgument(java.lang.String option)
Tells whether there are any arguments associated with the given option.
option
- the option to search for
true
if the option was detected and at least one argument was
detected for the optionpublic java.lang.String argumentOf(java.lang.String option)
Gives the argument associated with the given option.
option
- the option to search for
String
; null
if
no argument is present, or that option was not detected
OptionException
- if more than one argument was detected for the option
java.lang.ClassCastException
- if the argument was given a type other than
String
valueOf(String)
public java.util.List argumentsOf(java.lang.String option)
Gives any arguments associated with the given option.
option
- the option to search for
valuesOf(String)
public java.lang.Object valueOf(java.lang.String option)
Gives the argument associated with the given option. If the argument was
given a type, it will take on that type; otherwise, use argumentOf
to get the argument as a String
.
option
- the option to search for
null
if no argument is
present, or that option was not detected
OptionException
- if more than one argument was detected for the optionpublic java.util.List valuesOf(java.lang.String option)
Gives any arguments associated with the given option.
option
- the option to search for
public java.util.List nonOptionArguments()
Gives the detected non-option arguments.
String
s.public boolean equals(java.lang.Object that)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
void add(java.lang.String option)
void addWithArgument(java.lang.String option, java.lang.Object argument)
void addNonOptionArgument(java.lang.String argument)
void addAll(java.util.List options)
void addAllWithArgument(java.util.List options, java.lang.Object argument)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |