cds.util
Class Args

java.lang.Object
  extended bycds.util.Args

public class Args
extends java.lang.Object


Field Summary
(package private)  OptionList olist
           
(package private)  ParamList plist
           
 
Constructor Summary
Args(java.lang.String[] argv)
          Constructor.
 
Method Summary
 java.lang.String getValue(java.lang.String name)
          Returns the value of a parameter
 boolean isOption(char c)
          Checks if an options exists or not
static void main(java.lang.String[] args)
          Test programme.
 char nextOption()
          Returns the next option
 java.lang.String nextParam()
          Returns the next parameter (its name)
 boolean paramExists(java.lang.String name)
          Checks weather a specific parameter exists
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

plist

ParamList plist

olist

OptionList olist
Constructor Detail

Args

public Args(java.lang.String[] argv)
Constructor. Builds the array of options, and the List of parameters

Parameters:
argv - Command line parameters array
Method Detail

isOption

public boolean isOption(char c)
Checks if an options exists or not

Parameters:
c - option character
Returns:
true or false whether the option exists or not

nextOption

public char nextOption()
Returns the next option

Returns:
the option char (a-zA-Z0-9), or '\0' if finished

paramExists

public boolean paramExists(java.lang.String name)
Checks weather a specific parameter exists

Parameters:
name - name of the checked parameter
Returns:
true if the parameter exists

getValue

public java.lang.String getValue(java.lang.String name)
Returns the value of a parameter

Parameters:
name - name of the requested parameter
Returns:
the parameter value (or null, either if the parameter doesn't exist (see paramExists()), either if the parameter has no value

nextParam

public java.lang.String nextParam()
Returns the next parameter (its name)

Returns:
the parameter name, or null if all parameters have been read

main

public static void main(java.lang.String[] args)
Test programme. Everything can be written. Options f & g are associated with two first parameters. Other parameters are listed with their possible value.

Parameters:
args - main method command line arguments