|
jET |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.AbstractMap | +--java.util.HashMap | +--org.jet.Configuration
The configuration of jET.
It has similar features as java.util.Properties
class. It can read and write properties to files. The extension is
in that it can save values other than strings.
Implementation bases on hashed map.
Field Summary | |
static java.lang.String |
FILENAME
Configuration file name. |
Constructor Summary | |
Configuration()
Constructs configuration object. |
Method Summary | |
boolean |
getBoolean(java.lang.String str)
Gets boolean value. |
double |
getDouble(java.lang.String str)
Gets double value. |
int |
getInt(java.lang.String str)
Gets integer value. |
void |
load()
Loads configuration from file. |
protected void |
loadProperties(java.util.Properties prop)
Gets key value pairs from properties loaded from file and puts it to configuration map. |
boolean |
put(java.lang.String str,
boolean b)
Puts a boolean to configuration. |
int |
put(java.lang.String str,
int num)
Puts a integer to configuration. |
void |
store()
Stores current configuration to the file. |
protected java.util.Properties |
storeProperties()
Stores key, value pairs from configuration to properties, which are going to be stored in file. |
Methods inherited from class java.util.HashMap |
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values |
Methods inherited from class java.util.AbstractMap |
equals, hashCode, toString |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
equals, hashCode |
Field Detail |
public static final java.lang.String FILENAME
Constructor Detail |
public Configuration()
Method Detail |
public void load()
public void store()
protected void loadProperties(java.util.Properties prop)
This method is invoked inside load()
method after reading
file.
prop
- Properties loaded from file.protected java.util.Properties storeProperties()
It is invoked inside store()
method before writing to
configuration file.
public int put(java.lang.String str, int num)
str
- Option name.num
- Integer number.
public boolean put(java.lang.String str, boolean b)
str
- Option name.b
- Boolean value.
public int getInt(java.lang.String str)
str
- Option name.
java.lang.ClassCastException
- Method may throw a class cast exception
when the key does not match integer value.public boolean getBoolean(java.lang.String str)
str
- Option name.
java.lang.ClassCastException
- Method may throw a class cast exception
when the key does not match boolean value.public double getDouble(java.lang.String str)
str
- Option name.
java.lang.ClassCastException
- Method may throw a class cast exception
when the key does not match boolean value.
|
jET |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |