|
|
||||||||||
| 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<Object,Object>
java.util.Properties
org.jppf.utils.TypedProperties
public class TypedProperties
Extension of the java.util.Properties class to handle the conversion of
string values to other types.
| Field Summary |
|---|
| Fields inherited from class java.util.Properties |
|---|
defaults |
| Constructor Summary | |
|---|---|
TypedProperties()
Default constructor. |
|
TypedProperties(Map<Object,Object> map)
Initialize this object with a set of existing properties. |
|
| Method Summary | |
|---|---|
String |
asString()
Convert this set of properties into a string. |
boolean |
getBoolean(String key)
Get the boolean value of a property with a specified name. |
boolean |
getBoolean(String key,
boolean defValue)
Get the boolean value of a property with a specified name. |
char |
getChar(String key)
Get the char value of a property with a specified name. |
char |
getChar(String key,
char defValue)
Get the char value of a property with a specified name. |
double |
getDouble(String key)
Get the double precision value of a property with a specified name. |
double |
getDouble(String key,
double defValue)
Get the double precision value of a property with a specified name. |
float |
getFloat(String key)
Get the single precision value of a property with a specified name. |
float |
getFloat(String key,
float defValue)
Get the single precision value of a property with a specified name. |
InetAddress |
getInetAddress(String key)
Get the value of a property with the specified name as an InetAddress. |
InetAddress |
getInetAddress(String key,
InetAddress def)
Get the value of a property with the specified name as an InetAddress. |
int |
getInt(String key)
Get the integer value of a property with a specified name. |
int |
getInt(String key,
int defValue)
Get the integer value of a property with a specified name. |
long |
getLong(String key)
Get the long integer value of a property with a specified name. |
long |
getLong(String key,
long defValue)
Get the long integer value of a property with a specified name. |
TypedProperties |
getProperties(String key)
Get the value of a property with the specified name as a set of a properties. |
TypedProperties |
getProperties(String key,
TypedProperties def)
Get the value of a property with the specified name as a set of properties. |
String |
getString(String key)
Get the string value of a property with a specified name. |
String |
getString(String key,
String defValue)
Get the string value of a property with a specified name. |
void |
loadString(String source)
Load this set of properties from a string. |
| Methods inherited from class java.util.Properties |
|---|
getProperty, getProperty, list, list, load, load, loadFromXML, propertyNames, 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, keys, keySet, put, putAll, rehash, remove, size, toString, values |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TypedProperties()
public TypedProperties(Map<Object,Object> map)
map - the properties to be copied. No reference to this parameter is kept in this TypedProperties object.| Method Detail |
|---|
public String getString(String key)
key - the name of the property to look for.
public String getString(String key,
String defValue)
key - the name of the property to look for.defValue - a default value to return if the property is not found.
public int getInt(String key)
key - the name of the property to look for.
public int getInt(String key,
int defValue)
key - the name of the property to look for.defValue - a default value to return if the property is not found.
public long getLong(String key)
key - the name of the property to look for.
public long getLong(String key,
long defValue)
key - the name of the property to look for.defValue - a default value to return if the property is not found.
public float getFloat(String key)
key - the name of the property to look for.
public float getFloat(String key,
float defValue)
key - the name of the property to look for.defValue - a default value to return if the property is not found.
public double getDouble(String key)
key - the name of the property to look for.
public double getDouble(String key,
double defValue)
key - the name of the property to look for.defValue - a default value to return if the property is not found.
public boolean getBoolean(String key)
key - the name of the property to look for.
public boolean getBoolean(String key,
boolean defValue)
key - the name of the property to look for.defValue - a default value to return if the property is not found.
public char getChar(String key)
key - the name of the property to look for.
public char getChar(String key,
char defValue)
key - the name of the property to look for.defValue - a default value to return if the property is not found.
public TypedProperties getProperties(String key)
key - the name of the property to look for.
Its value is the path to another properties file. Relative paths are evaluated against the current application directory.
public TypedProperties getProperties(String key,
TypedProperties def)
key - the name of the property to look for.
Its value is the path to another properties file. Relative paths are evaluated against the current application directory.def - a default value to return if the property is not found.
public InetAddress getInetAddress(String key)
InetAddress.
key - the name of the property to retrieve.
InetAddress instance, or null if the property is not defined or the host doesn't exist.
public InetAddress getInetAddress(String key,
InetAddress def)
InetAddress.
key - the name of the property to retrieve.def - the default value to use if the property is not defined.
InetAddress instance, or the sdpecified default value if the property is not defined.public String asString()
public void loadString(String source)
throws IOException
source - the string to load from.
IOException - if any error occurs.
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||