org.h2.util
Class SortedProperties
java.lang.Object
java.util.Dictionary<K,V>
java.util.Hashtable<java.lang.Object,java.lang.Object>
java.util.Properties
org.h2.util.SortedProperties
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.Object,java.lang.Object>
public class SortedProperties
- extends java.util.Properties
Sorted properties file.
This implementation requires that store() internally calls keys().
- See Also:
- Serialized Form
| Fields inherited from class java.util.Properties |
defaults |
|
Method Summary |
static boolean |
getBooleanProperty(java.util.Properties prop,
java.lang.String key,
boolean def)
Get a boolean property value from a properties object. |
static int |
getIntProperty(java.util.Properties prop,
java.lang.String key,
int def)
Get an int property value from a properties object. |
java.util.Enumeration<java.lang.Object> |
keys()
|
static SortedProperties |
loadProperties(java.lang.String fileName)
Load a properties object from a file. |
void |
store(java.lang.String fileName)
Store a properties file. |
| Methods inherited from class java.util.Properties |
getProperty, getProperty, list, list, load, loadFromXML, propertyNames, save, setProperty, store, storeToXML, storeToXML |
| Methods inherited from class java.util.Hashtable |
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, rehash, remove, size, toString, values |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
SortedProperties
public SortedProperties()
keys
public java.util.Enumeration<java.lang.Object> keys()
- Overrides:
keys in class java.util.Hashtable<java.lang.Object,java.lang.Object>
getBooleanProperty
public static boolean getBooleanProperty(java.util.Properties prop,
java.lang.String key,
boolean def)
- Get a boolean property value from a properties object.
- Parameters:
prop - the properties objectkey - the keydef - the default value
- Returns:
- the value if set, or the default value if not
getIntProperty
public static int getIntProperty(java.util.Properties prop,
java.lang.String key,
int def)
- Get an int property value from a properties object.
- Parameters:
prop - the properties objectkey - the keydef - the default value
- Returns:
- the value if set, or the default value if not
loadProperties
public static SortedProperties loadProperties(java.lang.String fileName)
throws java.io.IOException
- Load a properties object from a file.
- Parameters:
fileName - the name of the properties file
- Returns:
- the properties object
- Throws:
java.io.IOException
store
public void store(java.lang.String fileName)
throws java.io.IOException
- Store a properties file. The header and the date is not written.
- Parameters:
fileName - the target file name
- Throws:
java.io.IOException