|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.prefs.Preferences
org.base.apps.beans.prefs.BasePreferences
public class BasePreferences
Extends Preferences to provide utility methods and key tracking.
| Field Summary | |
|---|---|
static String |
STRING_ARRAY_DELIMITER
|
| Fields inherited from class java.util.prefs.Preferences |
|---|
MAX_KEY_LENGTH, MAX_NAME_LENGTH, MAX_VALUE_LENGTH |
| Constructor Summary | |
|---|---|
BasePreferences(Preferences delegate)
|
|
| Method Summary | |
|---|---|
String |
absolutePath()
|
void |
addNodeChangeListener(NodeChangeListener ncl)
|
void |
addPreferenceChangeListener(PreferenceChangeListener pcl)
|
String[] |
childrenNames()
|
void |
clear()
|
boolean |
equals(Object obj)
|
void |
exportNode(OutputStream os)
|
void |
exportSubtree(OutputStream os)
|
void |
flush()
|
String |
get(String key,
String def)
|
String[] |
getArray(String key,
String... def)
Returns the array associated with the specified key in this preference node. |
boolean |
getBoolean(String key,
boolean def)
|
byte[] |
getByteArray(String key,
byte[] def)
|
Collection<String> |
getCollection(String key,
Collection<String> def)
Returns the Collection associated with the specified key in this preference node. |
protected Preferences |
getDelegate()
|
double |
getDouble(String key,
double def)
|
float |
getFloat(String key,
float def)
|
int |
getInt(String key,
int def)
|
long |
getLong(String key,
long def)
|
Map<String,String> |
getMap(String key,
Map<String,String> def)
Returns the Map associated with the specified key in this preference node. |
Class<?> |
getType(String key,
Class<?> def)
Returns the class associated with the specified key in this preference node. |
int |
hashCode()
|
boolean |
isUserNode()
|
String[] |
keys()
|
String |
name()
|
BasePreferences |
node(String pathName)
Returns a BasePreferences instance of this node's child. |
boolean |
nodeExists(String pathName)
|
BasePreferences |
parent()
Returns a BasePreferences instance of this node's parent. |
void |
put(String key,
String value)
|
void |
putArray(String key,
String[] value)
Associates the array associated with the specified key in this preference node. |
void |
putBoolean(String key,
boolean value)
|
void |
putByteArray(String key,
byte[] value)
|
void |
putCollection(String key,
Collection<String> value)
Associates the Collection associated with the specified key in this preference node. |
void |
putDouble(String key,
double value)
|
void |
putFloat(String key,
float value)
|
void |
putInt(String key,
int value)
|
void |
putLong(String key,
long value)
|
void |
putMap(String key,
Map<String,String> value)
Associates the map associated with the specified key in this preference node. |
void |
putType(String key,
Class<?> type)
Associates the class associated with the specified key in this preference node. |
void |
remove(String key)
|
void |
removeNode()
|
void |
removeNodeChangeListener(NodeChangeListener ncl)
|
void |
removePreferenceChangeListener(PreferenceChangeListener pcl)
|
protected void |
setDelegate(Preferences delegate)
|
void |
sync()
|
String |
toString()
|
| Methods inherited from class java.util.prefs.Preferences |
|---|
importPreferences, systemNodeForPackage, systemRoot, userNodeForPackage, userRoot |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static String STRING_ARRAY_DELIMITER
| Constructor Detail |
|---|
public BasePreferences(Preferences delegate)
| Method Detail |
|---|
public void putArray(String key,
String[] value)
key - The specified key.value - The given array.
public String[] getArray(String key,
String... def)
key - The specified key.def - The value to be returned in the event that this preference
node has no value associated with key or the
associated value cannot be interpreted as an array, or the
backing store is inaccessible.
public void putCollection(String key,
Collection<String> value)
Collection associated with the specified key in this preference node.
key - The specified key.value - The given Collection.
public Collection<String> getCollection(String key,
Collection<String> def)
Collection associated with the specified key in this preference node.
key - The specified key.def - The value to be returned in the event that this preference
node has no value associated with key or the
associated value cannot be interpreted as a Collection,
or the backing store is inaccessible.
Collection associated with the specified key or the default value.
public void putMap(String key,
Map<String,String> value)
key - The specified key.value - The given map.
public Map<String,String> getMap(String key,
Map<String,String> def)
Map associated with the specified key in this preference node.
key - The specified key.def - The value to be returned in the event that this preference
node has no value associated with key or the
associated value cannot be interpreted as a Map,
or the backing store is inaccessible.
public void putType(String key,
Class<?> type)
key - The specified key.type - The given class.
public Class<?> getType(String key,
Class<?> def)
key - The specified key.def - The value to be returned in the event that this preference
node has no value associated with key or the
associated value cannot be interpreted as a class,
or the backing store is inaccessible.
public int hashCode()
hashCode in class ObjectObject.hashCode()public boolean equals(Object obj)
equals in class ObjectObject.equals(java.lang.Object)
public void put(String key,
String value)
put in class PreferencesPreferences.put(java.lang.String, java.lang.String)
public String get(String key,
String def)
get in class PreferencesPreferences.get(java.lang.String, java.lang.String)public void remove(String key)
remove in class PreferencesPreferences.remove(java.lang.String)
public void clear()
throws BackingStoreException
clear in class PreferencesBackingStoreExceptionPreferences.clear()
public void putInt(String key,
int value)
putInt in class PreferencesPreferences.putInt(java.lang.String, int)
public int getInt(String key,
int def)
getInt in class PreferencesPreferences.getInt(java.lang.String, int)
public void putLong(String key,
long value)
putLong in class PreferencesPreferences.putLong(java.lang.String, long)
public long getLong(String key,
long def)
getLong in class PreferencesPreferences.getLong(java.lang.String, long)
public void putBoolean(String key,
boolean value)
putBoolean in class PreferencesPreferences.putBoolean(java.lang.String, boolean)
public boolean getBoolean(String key,
boolean def)
getBoolean in class PreferencesPreferences.getBoolean(java.lang.String, boolean)
public void putFloat(String key,
float value)
putFloat in class PreferencesPreferences.putFloat(java.lang.String, float)
public float getFloat(String key,
float def)
getFloat in class PreferencesPreferences.getFloat(java.lang.String, float)
public void putDouble(String key,
double value)
putDouble in class PreferencesPreferences.putDouble(java.lang.String, double)
public double getDouble(String key,
double def)
getDouble in class PreferencesPreferences.getDouble(java.lang.String, double)
public void putByteArray(String key,
byte[] value)
putByteArray in class PreferencesPreferences.putByteArray(java.lang.String, byte[])
public byte[] getByteArray(String key,
byte[] def)
getByteArray in class PreferencesPreferences.getByteArray(java.lang.String, byte[])
public String[] keys()
throws BackingStoreException
keys in class PreferencesBackingStoreExceptionPreferences.keys()
public String[] childrenNames()
throws BackingStoreException
childrenNames in class PreferencesBackingStoreExceptionPreferences.childrenNames()public BasePreferences parent()
BasePreferences instance of this node's parent.
parent in class PreferencesBasePreferences instance of this node's parent.Preferences.parent()public BasePreferences node(String pathName)
BasePreferences instance of this node's child.
node in class PreferencespathName - The child's path.
BasePreferences instance of this node's child.Preferences.node(java.lang.String)
public boolean nodeExists(String pathName)
throws BackingStoreException
nodeExists in class PreferencesBackingStoreExceptionPreferences.nodeExists(java.lang.String)
public void removeNode()
throws BackingStoreException
removeNode in class PreferencesBackingStoreExceptionPreferences.removeNode()public String name()
name in class PreferencesPreferences.name()public String absolutePath()
absolutePath in class PreferencesPreferences.absolutePath()public boolean isUserNode()
isUserNode in class PreferencesPreferences.isUserNode()public String toString()
toString in class PreferencesPreferences.toString()
public void flush()
throws BackingStoreException
flush in class PreferencesBackingStoreExceptionPreferences.flush()
public void sync()
throws BackingStoreException
sync in class PreferencesBackingStoreExceptionPreferences.sync()public void addPreferenceChangeListener(PreferenceChangeListener pcl)
addPreferenceChangeListener in class PreferencesPreferences.addPreferenceChangeListener(java.util.prefs.PreferenceChangeListener)public void removePreferenceChangeListener(PreferenceChangeListener pcl)
removePreferenceChangeListener in class PreferencesPreferences.removePreferenceChangeListener(java.util.prefs.PreferenceChangeListener)public void addNodeChangeListener(NodeChangeListener ncl)
addNodeChangeListener in class PreferencesPreferences.addNodeChangeListener(java.util.prefs.NodeChangeListener)public void removeNodeChangeListener(NodeChangeListener ncl)
removeNodeChangeListener in class PreferencesPreferences.removeNodeChangeListener(java.util.prefs.NodeChangeListener)
public void exportNode(OutputStream os)
throws IOException,
BackingStoreException
exportNode in class PreferencesIOException
BackingStoreExceptionPreferences.exportNode(java.io.OutputStream)
public void exportSubtree(OutputStream os)
throws IOException,
BackingStoreException
exportSubtree in class PreferencesIOException
BackingStoreExceptionPreferences.exportSubtree(java.io.OutputStream)protected Preferences getDelegate()
protected void setDelegate(Preferences delegate)
delegate - the delegate to set
|
Please visit Base Apps, hosted on Sourceforge.net. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||