org.avis.util
Class CommandLine

java.lang.Object
  extended by org.avis.util.CommandLine

public final class CommandLine
extends Object

General command line utilities.

Author:
Matthew Phillips

Method Summary
static int intArg(String[] args, int arg)
          Get an integer argument from a given index, throwing a descriptive exception if the argument is missing or not a number.
static String stringArg(String[] args, int arg)
          Get a string argument from a given index, throwing a descriptive exception if the argument is missing.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

stringArg

public static String stringArg(String[] args,
                               int arg)
Get a string argument from a given index, throwing a descriptive exception if the argument is missing.

Parameters:
args - The command line arguments.
arg - The argument index to retrieve.
Returns:
The argument at arg.
Throws:
IllegalCommandLineOption - if arg does not exist.

intArg

public static int intArg(String[] args,
                         int arg)
Get an integer argument from a given index, throwing a descriptive exception if the argument is missing or not a number.

Parameters:
args - The command line arguments.
arg - The argument index to retrieve.
Returns:
The argument at arg.
Throws:
IllegalCommandLineOption - if arg does not exist or is not a number.


Copyright © 2008 Matthew Phillips. All Rights Reserved.