public class ParameterDatabase extends Object implements Serializable
This extension of the Properties class allows you to set, get, and delete Parameters in a hierarchical tree-like database. The database consists of a list of Parameters, plus an array of "parent databases" which it falls back on when it can't find the Parameter you're looking for. Parents may also have arrays of parents, and so on..
The parameters are loaded from a Java property-list file, which is basically a collection of parameter=value pairs, one per line. Empty lines and lines beginning with # are ignored. These parameters and their values are case-sensitive , and whitespace is trimmed I believe.
An optional set of parameters, "parent. n ", where n are consecutive integers starting at 0, define the filenames of the database's parents.
An optional set of parameters, "print-params", specifies whether or not parameters should be printed as they are used (through one of the get(...) methods). If print-params is unset, or set to false or FALSE, nothing is printed. If set to non-false, then the parameters are printed prepended with a "P:" when their values are requested, "E:" when their existence is tested. Prior to the "P:" or "E:" you may see a "!" (meaning that the parameter isn't in the database), or a "<" (meaning that the parameter was a default parameter which was never looked up because the primary parameter contained the value).
When you create a ParameterDatabase using new ParameterDatabase(), it is created thus:
DATABASE: | database |
FROM: | (empty) |
When you create a ParameterDatabase using new ParameterDatabase( file ), it is created by loading the database file, and its parent file tree, thus:
DATABASE: | database | -> | parent0 | +-> | parent0 | +-> | parent0 | +-> | .... |
FROM: | (empty) | (file) | | | (parent.0) | | | (parent.0) | .... | ||
| | +-> | parent1 | +-> | .... | |||||
| | | | (parent.1) | |||||||
| | .... | ||||||||
| | |||||||||
+-> | parent1 | +-> | .... | ||||||
| | (parent.1) | ||||||||
.... |
When you create a ParameterDatabase using new ParameterDatabase( file,argv ), the preferred way, it is created thus:
DATABASE: | database | -> | parent0 | +-> | parent0 | +-> | parent0 | +-> | parent0 | +-> | .... |
FROM: | (empty) | (argv) | (file) | | | (parent.0) | | | (parent.0) | .... | |||
| | +-> | parent1 | +-> | .... | |||||||
| | | | (parent.1) | |||||||||
| | .... | ||||||||||
| | |||||||||||
+-> | parent1 | +-> | .... | ||||||||
| | (parent.1) | ||||||||||
.... |
...that is, the actual top database is empty, and stores parameters added programmatically; its parent is a database formed from arguments passed in on the command line; its parent is the parameter database which actually loads from foo. This allows you to programmatically add parameters which override those in foo, then delete them, thus bringing foo's parameters back in view.
Once a parameter database is loaded, you query it with the get methods. The database, then its parents, are searched until a match is found for your parameter. The search rules are thus: (1) the root database is searched first. (2) If a database being searched doesn't contain the data, it searches its parents recursively, starting with parent 0, then moving up, until all searches are exhausted or something was found. (3) No database is searched twice.
The various get methods all take two parameters. The first parameter is fetched and retrieved first. If that fails, the second one (known as the default parameter) is fetched and retrieved. You can pass in null for the default parameter if you don't have one.
You can test a parameter for existence with the exists methods.
You can set a parameter (in the topmost database only with the set command. The remove command removes a parameter from the topmost database only. The removeDeeply command removes that parameter from every database.
The values stored in a parameter database must not contain "#", "=", non-ascii values, or whitespace.
The get... methods can also handle special macro parameters. Macro parameter names will end in default or alias, which means you cannot have any parameter names which end with these two words. The idea behind a macro parameter is that it can substitute one substring for another among your parameter names, making your parameters potentially much simpler. Macros work along period boundaries.
The alias parameter macro works as follows. A parameter entry of the form:
hello.there.alias = foo
Means that parameters which start with hello.there should have the hello.there portion replace with foo. Thus
hello.there.mom.how.are.you
... becomes ...
foo.mom.how.are.you
and
hello.there
... becomes ...
foo
but hello.thereyo is unchanged, and yohello.there.how.are.you is unchanged.
Furthermore if you already have a parameter entered for a given name, it takes precedence over a macro, and more specific macros take precedence over more general ones. Thus imagine you have a.b.alias = quux. Now when you query a.b.c.d this will get converted to quux.c.d and that parameter will get looked up instead. If you also had a.b.c.alias = bar, when when you query a.b.c.d, this takes precedence, so now it'll get converted to bar.d and that'll get looked up. Finally, if you had a.b.c.d = foo, when querying a.b.c.d will simply result in foo. Additionally there is the default macro. This works just like the alias macro except that it allows anything to be in the last parameter position prior to the default. That is:
hello.there.default = foo
Means that parameters which start with hello.* , where "*" can be any single parameter element, will have that portion replaced with foo. Thus
hello.there.mom.how.are.you
... becomes ...
foo.mom.how.are.you
and
hello.yo.whatever
... becomes ...
foo.whatever
and
hello.blah
... becomes ...
foo This second macro is particularly useful for replacing groups of parameters which differ based on some number.
Modifier and Type | Field and Description |
---|---|
(package private) Hashtable |
accessed |
(package private) static int |
ARRAY_NO_EXPECTED_LENGTH |
static String |
C_CLASS |
static String |
C_HERE |
(package private) boolean |
checked |
(package private) File |
directory |
(package private) Hashtable |
gotten |
(package private) String |
label |
(package private) Vector |
parents |
static String |
PRINT_PARAMS |
int |
printState |
(package private) Properties |
properties |
static int |
PS_NONE |
static int |
PS_PRINT_PARAMS |
static int |
PS_UNKNOWN |
(package private) Class |
relativeClass |
(package private) String |
relativePath |
static String |
UNKNOWN_VALUE |
static String |
V_ALIAS |
static String |
V_DEFAULT |
Constructor and Description |
---|
ParameterDatabase()
Creates an empty parameter database.
|
ParameterDatabase(Dictionary map)
Creates a new parameter database from the given Dictionary.
|
ParameterDatabase(File file)
Creates a new parameter database tree from a given database file and its
parent files.
|
ParameterDatabase(File file,
String[] args)
Creates a new parameter database from a given database file and argv
list.
|
ParameterDatabase(InputStream stream)
Creates a new parameter database loaded from the given stream.
|
ParameterDatabase(String pathNameRelativeToClassFile,
Class cls)
Creates a new parameter database loaded from a parameter file located relative to a class file,
wherever the class file may be (such as in a jar).
|
ParameterDatabase(String pathNameRelativeToClassFile,
Class cls,
String[] args)
Creates a new parameter database from a given database file and argv
list.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
_addNodeForParameter(DefaultTreeModel model,
DefaultMutableTreeNode root,
String key) |
(package private) void |
_buildTreeModel(DefaultTreeModel model,
DefaultMutableTreeNode root) |
(package private) File |
_directoryFor(Parameter parameter)
Private helper function
|
(package private) boolean |
_exists(Parameter parameter) |
(package private) String |
_getInner(String parameter,
HashSet set)
Private helper function
|
(package private) ParameterDatabase |
_getLocation(String parameter)
Private helper function
|
(package private) String |
_getParam(String parameter) |
(package private) String |
_getRecursive(String parameter)
Private helper function
|
(package private) Set |
_getShadowedValues(Parameter parameter,
Set vals) |
(package private) void |
_list(PrintWriter p,
boolean listShadowed,
String prefix,
Hashtable gather)
Private helper function.
|
(package private) void |
_removeDeeply(Parameter parameter)
Private helper function
|
void |
addParent(ParameterDatabase database) |
TreeModel |
buildTreeModel()
Builds a TreeModel from the available property keys.
|
(package private) double[] |
collapseBag(double[] bag,
int size) |
(package private) static String |
concatenatedJarPath(URL original,
String path) |
(package private) static URL |
concatenatedJarResource(URL original,
String path) |
(package private) int |
countDelimiters(String parameter) |
(package private) static URL |
defaultResourceURL(Class cls) |
(package private) File |
directoryFor(Parameter parameter)
Searches down through databases to find the directory for the database
which holds a given parameter.
|
boolean |
exists(Parameter parameter)
Deprecated.
use exists(Parameter, null)
|
boolean |
exists(Parameter parameter,
Parameter defaultParameter)
Returns true if either parameter or defaultParameter exists in the
database
|
(package private) double[] |
extendBag(double[] bag) |
(package private) boolean |
getBoolean(Parameter parameter,
boolean defaultValue)
Searches down through databases to find a given parameter; If the
parameter does not exist, defaultValue is returned.
|
boolean |
getBoolean(Parameter parameter,
Parameter defaultParameter,
boolean defaultValue)
Searches down through databases to find a given parameter; If the
parameter does not exist, defaultValue is returned.
|
Class |
getClassForParameter(Parameter parameter,
Parameter defaultParameter,
Class mustCastTosuperclass)
Searches down through databases to find a given parameter.
|
(package private) double |
getDouble(Parameter parameter) |
(package private) double |
getDouble(Parameter parameter,
double minValue)
Searches down through databases to find a given parameter, whose value
must be a double >= minValue.
|
(package private) double |
getDouble(Parameter parameter,
double minValue,
double maxValue)
Searches down through databases to find a given parameter, whose value
must be a double >= minValue and <= maxValue.
|
double |
getDouble(Parameter parameter,
Parameter defaultParameter) |
double |
getDouble(Parameter parameter,
Parameter defaultParameter,
double minValue)
Searches down through databases to find a given parameter, whose value
must be a double >= minValue.
|
double |
getDouble(Parameter parameter,
Parameter defaultParameter,
double minValue,
double maxValue)
Deprecated.
use getDoubleWithMax instead
|
(package private) double[] |
getDoubles(Parameter parameter,
double minValue) |
(package private) double[] |
getDoubles(Parameter parameter,
double minValue,
int expectedLength) |
double[] |
getDoubles(Parameter parameter,
Parameter defaultParameter,
double minValue)
Searches down through databases to find a given parameter, whose value
must be a space- or tab-delimited list of doubles, each of which is >= minValue,
and which must be at least 1 number long.
|
double[] |
getDoubles(Parameter parameter,
Parameter defaultParameter,
double minValue,
int expectedLength)
Searches down through databases to find a given parameter, whose value
must be a space- or tab-delimited list of doubles, each of which is >= minValue,
and which must be exactly expectedLength (> 0) long.
|
(package private) double[] |
getDoublesUnconstrained(Parameter parameter) |
(package private) double[] |
getDoublesUnconstrained(Parameter parameter,
int expectedLength) |
double[] |
getDoublesUnconstrained(Parameter parameter,
Parameter defaultParameter)
Searches down through databases to find a given parameter, whose value
must be a space- or tab-delimited list of doubles,
and which must be at least 1 number long.
|
double[] |
getDoublesUnconstrained(Parameter parameter,
Parameter defaultParameter,
int expectedLength)
Searches down through databases to find a given parameter, whose value
must be a space- or tab-delimited list of doubles,
and which must be exactly expectedLength (> 0) long.
|
(package private) double[] |
getDoublesWithMax(Parameter parameter,
double minValue,
double maxValue) |
(package private) double[] |
getDoublesWithMax(Parameter parameter,
double minValue,
double maxValue,
int expectedLength) |
double[] |
getDoublesWithMax(Parameter parameter,
Parameter defaultParameter,
double minValue,
double maxValue)
Searches down through databases to find a given parameter, whose value
must be a space- or tab-delimited list of doubles, each of which is >= minValue and <= maxValue,
and which must be at least 1 number long.
|
double[] |
getDoublesWithMax(Parameter parameter,
Parameter defaultParameter,
double minValue,
double maxValue,
int expectedLength)
Searches down through databases to find a given parameter, whose value
must be a space- or tab-delimited list of doubles, each of which is >= minValue and <= maxValue,
and which must be exactly expectedLength (> 0) long.
|
(package private) double |
getDoubleWithDefault(Parameter parameter,
double defaultValue)
Searches down through databases to find a given parameter, which must be
a float.
|
double |
getDoubleWithDefault(Parameter parameter,
Parameter defaultParameter,
double defaultValue)
Searches down through databases to find a given parameter, which must be
a float.
|
double |
getDoubleWithMax(Parameter parameter,
Parameter defaultParameter,
double minValue,
double maxValue)
Searches down through databases to find a given parameter, whose value
must be a double >= minValue and <= maxValue.
|
(package private) File |
getFile(Parameter parameter)
Searches down through the databases to find a given parameter, whose
value must be an absolute or relative path name.
|
File |
getFile(Parameter parameter,
Parameter defaultParameter)
Searches down through the databases to find a given parameter, whose
value must be an absolute or relative path name.
|
(package private) float |
getFloat(Parameter parameter) |
(package private) float |
getFloat(Parameter parameter,
double minValue)
Searches down through databases to find a given parameter, whose value
must be a float >= minValue.
|
(package private) float |
getFloat(Parameter parameter,
double minValue,
double maxValue)
Searches down through databases to find a given parameter, whose value
must be a float >= minValue and <= maxValue.
|
float |
getFloat(Parameter parameter,
Parameter defaultParameter) |
float |
getFloat(Parameter parameter,
Parameter defaultParameter,
double minValue)
Searches down through databases to find a given parameter, whose value
must be a float >= minValue.
|
float |
getFloat(Parameter parameter,
Parameter defaultParameter,
double minValue,
double maxValue)
Deprecated.
Use getFloatWithMax instead
|
(package private) float |
getFloatWithDefault(Parameter parameter,
double defaultValue)
Searches down through databases to find a given parameter, which must be
a float.
|
float |
getFloatWithDefault(Parameter parameter,
Parameter defaultParameter,
double defaultValue)
Searches down through databases to find a given parameter, which must be
a float.
|
float |
getFloatWithMax(Parameter parameter,
Parameter defaultParameter,
double minValue,
double maxValue)
Searches down through databases to find a given parameter, whose value
must be a float >= minValue and <= maxValue.
|
Object |
getInstanceForParameter(Parameter parameter,
Parameter defaultParameter,
Class mustCastTosuperclass)
Searches down through databases to find a given parameter, whose value
must be a full Class name, and the class must be a descendent of but not
equal to mustCastTosuperclass .
|
Object |
getInstanceForParameterEq(Parameter parameter,
Parameter defaultParameter,
Class mustCastTosuperclass)
Searches down through databases to find a given parameter, whose value
must be a full Class name, and the class must be a descendent, or equal
to, mustCastTosuperclass .
|
(package private) int |
getInt(Parameter parameter)
Searches down through databases to find a given parameter, whose value
must be an integer.
|
(package private) int |
getInt(Parameter parameter,
int minValue)
Searches down through databases to find a given parameter, whose value
must be an integer >= minValue.
|
int |
getInt(Parameter parameter,
Parameter defaultParameter)
Searches down through databases to find a given parameter, whose value
must be an integer.
|
int |
getInt(Parameter parameter,
Parameter defaultParameter,
int minValue)
Searches down through databases to find a given parameter, whose value
must be an integer >= minValue.
|
int[] |
getInts(Parameter parameter,
Parameter defaultParameter,
int minValue)
Searches down through databases to find a given parameter, whose value
must be a space- or tab-delimited list of ints, each of which is >= minValue,
and which must be at least 1 number long.
|
int[] |
getInts(Parameter parameter,
Parameter defaultParameter,
int minValue,
int expectedLength)
Searches down through databases to find a given parameter, whose value
must be a space- or tab-delimited list of ints, each of which is >= minValue,
and which must be exactly expectedLength (> 0) long.
|
int[] |
getIntsUnconstrained(Parameter parameter,
Parameter defaultParameter)
Searches down through databases to find a given parameter, whose value
must be a space- or tab-delimited list of ints,
and which must be at least 1 number long.
|
int[] |
getIntsUnconstrained(Parameter parameter,
Parameter defaultParameter,
int expectedLength)
Searches down through databases to find a given parameter, whose value
must be a space- or tab-delimited list of ints,
and which must be exactly expectedLength (> 0) long.
|
int[] |
getIntsWithMax(Parameter parameter,
Parameter defaultParameter,
int minValue,
int maxValue)
Searches down through databases to find a given parameter, whose value
must be a space- or tab-delimited list of ints, each of which is >= minValue and <= maxValue,
and which must be at least 1 number long.
|
int[] |
getIntsWithMax(Parameter parameter,
Parameter defaultParameter,
int minValue,
int maxValue,
int expectedLength)
Searches down through databases to find a given parameter, whose value
must be a space- or tab-delimited list of ints, each of which is >= minValue and <= maxValue,
and which must be exactly expectedLength (> 0) long.
|
(package private) int |
getIntWithDefault(Parameter parameter,
int defaultValue)
Searches down through databases to find a given parameter, which must be
an integer.
|
int |
getIntWithDefault(Parameter parameter,
Parameter defaultParameter,
int defaultValue)
Searches down through databases to find a given parameter, which must be
an integer.
|
(package private) int |
getIntWithMax(Parameter parameter,
int minValue,
int maxValue)
Searches down through databases to find a given parameter, whose value
must be an integer >= minValue and <= maxValue.
|
int |
getIntWithMax(Parameter parameter,
Parameter defaultParameter,
int minValue,
int maxValue)
Searches down through databases to find a given parameter, whose value
must be an integer >= minValue and <= maxValue.
|
String |
getLabel()
Returns a String describing the location of the ParameterDatabase holding
this parameter, or "" if there is none.
|
ParameterDatabase |
getLocation(Parameter parameter) |
ParameterDatabase |
getLocation(String parameter) |
(package private) long |
getLong(Parameter parameter)
Searches down through databases to find a given parameter, whose value
must be a long.
|
(package private) long |
getLong(Parameter parameter,
long minValue)
Searches down through databases to find a given parameter, whose value
must be a long >= minValue.
|
(package private) long |
getLong(Parameter parameter,
long minValue,
long maxValue)
Deprecated.
|
long |
getLong(Parameter parameter,
Parameter defaultParameter)
Searches down through databases to find a given parameter, whose value
must be a long.
|
long |
getLong(Parameter parameter,
Parameter defaultParameter,
long minValue)
Searches down through databases to find a given parameter, whose value
must be a long >= minValue.
|
long |
getLong(Parameter parameter,
Parameter defaultParameter,
long minValue,
long maxValue)
Deprecated.
|
(package private) long |
getLongWithDefault(Parameter parameter,
long defaultValue)
Searches down through databases to find a given parameter, which must be
a long.
|
long |
getLongWithDefault(Parameter parameter,
Parameter defaultParameter,
long defaultValue)
Searches down through databases to find a given parameter, which must be
a long.
|
(package private) long |
getLongWithMax(Parameter parameter,
long minValue,
long maxValue)
Use getLongWithMax(...) instead.
|
long |
getLongWithMax(Parameter parameter,
Parameter defaultParameter,
long minValue,
long maxValue)
Searches down through databases to find a given parameter, whose value
must be a long >= minValue and = < maxValue.
|
(package private) String |
getParam(Parameter parameter) |
(package private) InputStream |
getResource(Parameter parameter) |
InputStream |
getResource(Parameter parameter,
Parameter defaultParameter)
Searches down through the databases to find a given parameter, whose
value must be an absolute or relative path name.
|
Set |
getShadowedValues(Parameter parameter) |
(package private) String |
getString(Parameter parameter)
Searches down through databases to find a given parameter.
|
String |
getString(Parameter parameter,
Parameter defaultParameter)
Searches down through databases to find a given parameter.
|
String |
getStringWithDefault(Parameter parameter,
Parameter defaultParameter,
String defaultValue)
Searches down through databases to find a given parameter.
|
(package private) String |
getStringWithDefault(Parameter parameter,
String defaultValue)
Searches down through databases to find a given parameter.
|
(package private) int |
indexOfFirstWhitespace(String s) |
(package private) static boolean |
isJarFile(URL url) |
void |
list(PrintWriter p)
Prints out all the parameters in the database, but not shadowed
parameters.
|
void |
list(PrintWriter p,
boolean listShadowed)
Prints out all the parameters in the database.
|
void |
listAccessed(PrintWriter p)
Prints out all the parameters marked as accessed ("gotten" by some
getFoo(...) method), plus their values.
|
void |
listGotten(PrintWriter p)
Prints out all the parameters marked as used, plus their values.
|
void |
listNotAccessed(PrintWriter p)
Prints out all the parameters NOT marked as used, plus their values.
|
void |
listNotGotten(PrintWriter p)
Prints out all the parameters NOT marked as used, plus their values.
|
static void |
main(String[] args)
Test the ParameterDatabase
|
(package private) int |
parseInt(String string)
Parses an integer from a string, either in decimal or (if starting with
an x) in hex
|
(package private) long |
parseLong(String string)
Parses a long from a string, either in decimal or (if starting with an x)
in hex
|
void |
prependParent(ParameterDatabase database) |
(package private) void |
printGotten(Parameter parameter,
Parameter defaultParameter,
boolean exists) |
void |
remove(Parameter parameter)
Removes a parameter from the topmost database.
|
void |
removeDeeply(Parameter parameter) |
void |
set(Parameter parameter,
String value)
Sets a parameter in the topmost database to a given value, trimmed of
whitespace.
|
(package private) static String |
simplifyPath(String pathname) |
String |
toString() |
(package private) void |
uncheck()
Clears the checked flag
|
public static final String C_HERE
public static final String C_CLASS
public static final String V_ALIAS
public static final String V_DEFAULT
public static final String UNKNOWN_VALUE
public static final String PRINT_PARAMS
public static final int PS_UNKNOWN
public static final int PS_NONE
public static final int PS_PRINT_PARAMS
public int printState
String label
Vector parents
File directory
boolean checked
Hashtable gotten
Hashtable accessed
Class relativeClass
String relativePath
Properties properties
static final int ARRAY_NO_EXPECTED_LENGTH
public ParameterDatabase()
public ParameterDatabase(Dictionary map) throws FileNotFoundException, IOException
FileNotFoundException
IOException
public ParameterDatabase(String pathNameRelativeToClassFile, Class cls, String[] args) throws FileNotFoundException, IOException
FileNotFoundException
IOException
public ParameterDatabase(String pathNameRelativeToClassFile, Class cls) throws FileNotFoundException, IOException
FileNotFoundException
IOException
public ParameterDatabase(InputStream stream) throws FileNotFoundException, IOException
FileNotFoundException
IOException
public ParameterDatabase(File file) throws FileNotFoundException, IOException
FileNotFoundException
IOException
public ParameterDatabase(File file, String[] args) throws FileNotFoundException, IOException
FileNotFoundException
IOException
public Object getInstanceForParameter(Parameter parameter, Parameter defaultParameter, Class mustCastTosuperclass) throws ParamClassLoadException
ParamClassLoadException
public Object getInstanceForParameterEq(Parameter parameter, Parameter defaultParameter, Class mustCastTosuperclass) throws ParamClassLoadException
ParamClassLoadException
public Class getClassForParameter(Parameter parameter, Parameter defaultParameter, Class mustCastTosuperclass) throws ParamClassLoadException
ParamClassLoadException
public boolean getBoolean(Parameter parameter, Parameter defaultParameter, boolean defaultValue)
boolean getBoolean(Parameter parameter, boolean defaultValue)
int parseInt(String string) throws NumberFormatException
NumberFormatException
long parseLong(String string) throws NumberFormatException
NumberFormatException
int getInt(Parameter parameter) throws NumberFormatException
NumberFormatException
public int getInt(Parameter parameter, Parameter defaultParameter) throws NumberFormatException
NumberFormatException
public int getInt(Parameter parameter, Parameter defaultParameter, int minValue)
int getInt(Parameter parameter, int minValue)
public int getIntWithDefault(Parameter parameter, Parameter defaultParameter, int defaultValue)
int getIntWithDefault(Parameter parameter, int defaultValue)
public int getIntWithMax(Parameter parameter, Parameter defaultParameter, int minValue, int maxValue)
int getIntWithMax(Parameter parameter, int minValue, int maxValue)
float getFloat(Parameter parameter) throws NumberFormatException
NumberFormatException
public float getFloat(Parameter parameter, Parameter defaultParameter) throws NumberFormatException
NumberFormatException
public float getFloat(Parameter parameter, Parameter defaultParameter, double minValue)
float getFloat(Parameter parameter, double minValue)
public float getFloatWithDefault(Parameter parameter, Parameter defaultParameter, double defaultValue)
float getFloatWithDefault(Parameter parameter, double defaultValue)
public float getFloatWithMax(Parameter parameter, Parameter defaultParameter, double minValue, double maxValue)
public float getFloat(Parameter parameter, Parameter defaultParameter, double minValue, double maxValue)
float getFloat(Parameter parameter, double minValue, double maxValue)
double getDouble(Parameter parameter) throws NumberFormatException
NumberFormatException
public double getDouble(Parameter parameter, Parameter defaultParameter) throws NumberFormatException
NumberFormatException
public double getDouble(Parameter parameter, Parameter defaultParameter, double minValue)
double getDouble(Parameter parameter, double minValue)
public double getDoubleWithMax(Parameter parameter, Parameter defaultParameter, double minValue, double maxValue)
public double getDouble(Parameter parameter, Parameter defaultParameter, double minValue, double maxValue)
double getDouble(Parameter parameter, double minValue, double maxValue)
public double getDoubleWithDefault(Parameter parameter, Parameter defaultParameter, double defaultValue)
double getDoubleWithDefault(Parameter parameter, double defaultValue)
double[] extendBag(double[] bag)
double[] collapseBag(double[] bag, int size)
double[] getDoublesWithMax(Parameter parameter, double minValue, double maxValue, int expectedLength)
double[] getDoublesWithMax(Parameter parameter, double minValue, double maxValue)
double[] getDoubles(Parameter parameter, double minValue, int expectedLength)
double[] getDoubles(Parameter parameter, double minValue)
double[] getDoublesUnconstrained(Parameter parameter, int expectedLength)
double[] getDoublesUnconstrained(Parameter parameter)
public double[] getDoublesWithMax(Parameter parameter, Parameter defaultParameter, double minValue, double maxValue, int expectedLength)
public double[] getDoublesWithMax(Parameter parameter, Parameter defaultParameter, double minValue, double maxValue)
public double[] getDoubles(Parameter parameter, Parameter defaultParameter, double minValue, int expectedLength)
public double[] getDoubles(Parameter parameter, Parameter defaultParameter, double minValue)
public double[] getDoublesUnconstrained(Parameter parameter, Parameter defaultParameter, int expectedLength)
public double[] getDoublesUnconstrained(Parameter parameter, Parameter defaultParameter)
public int[] getIntsWithMax(Parameter parameter, Parameter defaultParameter, int minValue, int maxValue, int expectedLength)
public int[] getIntsWithMax(Parameter parameter, Parameter defaultParameter, int minValue, int maxValue)
public int[] getInts(Parameter parameter, Parameter defaultParameter, int minValue, int expectedLength)
public int[] getInts(Parameter parameter, Parameter defaultParameter, int minValue)
public int[] getIntsUnconstrained(Parameter parameter, Parameter defaultParameter, int expectedLength)
public int[] getIntsUnconstrained(Parameter parameter, Parameter defaultParameter)
long getLong(Parameter parameter) throws NumberFormatException
NumberFormatException
public long getLong(Parameter parameter, Parameter defaultParameter) throws NumberFormatException
NumberFormatException
public long getLong(Parameter parameter, Parameter defaultParameter, long minValue)
long getLong(Parameter parameter, long minValue)
public long getLongWithDefault(Parameter parameter, Parameter defaultParameter, long defaultValue)
long getLongWithDefault(Parameter parameter, long defaultValue)
public long getLongWithMax(Parameter parameter, Parameter defaultParameter, long minValue, long maxValue)
long getLongWithMax(Parameter parameter, long minValue, long maxValue)
public long getLong(Parameter parameter, Parameter defaultParameter, long minValue, long maxValue)
long getLong(Parameter parameter, long minValue, long maxValue)
public File getFile(Parameter parameter, Parameter defaultParameter)
File getFile(Parameter parameter)
public InputStream getResource(Parameter parameter, Parameter defaultParameter)
int indexOfFirstWhitespace(String s)
InputStream getResource(Parameter parameter)
public String getString(Parameter parameter, Parameter defaultParameter)
String getString(Parameter parameter)
public String getStringWithDefault(Parameter parameter, Parameter defaultParameter, String defaultValue)
String getStringWithDefault(Parameter parameter, String defaultValue)
void uncheck()
public void set(Parameter parameter, String value)
public void listGotten(PrintWriter p)
public void listNotGotten(PrintWriter p)
public void listNotAccessed(PrintWriter p)
public void listAccessed(PrintWriter p)
public boolean exists(Parameter parameter)
boolean _exists(Parameter parameter)
public boolean exists(Parameter parameter, Parameter defaultParameter)
int countDelimiters(String parameter)
public ParameterDatabase getLocation(Parameter parameter)
public ParameterDatabase getLocation(String parameter)
ParameterDatabase _getLocation(String parameter)
File directoryFor(Parameter parameter)
public String getLabel()
public void remove(Parameter parameter)
public void removeDeeply(Parameter parameter)
void _removeDeeply(Parameter parameter)
public void prependParent(ParameterDatabase database)
public void addParent(ParameterDatabase database)
static boolean isJarFile(URL url)
public void list(PrintWriter p)
public void list(PrintWriter p, boolean listShadowed)
void _list(PrintWriter p, boolean listShadowed, String prefix, Hashtable gather)
public TreeModel buildTreeModel()
void _buildTreeModel(DefaultTreeModel model, DefaultMutableTreeNode root)
void _addNodeForParameter(DefaultTreeModel model, DefaultMutableTreeNode root, String key)
model
- root
- e
- public static void main(String[] args) throws FileNotFoundException, IOException
FileNotFoundException
IOException
Copyright © 2019. All rights reserved.