talx x1.0.5

util
Class CommandLine

java.lang.Object
  extended byutil.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.


Constructor Summary
CommandLine()
           
 
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
 

Constructor Detail

CommandLine

public CommandLine()
Method Detail

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.

talx x1.0.5

© 2001-2005 University of Oregon.
Eugene OR 97403, U.S.A. All Rights Reserved.