iitb.Utils
Class Options
java.lang.Object
java.util.Dictionary
java.util.Hashtable
java.util.Properties
iitb.Utils.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
Constructor Summary |
Options()
|
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 |
void |
add(int startIndex,
java.lang.String[] args)
|
double |
getDouble(java.lang.String key)
|
double |
getDoubleLoose(java.lang.String key)
|
int |
getInt(java.lang.String key)
|
int |
getIntLoose(java.lang.String key)
|
java.lang.String |
getMandatoryProperty(java.lang.String name)
|
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()
|
void |
parse(int startIndex)
|
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, remove, size, toString, values |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
appendValues
public boolean appendValues
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()
Options
public Options(java.lang.String[][] defaults)
parse
public static Options parse(java.lang.String[] args)
parse
public void parse()
parse
public void parse(int startIndex)
add
public void add(int startIndex,
java.lang.String[] args)
print
public void print(java.io.PrintStream out)
getString
public java.lang.String getString(java.lang.String key)
getIntLoose
public int getIntLoose(java.lang.String key)
getDoubleLoose
public double getDoubleLoose(java.lang.String key)
getInt
public int getInt(java.lang.String key)
throws ConfigException
- Throws:
ConfigException
getDouble
public double getDouble(java.lang.String key)
throws ConfigException
- Throws:
ConfigException
getMandatoryProperty
public java.lang.String getMandatoryProperty(java.lang.String name)
throws ConfigException
- Throws:
ConfigException
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.
Submit a bug or feature.