|
ANTS v2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ants.util.KeyArgs
Keyword argument manipulation utilities. These are used for handling command line arguments. The key is any string beginning with a "-"; the argument associated with the key can be any string.
WARNING: Do not try to pass an argument value of "-1" to these routines. It will be recognized as a key, not an argument. (Any negative number will do that, of course.)
XXX fix the above, somehow.
Constructor Summary | |
KeyArgs()
|
|
KeyArgs(java.lang.String[] ka)
|
|
KeyArgs(java.lang.String[] ka,
int skip)
|
Method Summary | |
java.lang.String |
arg(int i)
Return the i'th argument. |
void |
compact()
Compact the list of key/arg pairs. |
java.lang.String |
get(java.lang.String key)
Find the arg associated with the given key. |
java.lang.String |
key(int i)
Return the i'th key. |
int |
length()
Return the number of key/arg pairs. |
void |
merge(KeyArgs k)
Merge the given set of KeyArgs into the current list. |
void |
merge(java.lang.String[] ka)
Merge the given array of strings into the key/arg list. |
void |
merge(java.lang.String[] ka,
int skip)
Merge the given array of strings into the key/arg list. |
void |
noMore()
A handy routine for debugging. |
void |
set(java.lang.String key,
java.lang.String arg)
Set the arg for key. |
void |
strike(int i)
Strike the i'th key/arg pair from the list. |
java.lang.String |
toString()
Generate a nice, readable string representation of the key/arg pairs. |
java.lang.String[] |
toStrings()
Generate an array of Strings, one for each Key/Arg pair. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public KeyArgs(java.lang.String[] ka) throws InvalidKeyArgsException
public KeyArgs() throws InvalidKeyArgsException
public KeyArgs(java.lang.String[] ka, int skip) throws InvalidKeyArgsException
Method Detail |
public int length()
public java.lang.String key(int i)
public java.lang.String arg(int i)
public java.lang.String get(java.lang.String key)
public void set(java.lang.String key, java.lang.String arg)
public void strike(int i)
public void compact()
public void merge(java.lang.String[] ka) throws InvalidKeyArgsException
public void merge(java.lang.String[] ka, int skip) throws InvalidKeyArgsException
skip
entries in the string array
are skipped.public void merge(KeyArgs k)
k
are thrown away.public java.lang.String toString()
public java.lang.String[] toStrings()
public void noMore()
|
ANTS v2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |