|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.miami.romeo.config.Config
A Config is used to save a set of Config properties. The properties can be written out to disk in "name=value" form, and read back in.
Constructor Summary | |
Config()
Constructs a new Config object that doesn't have a file associated with it. |
|
Config(java.io.File config_file)
Constructs a new Config object that stores it's properties in the given file. |
|
Config(java.lang.String file_name)
Constructs a new Config object that stores it's properties in the file with the given name. |
|
Config(java.net.URL config_file)
Constructs a new Config object that stores it's properties in the given file. |
Method Summary | |
void |
add(java.lang.String name,
boolean value)
Adds the boolean property. |
void |
add(java.lang.String name,
double value)
Adds the double property. |
void |
add(java.lang.String name,
int value)
Adds the integer property. |
void |
add(java.lang.String name,
java.lang.String value)
Adds a the property with the given name and value. |
java.lang.String |
get(java.lang.String name)
Returns the value of the property with the given name. |
java.lang.String |
get(java.lang.String name,
java.lang.String default_value)
Returns the value of the property with the given name. |
boolean |
getBoolean(java.lang.String name)
Returns the value of the property with the given name. |
boolean |
getBoolean(java.lang.String name,
boolean default_value)
Returns the value of the property with the given name. |
java.io.File |
getConfigFile()
|
double |
getDouble(java.lang.String name)
Returns the value of the property with the given name |
double |
getDouble(java.lang.String name,
double default_value)
Returns the value of the property with the given name. |
int |
getInt(java.lang.String name)
Returns the value of the property with the given name |
int |
getInt(java.lang.String name,
int default_value)
Returns the value of the property with the given name. |
boolean |
load()
Loads the property list from the Config file. |
boolean |
load(java.io.BufferedReader buffy)
|
void |
remove(java.lang.String name)
Removes the property with the given name. |
void |
removeAll()
Removes all the properties. |
boolean |
save()
Saves the property list to the config file. |
boolean |
save(java.io.PrintWriter out)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Config(java.lang.String file_name)
public Config(java.io.File config_file)
public Config(java.net.URL config_file)
public Config()
Method Detail |
public java.io.File getConfigFile()
public void add(java.lang.String name, java.lang.String value)
name
- The name of the property.value
- The value of the property.public void add(java.lang.String name, boolean value)
name
- The name of the property.value
- The value of the property.public void add(java.lang.String name, int value)
name
- The name of the property.value
- The value of the property.public void add(java.lang.String name, double value)
name
- The name of the property.value
- The value of the property.public java.lang.String get(java.lang.String name)
name
- The name of the desired property.
public java.lang.String get(java.lang.String name, java.lang.String default_value)
name
- The name of the desired property.default_value
- The default value of the property which is returned
if the property does not have a specified value.
public boolean getBoolean(java.lang.String name)
name
- The name of the desired property.
public boolean getBoolean(java.lang.String name, boolean default_value)
name
- The name of the desired property.default_value
- The default value of the property which is returned
if the property does not have a specified value.
public int getInt(java.lang.String name)
name
- The name of the desired property.
public int getInt(java.lang.String name, int default_value)
name
- The name of the desired property.default_value
- The default value of the property which is returned
if the property does not have a specified value.
public double getDouble(java.lang.String name)
name
- The name of the desired property.
public double getDouble(java.lang.String name, double default_value)
name
- The name of the desired property.default_value
- The default value of the property which is returned
if the property does not have a specified value.
public void remove(java.lang.String name)
name
- The name of the property to remove.public void removeAll()
public boolean load()
public boolean load(java.io.BufferedReader buffy) throws java.io.IOException
java.io.IOException
public boolean save()
public boolean save(java.io.PrintWriter out) throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |