de.pado.dv
Class CommandLineMap

java.lang.Object
  extended by de.pado.dv.CommandLineMap
Direct Known Subclasses:
DVCommandLineMap

public class CommandLineMap
extends java.lang.Object

CommandLineMap is provides a simple interface to command line parameters (unary) and options (nullary).


Constructor Summary
CommandLineMap(java.lang.String[] args, java.util.List knownArgs)
          CommandLineMap is initialized with actual command line arguments (args) and the set of known parameters options (knownArgs) specified as an array of Strings.
 
Method Summary
 boolean exists(java.lang.String key)
          tests whether a particular command line argument exists
 java.lang.String get(java.lang.String key)
          returns the value of a particular command line argument key.
 boolean isOption(java.lang.String key)
          tests whether a particular command line argument is an option.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandLineMap

public CommandLineMap(java.lang.String[] args,
                      java.util.List knownArgs)
CommandLineMap is initialized with actual command line arguments (args) and the set of known parameters options (knownArgs) specified as an array of Strings. CommandLineMap assumes a "long GNU" style for parameters, i.e. "--key value" for parameters and "--option" for options.

Method Detail

exists

public boolean exists(java.lang.String key)
tests whether a particular command line argument exists


isOption

public boolean isOption(java.lang.String key)
tests whether a particular command line argument is an option. Will throw a ClassCastException if the key does not exist.


get

public java.lang.String get(java.lang.String key)
returns the value of a particular command line argument key. Returns null if the key is an option. Will throw a ClassCastException if the key does not exist.