util
Class CommandLine
java.lang.Object
util.CommandLine
- public class CommandLine
- extends java.lang.Object
This simple helper class is used to test if a given argument exits from
a command line input, and what the value is for a given argument.
|
Method Summary |
static java.lang.String |
getArg(java.lang.String[] args,
java.lang.String arg,
java.lang.String def)
This method is used to get the value of an argument from the command
line. |
static boolean |
isArg(java.lang.String[] args,
char arg)
This method merely tests to see if an argument was given in a command
line input. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CommandLine
public CommandLine()
isArg
public static boolean isArg(java.lang.String[] args,
char arg)
- This method merely tests to see if an argument was given in a command
line input.
- Parameters:
args - The command line that contains input arguments.arg - The argument we are testing to see if exists.
- Returns:
- boolean True if the argument is in the given command line.
getArg
public static java.lang.String getArg(java.lang.String[] args,
java.lang.String arg,
java.lang.String def)
- This method is used to get the value of an argument from the command
line.
- Parameters:
args - The command line that contains input arguments.arg - The argument that we want the value of.def - The default value to return if the argument doesn't exist.
- Returns:
- String The value of the given argument.
© 2001-2005 University of Oregon.
Eugene OR 97403, U.S.A. All Rights Reserved.