Purple Code

com.purpletech.util
Class Options

java.lang.Object
  |
  +--java.util.Dictionary
        |
        +--java.util.Hashtable
              |
              +--java.util.Properties
                    |
                    +--com.purpletech.util.Options
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class Options
extends java.util.Properties

Parses command-line options.

 Command-line usage: java Options [properties.txt] -param [val] ...
   properties.txt - optional file in Properties format
   param - property name
   val - value for that property (set to null if not present)
 

Version:
VERSIONDATA
Author:
Alex
See Also:
Serialized Form

Field Summary
 boolean appendValues
          When we find a duplicate parameter name, should we append the new value to the old value, or just replace it? Default = false (replace).
protected  java.lang.String[] args
           
 
Fields inherited from class java.util.Properties
defaults
 
Constructor Summary
Options(java.util.Properties defaults, java.lang.String[] args)
           
Options(java.lang.String[] args)
           
Options(java.lang.String[][] defaults)
           
Options(java.lang.String[][] defaults, java.lang.String[] args)
           
 
Method Summary
protected  void add(java.lang.String name, java.lang.String valueNew)
           
 double getDouble(java.lang.String key)
           
 int getInt(java.lang.String key)
           
 java.lang.String getString(java.lang.String key)
           
static void main(java.lang.String[] args)
          The main method for running this class as a standalone application
 void parse()
           
static Options parse(java.lang.String[] args)
           
 void print(java.io.PrintStream out)
           
 
Methods inherited from class java.util.Properties
getProperty, getProperty, list, list, load, propertyNames, save, setProperty, store
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

args

protected java.lang.String[] args

appendValues

public boolean appendValues
When we find a duplicate parameter name, should we append the new value to the old value, or just replace it? Default = false (replace).

Constructor Detail

Options

public Options(java.util.Properties defaults,
               java.lang.String[] args)

Options

public Options(java.lang.String[][] defaults,
               java.lang.String[] args)

Options

public Options(java.lang.String[] args)

Options

public Options(java.lang.String[][] defaults)
Method Detail

parse

public static Options parse(java.lang.String[] args)

parse

public void parse()

add

protected void add(java.lang.String name,
                   java.lang.String valueNew)

print

public void print(java.io.PrintStream out)

getString

public java.lang.String getString(java.lang.String key)

getInt

public int getInt(java.lang.String key)

getDouble

public double getDouble(java.lang.String key)

main

public static void main(java.lang.String[] args)
The main method for running this class as a standalone application

Parameters:
args - The argument list sent to the program.

Documentation generated March 5 2003