toolbox.parsers
Class CommandLineParser

Package class diagram package CommandLineParser
java.lang.Object
  extended by toolbox.parsers.CommandLineParser

public class CommandLineParser
extends java.lang.Object

Simple command line parser.

This parser expects name value pairs separated by spaces.


Constructor Summary
CommandLineParser(java.lang.String[] args)
          Create a new parser with the given command line arguments.
 
Method Summary
 boolean argumentExists(java.lang.String name)
          Test whether an argument exists.
 java.lang.String getArgumentValue(java.lang.String name)
          Return the value of the named argument or null if the argument name does not exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandLineParser

public CommandLineParser(java.lang.String[] args)
Create a new parser with the given command line arguments.

Parameters:
args - String array containing command line arguments.
Method Detail

getArgumentValue

public java.lang.String getArgumentValue(java.lang.String name)
Return the value of the named argument or null if the argument name does not exists.

Parameters:
name - Argument name.
Returns:
String containing argument value.

argumentExists

public boolean argumentExists(java.lang.String name)
Test whether an argument exists.

Parameters:
name - Argument name.
Returns:
boolean indicating the existence of the argument.