List of utility methods to do Preference Get
String | get(String key, String defaultValue) get return reg.get(key, defaultValue);
|
Preferences | getAltNode(final String name) get Alt Node return Preferences.userRoot().node("/com/affymetrix/" + name); |
boolean | getBoolean(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; |
String | getCLOB(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; ... |
Preferences | getClobStorage(Preferences prefs, String key) get Clob Storage return prefs.node(key + "_clob"); |
Preferences | getDefault() get Default Preferences userRoot = userRoot(); return userRoot.node("com").node("kyj").node("gagoyle"); |
Float | getFloat(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; |
int | getInt(final Class> preferencesClass, final String preferenceName) get Int final Preferences preferences = getPreferences(preferencesClass); return preferences.getInt(preferenceName, 0); |
ArrayList | getList(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) { ... |
Preferences | getNode(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); |