|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.rice.cs.plt.text.ArgumentParser.Result
public static class ArgumentParser.Result
A collection of the options and parameters parsed from an array of arguments.
Constructor Summary | |
---|---|
ArgumentParser.Result(Map<String,Iterable<String>> options,
Iterable<String> params)
|
Method Summary | |
---|---|
Pair<String,String> |
getBinaryOption(String opt)
Get the 2 arguments associated with the given option, or null if it is undefined
or has a different number of arguments. |
Iterable<String> |
getOption(String opt)
Get the arguments associated with the given option, or null if it is undefined. |
Quad<String,String,String,String> |
getQuaternaryOption(String opt)
Get the 4 arguments associated with the given option, or null if it is undefined
or has a different number of arguments. |
Triple<String,String,String> |
getTernaryOption(String opt)
Get the 3 arguments associated with the given option, or null if it is undefined
or has a different number of arguments. |
String |
getUnaryOption(String opt)
Get the single argument associated with the given option, or null if it is undefined
or has a different number of arguments. |
boolean |
hasNullaryOption(String opt)
Test whether the given option was defined with 0 arguments. |
boolean |
hasOption(String opt)
Test whether the given option was defined (or was given a default value). |
Iterable<String> |
params()
Get the parameters (non-option strings associated with no option) that were parsed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ArgumentParser.Result(Map<String,Iterable<String>> options, Iterable<String> params)
Method Detail |
---|
public Iterable<String> params()
public boolean hasOption(String opt)
public Iterable<String> getOption(String opt)
null
if it is undefined.
opt
- The option name, excluding the "-" prefix.public boolean hasNullaryOption(String opt)
opt
- The option name, excluding the "-" prefix.public String getUnaryOption(String opt)
null
if it is undefined
or has a different number of arguments.
opt
- The option name, excluding the "-" prefix.public Pair<String,String> getBinaryOption(String opt)
null
if it is undefined
or has a different number of arguments.
opt
- The option name, excluding the "-" prefix.public Triple<String,String,String> getTernaryOption(String opt)
null
if it is undefined
or has a different number of arguments.
opt
- The option name, excluding the "-" prefix.public Quad<String,String,String,String> getQuaternaryOption(String opt)
null
if it is undefined
or has a different number of arguments.
opt
- The option name, excluding the "-" prefix.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |