|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object kylm.util.KylmConfigUtils
public class KylmConfigUtils
A class to handle configuration of executable files
Field Summary | |
---|---|
static int |
BOOLEAN_TYPE
|
static int |
FLOAT_TYPE
|
static int |
INT_ARRAY_TYPE
|
static int |
INT_TYPE
|
static int |
STRING_ARRAY_TYPE
|
static int |
STRING_TYPE
|
Constructor Summary | |
---|---|
KylmConfigUtils()
Initialize the class with no usage data to print |
|
KylmConfigUtils(java.lang.String usage)
Initialize the configuration utilities with usage text to print in case |
Method Summary | |
---|---|
void |
addAlias(java.lang.String name,
java.lang.String alias)
Add an alias that points from the long name of a parameter to the short name. |
void |
addEntry(java.lang.String string)
Add a boolean entry to the configuration possibilities |
void |
addEntry(java.lang.String name,
int type,
java.lang.Object defaultVal)
Add an entry to the configuration possibilities |
void |
addEntry(java.lang.String name,
int type,
java.lang.Object defaultVal,
boolean req,
java.lang.String desc)
Add an entry to the configuration possibilities |
void |
addGroup(java.lang.String string)
|
void |
exitOnUsage()
Exit, printing the usage text. |
void |
exitOnUsage(int code)
Exit, printing the usage text |
java.lang.String[] |
getArguments()
Get the arguments that are not correlated with a flag |
boolean |
getBoolean(java.lang.String string)
|
float |
getFloat(java.lang.String string)
|
int |
getInt(java.lang.String string)
|
int[] |
getIntArray(java.lang.String string)
|
java.lang.String |
getString(java.lang.String string)
|
java.lang.String[] |
getStringArray(java.lang.String string)
|
java.lang.String |
getUsage()
Get the usage text |
java.lang.Object |
getValue(java.lang.String str)
Get the value assigned to a certain string ID |
java.lang.String[] |
parseArguments(java.lang.String[] args)
Parse command line arguments |
void |
setUsage(java.lang.String usageText)
Set the usage text |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int STRING_TYPE
public static final int INT_TYPE
public static final int FLOAT_TYPE
public static final int BOOLEAN_TYPE
public static final int STRING_ARRAY_TYPE
public static final int INT_ARRAY_TYPE
Constructor Detail |
---|
public KylmConfigUtils()
public KylmConfigUtils(java.lang.String usage)
usage
- The usage textMethod Detail |
---|
public void addEntry(java.lang.String name, int type, java.lang.Object defaultVal, boolean req, java.lang.String desc)
name
- The name of the entry to be addedtype
- The type, string, float, integer, booleandefaultVal
- The default valuereq
- Whether this is required or notdesc
- The description of the parameterpublic void addEntry(java.lang.String name, int type, java.lang.Object defaultVal)
name
- The name of the entry to be addedtype
- The type, string, float, integer, booleandefaultVal
- The default valuepublic void addEntry(java.lang.String string)
string
- The name of the entry to be addedpublic void addAlias(java.lang.String name, java.lang.String alias)
name
- The long name of the parameteralias
- The short namepublic java.lang.String[] parseArguments(java.lang.String[] args)
args
- The command line arguments to parsepublic java.lang.Object getValue(java.lang.String str)
str
- The string Id of the value
public java.lang.String getUsage()
public void setUsage(java.lang.String usageText)
usageText
- The usage text to be printed on -helppublic java.lang.String[] getArguments()
public boolean getBoolean(java.lang.String string)
public java.lang.String getString(java.lang.String string)
public java.lang.String[] getStringArray(java.lang.String string)
public int getInt(java.lang.String string)
public float getFloat(java.lang.String string)
public void exitOnUsage()
public void exitOnUsage(int code)
code
- The error code to exit withpublic int[] getIntArray(java.lang.String string)
public void addGroup(java.lang.String string)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |