public class JCLO extends Object
| Constructor and Description |
|---|
JCLO(Object object)
A constructor that takes the Object that contains the variables
acceptable on a command line.
|
JCLO(Object object,
String[][] aliases)
A constructor that takes the Object that contains the variables
acceptable on a command line.
|
JCLO(String prefix,
Object object)
A constructor that takes the Object that contains the variables
acceptable on a command line.
|
JCLO(String prefix,
Object object,
String[][] aliases)
A constructor that takes an Object, a prefix, and a boolean that
specifies whether to accept single or double dashes; call parse
(String) to do the actual parsing.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
getBoolean(String key)
Get a boolean value from the object after parsing.
|
byte |
getByte(String key)
Get a byte value from the object after parsing.
|
byte[] |
getBytes(String key)
Get an array of bytes from the object after parsing.
|
char |
getChar(String key)
Get a character value from the object after parsing.
|
char[] |
getChars(String key)
Get an array of characaters from the object after parsing.
|
double |
getDouble(String key)
Get a double value from the object after parsing.
|
double[] |
getDoubles(String key)
Get an array of doubles from the object after parsing.
|
float |
getFloat(String key)
Get a float value from the object after parsing.
|
float[] |
getFloats(String key)
Get an array of floats from the object after parsing.
|
int |
getInt(String key)
Get an integer value from the object after parsing.
|
int[] |
getInts(String key)
Get an array of integers from the object after parsing.
|
long |
getLong(String key)
Get a long value from the object after parsing.
|
long[] |
getLongs(String key)
Get an array of longs from the object after parsing.
|
short |
getShort(String key)
Get a short value from the object after parsing.
|
short[] |
getShorts(String key)
Get an array of shorts from the object after parsing.
|
String |
getString(String key)
Get a String from the object after parsing.
|
String[] |
getStrings(String key)
Get an array of Strings from the object after parsing.
|
Object |
getValue(String key)
Get the current value of the variable in the object
|
static void |
main(String[] args) |
void |
parse(String[] args)
Parse a command line.
|
String |
toString()
An external representation of the object
|
String |
usage()
Create and usage message for the acceptable command line variables.
|
public JCLO(Object object)
object - where the variables/arguments arepublic JCLO(Object object, String[][] aliases)
object - where the variables/arguments arealiases - if there are CLO aliasespublic JCLO(String prefix, Object object)
object - where the variables/arguments areprefix - if all CLO variables start with a prefixpublic JCLO(String prefix, Object object, String[][] aliases)
object - where the variables/arguments areprefix - the String CLO's start with, if anyaliases - if there are CLO aliasespublic Object getValue(String key)
key - the variable namepublic String toString()
public String usage()
public void parse(String[] args)
args - the arguments to be parsedpublic boolean getBoolean(String key)
key - The name of the option.public byte getByte(String key)
key - The name of the option.public char getChar(String key)
key - The name of the option.public short getShort(String key)
key - The name of the option.public int getInt(String key)
key - The name of the option.public float getFloat(String key)
key - The name of the option.public double getDouble(String key)
key - The name of the option.public long getLong(String key)
key - The name of the option.public String getString(String key)
key - The name of the option.public byte[] getBytes(String key)
key - The name of the option.public char[] getChars(String key)
key - The name of the option.public short[] getShorts(String key)
key - The name of the option.public int[] getInts(String key)
key - The name of the option.public float[] getFloats(String key)
key - The name of the option.public double[] getDoubles(String key)
key - The name of the option.public long[] getLongs(String key)
key - The name of the option.public String[] getStrings(String key)
key - The name of the option.public static void main(String[] args) throws IOException
IOExceptionCopyright © 2017. All rights reserved.