|
FreeHEP API Version current |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.freehep.application.PropertyUtilities
A set of static methods for operating on a Properties set
Properties
Nested Class Summary | |
static class |
PropertyUtilities.PropertyTable
Creates a TableModel from a property set |
static class |
PropertyUtilities.TranslatedProperties
A Properties object whose values and defaults are automatically translated if they contain {prop} tokens. |
Constructor Summary | |
PropertyUtilities()
|
Method Summary | |
static boolean |
getBoolean(Properties prop,
String key,
boolean def)
|
static Color |
getColor(Properties prop,
String key,
Color def)
|
static float |
getFloat(Properties prop,
String key,
float def)
|
static int |
getInteger(Properties prop,
String key)
|
static int |
getInteger(Properties prop,
String key,
int def)
|
static Rectangle |
getRectangle(Properties prop,
String key,
Rectangle def)
|
static String |
getString(Properties prop,
String key,
String def)
|
static String[] |
getStringArray(Properties prop,
String key,
String[] def)
|
static URL |
getURL(Properties prop,
String key,
URL def)
Load a URL from a properties file. |
static void |
setBoolean(Properties prop,
String key,
boolean value)
|
static void |
setColor(Properties prop,
String key,
Color c)
|
static void |
setFloat(Properties prop,
String key,
float f)
|
static void |
setInteger(Properties prop,
String key,
int i)
|
static void |
setRectangle(Properties prop,
String key,
Rectangle rect)
|
static void |
setString(Properties prop,
String key,
String s)
|
static void |
setStringArray(Properties prop,
String key,
String[] sa)
|
static void |
setURL(Properties prop,
String key,
URL url)
|
static String |
translate(Properties prop,
String in)
Translates a string by substituting tokens of the form {name} to the value of property name in the properties set. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PropertyUtilities()
Method Detail |
public static Rectangle getRectangle(Properties prop, String key, Rectangle def)
prop
- The Properties setkey
- the key used to store this propertydef
- a default in case the property cannot be retrievedpublic static void setRectangle(Properties prop, String key, Rectangle rect)
prop
- The Properties setkey
- the key used to store this propertyrect
- the value to storepublic static Color getColor(Properties prop, String key, Color def)
prop
- The Properties setkey
- the key used to store this propertydef
- a default in case the property cannot be retrievedpublic static void setColor(Properties prop, String key, Color c)
prop
- The Properties setkey
- the key used to store this propertyc
- the value to storepublic static String[] getStringArray(Properties prop, String key, String[] def)
prop
- The Properties setkey
- the key used to store this propertydef
- a default in case the property cannot be retrievedpublic static void setStringArray(Properties prop, String key, String[] sa)
prop
- The Properties setkey
- the key used to store this propertysa
- the value to storepublic static String getString(Properties prop, String key, String def)
prop
- The Properties setkey
- the key used to store this propertydef
- a default in case the property cannot be retrievedpublic static void setString(Properties prop, String key, String s)
prop
- The Properties setkey
- the key used to store this propertys
- the value to storepublic static boolean getBoolean(Properties prop, String key, boolean def)
prop
- The Properties setkey
- the key used to store this propertydef
- a default in case the property cannot be retrievedpublic static void setBoolean(Properties prop, String key, boolean value)
prop
- The Properties setkey
- the key used to store this propertyvalue
- the value to storepublic static int getInteger(Properties prop, String key) throws NumberFormatException
prop
- The Properties setkey
- the key used to store this property
NumberFormatException
- if the property retrieved cannot be converted to int
public static int getInteger(Properties prop, String key, int def)
prop
- The Properties setkey
- the key used to store this propertydef
- a default in case the property cannot be retrievedpublic static void setInteger(Properties prop, String key, int i)
prop
- The Properties setkey
- the key used to store this propertyi
- the value to storepublic static void setFloat(Properties prop, String key, float f)
prop
- The Properties setkey
- the key used to store this propertyf
- the value to storepublic static float getFloat(Properties prop, String key, float def)
prop
- The Properties setkey
- the key used to store this propertydef
- a default in case the property cannot be retrievedpublic static void setURL(Properties prop, String key, URL url)
public static URL getURL(Properties prop, String key, URL def)
public static String translate(Properties prop, String in)
prop
- The properties setin
- The string to be translated
|
FreeHEP API Version current |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |