|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.psychomad.psycholib.resources.Config
public class Config
This class allow to use a config file in ReadOnly mode or Writable mode.
Properties
Constructor Summary | |
---|---|
Config(java.lang.String path,
boolean modifAllowed)
This constructor init the path to the config file, and make this config file read only or writable according to the parameter. |
Method Summary | |
---|---|
double |
getDouble(java.lang.String str)
Returns the double which corresponds to the given key. |
int |
getInt(java.lang.String str)
Returns the int which corresponds to the given key. |
java.lang.String |
getPath()
|
java.lang.String |
getString(java.lang.String str)
Returns the string property which corresponds to the given key. |
java.lang.String |
getStringNoWarning(java.lang.String str)
|
java.lang.Object |
setProperty(java.lang.String key,
java.lang.String value)
Make a call to the setPropety method of the Propeties class, in order to store the value in the resource file. |
void |
store()
|
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 path, boolean modifAllowed)
path
- the path to the config file.modifAllowed
- a boolean indicating if the config file is upgradable.Method Detail |
---|
public java.lang.String getPath()
public java.lang.String getString(java.lang.String str) throws MissingPropertiesException
str
- the string key
MissingPropertiesException
public java.lang.String getStringNoWarning(java.lang.String str)
public int getInt(java.lang.String str) throws MissingPropertiesException, java.lang.NumberFormatException
str
- the string key
MissingPropertiesException
java.lang.NumberFormatException
public double getDouble(java.lang.String str) throws MissingPropertiesException, java.lang.NumberFormatException
str
- the string key
MissingPropertiesException
java.lang.NumberFormatException
public java.lang.Object setProperty(java.lang.String key, java.lang.String value)
#java.util.Properties.setProperty
public void store() throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |