Java Utililty Methods Preference Get

List of utility methods to do Preference Get

Description

The list of methods to do Preference Get are organized into topic(s).

Method

Stringget(String key, String defaultValue)
get
return reg.get(key, defaultValue);
PreferencesgetAltNode(final String name)
get Alt Node
return Preferences.userRoot().node("/com/affymetrix/" + name);
booleangetBoolean(final String key, final boolean defaultValue)
Gets a boolean value from the preferences object
try {
    return prefs.getBoolean(key, defaultValue);
} catch (Exception e) {
    return defaultValue;
StringgetCLOB(Preferences prefs, String key, String def)
Returns the character large object (CLOB) associated with the specified key in the given preference node.
String checkVal = prefs.get(key, null);
if (checkVal == null)
    return def;
else if (!isCheckVal(checkVal))
    return checkVal;
Preferences p = getClobStorage(prefs, key);
StringBuffer buf = new StringBuffer();
int num = 0;
...
PreferencesgetClobStorage(Preferences prefs, String key)
get Clob Storage
return prefs.node(key + "_clob");
PreferencesgetDefault()
get Default
Preferences userRoot = userRoot();
return userRoot.node("com").node("kyj").node("gagoyle");
FloatgetFloat(String key, Float def)
Get the value of the specified Float preference.
String propVal = System.getProperty(key);
Float retVal = null;
if (propVal != null) {
    try {
        retVal = Float.parseFloat(propVal);
    } catch (NumberFormatException nfe) {
        nfe.printStackTrace();
if (retVal == null) {
    retVal = getUserPreferences().getFloat(key, def);
return retVal;
intgetInt(final Class preferencesClass, final String preferenceName)
get Int
final Preferences preferences = getPreferences(preferencesClass);
return preferences.getInt(preferenceName, 0);
ArrayListgetList(String path)
Get a list of strings from preferences.
Preferences prefs = getNode(path);
if (prefs == null)
    return new ArrayList<String>();
int size = prefs.getInt("size", 0);
if (size <= 0)
    return new ArrayList<String>();
ArrayList<String> result = new ArrayList<String>(size);
for (int i = 0; i < size; ++i) {
...
PreferencesgetNode(String path)
Get node for package and path, return null if not already existing.
assert !path.startsWith("/");
Preferences prefs = Preferences.userRoot();
try {
    if (!prefs.nodeExists(path))
        return null;
} catch (BackingStoreException e) {
    return null;
return prefs.node(path);