|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.freehep.application.PropertyUtilities
public abstract class 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 double |
getDouble(Properties prop,
String key,
double 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 long |
getLong(Properties prop,
String key,
long 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 Collection |
getStringCollection(Properties prop,
String key,
Collection 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 |
setDouble(Properties prop,
String key,
double f)
|
static void |
setFloat(Properties prop,
String key,
float f)
|
static void |
setInteger(Properties prop,
String key,
int i)
|
static void |
setLong(Properties prop,
String key,
long 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 |
setStringCollection(Properties prop,
String key,
Collection sa)
|
static void |
setURL(Properties prop,
String key,
URL url)
|
static boolean |
touchBoolean(Properties prop,
String key,
boolean defaultValue)
Returns boolean value stored in the specified properties set with the given key. |
static Color |
touchColor(Properties prop,
String key,
Color defaultValue)
Returns Color stored in the specified properties set with the given key. |
static double |
touchDouble(Properties prop,
String key,
double defaultValue)
Returns double value stored in the specified properties set with the given key. |
static float |
touchFloat(Properties prop,
String key,
float defaultValue)
Returns float value stored in the specified properties set with the given key. |
static int |
touchInteger(Properties prop,
String key,
int defaultValue)
Returns int value stored in the specified properties set with the given key. |
static long |
touchLong(Properties prop,
String key,
long defaultValue)
Returns long value stored in the specified properties set with the given key. |
static Rectangle |
touchRectangle(Properties prop,
String key,
Rectangle defaultValue)
Returns Rectangle stored in the specified properties set with the given key. |
static String |
touchString(Properties prop,
String key,
String defaultValue)
Returns String stored in the specified properties set with the given key. |
static String[] |
touchStringArray(Properties prop,
String key,
String[] defaultValue)
Returns String array stored in the specified properties set with the given key. |
static Collection |
touchStringCollection(Properties prop,
String key,
Collection defaultValue)
Returns String collection stored in the specified properties set with the given key. |
static URL |
touchURL(Properties prop,
String key,
URL defaultValue)
Returns URL value stored in the specified properties set with the given key. |
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 |
---|
equals, 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 Rectangle touchRectangle(Properties prop, String key, Rectangle defaultValue)
public 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 Color touchColor(Properties prop, String key, Color defaultValue)
public 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 Collection getStringCollection(Properties prop, String key, Collection def)
prop
- The Properties setkey
- the key used to store this propertydef
- a default in case the property cannot be retrievedpublic static Collection touchStringCollection(Properties prop, String key, Collection defaultValue)
public static void setStringCollection(Properties prop, String key, Collection sa)
prop
- The Properties setkey
- the key used to store this propertysa
- 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 String[] touchStringArray(Properties prop, String key, String[] defaultValue)
public 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 propertydefaultValue
- a default in case the property cannot be retrievedpublic static String touchString(Properties prop, String key, String defaultValue)
public 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 boolean touchBoolean(Properties prop, String key, boolean defaultValue)
public 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 int touchInteger(Properties prop, String key, int defaultValue)
public 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 long getLong(Properties prop, String key, long def)
prop
- The Properties setkey
- the key used to store this propertydef
- a default in case the property cannot be retrievedpublic static long touchLong(Properties prop, String key, long defaultValue)
public static void setLong(Properties prop, String key, long i)
prop
- The Properties setkey
- the key used to store this propertyi
- 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 float touchFloat(Properties prop, String key, float defaultValue)
public 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 double getDouble(Properties prop, String key, double def)
prop
- The Properties setkey
- the key used to store this propertydef
- a default in case the property cannot be retrievedpublic static double touchDouble(Properties prop, String key, double defaultValue)
public static void setDouble(Properties prop, String key, double f)
prop
- The Properties setkey
- the key used to store this propertyf
- the value to storepublic static URL getURL(Properties prop, String key, URL def)
public static URL touchURL(Properties prop, String key, URL defaultValue)
public static void setURL(Properties prop, String key, URL url)
public static String translate(Properties prop, String in)
prop
- The properties setin
- The string to be translated
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |