Method Summary |
|
public Hashtable | allConfigParams(String prefix) Returns the hashtable containing names and values of all config parameters
Names are in the form name-level-0_name-level-1_name-level-2... |
public int | containsCount(String key) Returns the number of data elements for a given key, or -1 if
the key is not found. |
public boolean | containsKey(String key) Returns true if the specified key is found,
false otherwise. |
public boolean | getBoolean(String key) Returns a single boolean value associated with a given key.
If the key is associated with more than one element, or the
retrieved element cannot be converted to a boolean then a
ConfigException exception is thrown.
Parameters: key - The key to use to search for the configuration entry. |
public boolean | getBoolean(String key, boolean defaultValue) Returns a single boolean value associated with a given key.
If the key is associated with more than one element, or the
retrieved element cannot be converted to a boolean then a
ConfigException exception is thrown.
Parameters: key - The key to use to search for the configuration entry. Parameters: defaultValue - The default value to use if the requested entrydoes not exist. |
public boolean[] | getBooleans(String key) Returns all boolean values associated with a given key.
If any of the elements associated with the key cannot be converted
to a boolean then a ConfigException error is thrown.
Parameters: key - The key to use to search for the configuration entry. |
public boolean[] | getBooleans(String key, boolean[] defaultValue) Returns all boolean values associated with a given key.
If any of the elements associated with the key cannot be converted
to a boolean then a ConfigException error is thrown.
Parameters: key - The key to use to search for the configuration entry. Parameters: defaultValue - The default value to use if the requested entry does notexist. |
public Config | getClonedConfig() Returnes cloned Config object. |
public synchronized Config | getConfig(String keyword) Get the value of a section as a Config object.
Parameters: keyword - The keyword of the field. |
public ConfigFileInterface | getConfigFile() Gets the ConfigFile associated with this object. |
public Object | getDataSource(String key) Returns a DataSource value associated with a given key.
Parameters: key - The key to use to search for the configuration entry. |
public Object | getDataSource(String key, Object defaultValue) Returns a single DataSource value associated with a given key.
If the key is associated with more than one element, or the
retrieved element cannot be converted to a String then a
ConfigException exception is thrown.
Parameters: key - The key to use to search for the configuration entry. Parameters: defaultValue - The default value to use if the requested entrydoes not exist. |
public double | getDouble(String key) Returns a single double value associated with a given key. |
public double | getDouble(String key, double defaultValue) Returns a single double value associated with a given key.
If the key is associated with more than one element, or the
retrieved element cannot be converted to a double then a
ConfigException exception is thrown.
Parameters: key - The key to use to search for the configuration entry. Parameters: defaultValue - The default value to use if the requested entrydoes not exist. |
public double[] | getDoubles(String key) Returns all double values associated with a given key.
If any of the elements associated with the key cannot be converted
to a double then a ConfigException error is thrown.
Parameters: key - The key to use to search for the configuration entry. |
public double[] | getDoubles(String key, double[] defaultValue) Returns all double values associated with a given key.
If any of the elements associated with the key cannot be converted
to a double then a ConfigException error is thrown.
Parameters: key - The key to use to search for the configuration entry. Parameters: defaultValue - The default value to use if the requested entrydoes not exist. |
public int | getInt(String key) Returns a single integer value associated with a given key.
If the key is associated with more than one element, or the
retrieved element cannot be converted to a integer then a
ConfigException exception is thrown.
Parameters: key - The key to use to search for the configuration entry. |
public int | getInt(String key, int defaultValue) Returns a single integer value associated with a given key.
If the key is associated with more than one element, or the
retrieved element cannot be converted to a integer then a
ConfigException exception is thrown.
Parameters: key - The key to use to search for the configuration entry. Parameters: defaultValue - The default value to use if the requested entrydoes not exist. |
public int[] | getInts(String key) Returns all integer values associated with a given key.
If any of the elements associated with the key cannot be converted
to a integer then a ConfigException error is thrown.
Parameters: key - The key to use to search for the configuration entry. |
public int[] | getInts(String key, int[] defaultValue) Returns all integer values associated with a given key.
If any of the elements associated with the key cannot be converted
to a integer then a ConfigException error is thrown.
Parameters: key - The key to use to search for the configuration entry. Parameters: defaultValue - The default value to use if the requested entrydoes not exist. |
public long | getLong(String key) Returns a single long integer value associated with a given key.
If the key is associated with more than one element, or the
retrieved element cannot be converted to a long integer then a
ConfigException exception is thrown.
Parameters: key - The key to use to search for the configuration entry. |
public long | getLong(String key, long defaultValue) Returns a single long integer value associated with a given key.
If the key is associated with more than one element then a
ConfigException error is thrown with reason
set to COUNT . |
public long[] | getLongs(String key) Returns all long integer values associated with a given key.
If any of the elements associated with the key cannot be converted
to a long integer then a ConfigException error is thrown.
Parameters: key - The key to use to search for the configuration entry. |
public long[] | getLongs(String key, long[] defaultValue) Returns all long integer values associated with a given key.
If any of the elements associated with the key cannot be converted
to a long integer then a ConfigException error is thrown.
Parameters: key - The key to use to search for the configuration entry. Parameters: defaultValue - The default value to use if the requested entrydoes not exist. |
public synchronized KeywordValueTable | getSection(String keyword) Gets the value of a section as a KeywordValueTable object.
This method overrides the KeywordValueTable.getSection in order to
insure that Config.getSection() always returns a Config object even
if a KeywordValueTable was inserted into the Config as a section.
Parameters: keyword - The keyword of the field. |
public String | getString(String key) Returns a single String value associated with a given key.
If the key is associated with more than one element, or the
retrieved element cannot be converted to a String then a
ConfigException exception is thrown.
Parameters: key - The key to use to search for the configuration entry. |
public String | getString(String key, String defaultValue) Returns a single String value associated with a given key.
If the key is associated with more than one element, or the
retrieved element cannot be converted to a String then a
ConfigException exception is thrown.
Parameters: key - The key to use to search for the configuration entry. Parameters: defaultValue - The default value to use if the requested entrydoes not exist. |
public String[] | getStrings(String key) Returns all String values associated with a given key.
If any of the elements associated with the key cannot be converted
to a String then a ConfigException error is thrown.
Parameters: key - The key to use to search for the configuration entry. |
public String[] | getStrings(String key, String[] defaultValue) Returns all String values associated with a given key.
If any of the elements associated with the key cannot be converted
to a String then a ConfigException error is thrown.
Parameters: key - The key to use to search for the configuration entry. Parameters: defaultValue - The default value to use if the requested entrydoes not exist. |
public void | importConfig(Config config) Imorts and synchronizes to, all parameters (key-value pairs) according to
given Config object parameters. |
public boolean | isArray(String key) Is the key is an array, or a single value. |
protected KeywordValueTable | newSection() Allocates a new section. |
public void | setConfigFile(ConfigFileInterface configFile) Sets the ConfigFile associated with this object. |