|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--adavid.util.CommandSorter
Constructor Summary | |
CommandSorter(java.lang.String[] args)
default constructor: the prefixes are "-+" |
|
CommandSorter(java.lang.String[] args,
java.lang.String option)
constructor: just take and store the command line, and the option prefix definition |
Method Summary | |
java.lang.String[] |
getAllArgs()
returns all arguments which are not options |
java.lang.String[] |
getAllOptions()
returns all options found |
java.lang.String |
getArg(java.lang.String opt)
returns the argument of an option: null if the option was not found, "" if no argument, "...something" if the argument is found the option should be complete, for example: "-o" for the option -o |
java.lang.String[] |
getArgs()
returns the arguments which are not arguments of an option |
java.lang.String[] |
getArgsAfter(java.lang.String opt)
returns all arguments after a given option |
java.lang.String |
getDefinition(java.lang.String option)
returns the definition of an option: -option=something : getDefinition("-option") returns "something" returns null if the option is not defined and "" if the definition string is empty -option = something ; -option= something ; -option =something are not recognized |
boolean |
isDefined(java.lang.String arg)
returns true if the argument is defined options of the form -blabla=something are not counted |
boolean |
isOption(java.lang.String string)
returns true if the string "string" begins with one of the characters in option, i.e. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public CommandSorter(java.lang.String[] args, java.lang.String option)
public CommandSorter(java.lang.String[] args)
Method Detail |
public boolean isOption(java.lang.String string)
public java.lang.String[] getArgs()
public java.lang.String[] getAllArgs()
public java.lang.String[] getAllOptions()
public boolean isDefined(java.lang.String arg)
public java.lang.String getArg(java.lang.String opt)
public java.lang.String[] getArgsAfter(java.lang.String opt)
public java.lang.String getDefinition(java.lang.String option)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |