|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mckoi.util.CommandLine
public class CommandLine
Used to parse a command-line.
Constructor Summary | |
---|---|
CommandLine(java.lang.String[] args)
Constructs the command line parser from the String[] array passed as the argument to the application. |
Method Summary | |
---|---|
java.lang.String[] |
allSwitchesStartingWith(java.lang.String switch_str)
Returns a list of all switches on the command line that start with the given string. |
boolean |
containsSwitch(java.lang.String switch_str)
Returns true if the switch is in the command line. |
boolean |
containsSwitchFrom(java.lang.String switch_str)
Given a comma deliminated list, this scans for one of the switches in the list. |
boolean |
containsSwitchStart(java.lang.String switch_str)
Returns true if the command line contains a switch starting with the given string. |
java.lang.String |
switchArgument(java.lang.String switch_str)
Returns the contents of a switch variable if the switch is found on the command line. |
java.lang.String |
switchArgument(java.lang.String switch_str,
java.lang.String def)
Returns the contents of a switch variable if the switch is found on the command line. |
java.lang.String[] |
switchArguments(java.lang.String switch_str,
int arg_count)
Returns the contents of a set of arguments found after a switch on the command line. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CommandLine(java.lang.String[] args)
Method Detail |
---|
public boolean containsSwitch(java.lang.String switch_str)
public boolean containsSwitchFrom(java.lang.String switch_str)
public boolean containsSwitchStart(java.lang.String switch_str)
public java.lang.String[] allSwitchesStartingWith(java.lang.String switch_str)
public java.lang.String switchArgument(java.lang.String switch_str)
Returns 'null' if the argument was not found.
public java.lang.String switchArgument(java.lang.String switch_str, java.lang.String def)
Returns def if the argument was not found.
public java.lang.String[] switchArguments(java.lang.String switch_str, int arg_count)
Returns null if no match is found.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |