|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Dictionary<K,V>
java.util.Hashtable<java.lang.Object,java.lang.Object>
java.util.Properties
fr.tireme.schemadoc.xs2dtd.utils.Configuration
public class Configuration
This class act as the Java Properties class with some added methods such as getInt(),getFloat(),isSelected() and getString(). The order of entry of the key parameters is the order of reading
| Constructor Summary | |
|---|---|
Configuration()
Constructor - construct a new Configuration objects with no initial paremeters |
|
Configuration(java.util.Properties defaults)
Constructor - construct a new Configuration objects with the following parameters |
|
| Method Summary | |
|---|---|
boolean |
exists(java.lang.String key)
|
float |
getFloat(java.lang.String key)
Get a key value as a float |
int |
getInt(java.lang.String key)
get a key value as an int |
long |
getLong(java.lang.String key)
Get a key value as a float |
java.lang.String |
getString(java.lang.String key)
get a key value as a string. |
java.lang.String |
getWithAbsolutePath(java.lang.String key,
java.lang.String homeDirKey)
get a key value representing a filename as a string, and make sure that the returned file path is abolute, and not relative. 1st case: the file path starts with a "/" or "X:" -> path is already absolute 2nd case: else, append the filename to the home directory of the application |
boolean |
isSelected(java.lang.String key)
|
java.util.Enumeration |
keys()
Return the hashtable as an enumeration return Enumeration - the hash enumerate |
void |
list(java.io.PrintStream out)
List the hashtable to the specific output |
void |
list(java.io.PrintWriter out)
List the hashtable to the specific output |
void |
loadFromFile(java.lang.String filename)
Load a file as parameters |
java.util.Enumeration |
propertyNames()
get the property names |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Add a new key |
java.lang.Object |
remove(java.lang.Object key)
remove a key |
void |
saveResult(java.io.OutputStream out,
java.lang.String header)
Save the hash to the specific stream |
void |
saveToFile(java.lang.String filename,
java.lang.String header)
Save to file |
java.lang.String |
toString()
Return the hashtable as a string |
| Methods inherited from class java.util.Properties |
|---|
getProperty, getProperty, load, load, loadFromXML, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames |
| Methods inherited from class java.util.Hashtable |
|---|
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keySet, putAll, size, values |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Configuration()
public Configuration(java.util.Properties defaults)
defaults - - the default properties;| Method Detail |
|---|
public void loadFromFile(java.lang.String filename)
throws java.io.IOException
filename - - the file name to load
java.io.IOException
public void saveToFile(java.lang.String filename,
java.lang.String header)
throws java.io.IOException
filename - - the file name to saveheader - - the file header
java.io.IOExceptionpublic java.lang.String getString(java.lang.String key)
key - - the wanted key
public int getInt(java.lang.String key)
key - - the wanted key
public long getLong(java.lang.String key)
key - - the wanted key
public float getFloat(java.lang.String key)
key - - the wanted key
public java.lang.String getWithAbsolutePath(java.lang.String key,
java.lang.String homeDirKey)
key - - the wanted keyhomeDirKey - the key corresponding to the home directory of the application.
public boolean isSelected(java.lang.String key)
key - - the wanted key
public boolean exists(java.lang.String key)
key - - the wanted exist key
public java.lang.Object remove(java.lang.Object key)
remove in interface java.util.Map<java.lang.Object,java.lang.Object>remove in class java.util.Hashtable<java.lang.Object,java.lang.Object>key - - the key to remove
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
put in interface java.util.Map<java.lang.Object,java.lang.Object>put in class java.util.Hashtable<java.lang.Object,java.lang.Object>key - - the key to addvalue - the key valuepublic java.util.Enumeration keys()
keys in class java.util.Hashtable<java.lang.Object,java.lang.Object>public java.lang.String toString()
toString in class java.util.Hashtable<java.lang.Object,java.lang.Object>public void list(java.io.PrintWriter out)
list in class java.util.Propertiesout - - the print writerpublic void list(java.io.PrintStream out)
list in class java.util.Propertiesout - - the print stream
public void saveResult(java.io.OutputStream out,
java.lang.String header)
out - - the output streamheader - - the output headerpublic java.util.Enumeration propertyNames()
propertyNames in class java.util.Properties
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||