|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.xenqtt.ApplicationArguments
public final class ApplicationArguments
Supplies arguments and flags for the disparate modes available in Xenqtt.
Constructor Summary | |
---|---|
ApplicationArguments()
Create a new instance of this class. |
|
ApplicationArguments(List<String> flags,
Map<String,String> arguments)
Create a new instance of this class. |
Method Summary | |
---|---|
boolean |
getArgAsBoolean(String argument)
Get an argument value interpreted as a boolean . |
boolean |
getArgAsBoolean(String argument,
boolean defaultValue)
Get an argument value interpreted as a boolean . |
double |
getArgAsDouble(String argument)
Get an argument value interpreted as a double . |
double |
getArgAsDouble(String argument,
double defaultValue)
Get an argument value interpreted as a double . |
int |
getArgAsInt(String argument)
Get an argument value interpreted as an int . |
int |
getArgAsInt(String argument,
int defaultValue)
Get an argument value interpreted as an int . |
long |
getArgAsLong(String argument)
Get an argument value interpreted as a long . |
long |
getArgAsLong(String argument,
long defaultValue)
Get an argument value interpreted as a long . |
String |
getArgAsString(String argument)
Get an argument value interpreted as a string . |
String |
getArgAsString(String argument,
String defaultValue)
Get an argument value interpreted as a string . |
boolean |
isEmpty()
|
boolean |
isFlagSpecified(String flag)
Determine if a particular flag was specified. |
boolean |
wereAllFlagsInterrogated()
Determine if each of the flags that was specified by the user was interrogated by the application. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ApplicationArguments()
public ApplicationArguments(List<String> flags, Map<String,String> arguments)
flags
- The flags that were specified for the applicationarguments
- The arguments that were specified for the applicationMethod Detail |
---|
public boolean isFlagSpecified(String flag)
flag
- The flag to check for
true
if the specified flag
was found in the flags that were given by the user, false
if it was notpublic boolean wereAllFlagsInterrogated()
true
if each user-specified flag was interrogated, false
if at least one was notpublic int getArgAsInt(String argument)
int
.
argument
- The name of the argument
int
IllegalStateException
- If the argument is not found
NumberFormatException
- If the argument is found but cannot be interpreted as an int
public int getArgAsInt(String argument, int defaultValue)
int
.
argument
- The name of the argumentdefaultValue
- The default value to use if the argument is not found
int
NumberFormatException
- If the argument is found but cannot be interpreted as an int
public long getArgAsLong(String argument)
long
.
argument
- The name of the argument
long
IllegalStateException
- If the argument is not found
NumberFormatException
- If the argument is found but cannot be interpreted as a long
public long getArgAsLong(String argument, long defaultValue)
long
.
argument
- The name of the argumentdefaultValue
- The default value to use if the argument is not found
long
NumberFormatException
- If the argument is found but cannot be interpreted as a long
public double getArgAsDouble(String argument)
double
.
argument
- The name of the argument
double
IllegalStateException
- If the argument is not found
NumberFormatException
- If the argument is found but cannot be interpreted as a double
public double getArgAsDouble(String argument, double defaultValue)
double
.
argument
- The name of the argumentdefaultValue
- The default value to use if the argument is not found
double
NumberFormatException
- If the argument is found but cannot be interpreted as a double
public boolean getArgAsBoolean(String argument)
boolean
.
argument
- The name of the argument
boolean
IllegalStateException
- If the argument is not found
NumberFormatException
- If the argument is found but cannot be interpreted as a boolean
public boolean getArgAsBoolean(String argument, boolean defaultValue)
boolean
.
argument
- The name of the argumentdefaultValue
- The default value to use if the argument is not found
boolean
NumberFormatException
- If the argument is found but cannot be interpreted as a boolean
public String getArgAsString(String argument)
string
.
argument
- The name of the argument
IllegalStateException
- If the argument is not foundpublic String getArgAsString(String argument, String defaultValue)
string
.
argument
- The name of the argumentdefaultValue
- The default value to use if the argument is not found
public boolean isEmpty()
true
if there are no flags or arguments, false
if there is at least one flag or argument
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |