|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpivot.util.Preferences
public class Preferences
Provides access to application preference data. Preferences are modeled as JSON data and are stored using the JNLP Persistence API. One top-level JSON object exists per URL. The dictionary methods allow a caller to access and modify this data.
Keys may be dot-delimited, allowing callers to get/set nested values.
Constructor Summary | |
---|---|
Preferences(java.net.URL url,
Dictionary<java.lang.String,java.lang.Object> defaults)
Creates a preferences object that provides access to the preferences for a given URL. |
Method Summary | |
---|---|
boolean |
containsKey(java.lang.String key)
Tests the existence of a key in the dictionary. |
java.lang.Object |
get(java.lang.String key)
Retrieves the value for the given key. |
ListenerList<PreferencesListener> |
getPreferencesListeners()
|
boolean |
isEmpty()
Tests the emptiness of the dictionary. |
java.util.Iterator<java.lang.String> |
iterator()
|
java.lang.Object |
put(java.lang.String key,
java.lang.Object value)
Sets the value of the given key, creating a new entry or replacing the existing value. |
java.lang.Object |
remove(java.lang.String key)
Removes a key/value pair from the map. |
void |
save()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Preferences(java.net.URL url, Dictionary<java.lang.String,java.lang.Object> defaults) throws java.io.IOException, SerializationException
url
- defaults
-
java.io.IOException
SerializationException
Method Detail |
---|
public java.lang.Object get(java.lang.String key)
Dictionary
get
in interface Dictionary<java.lang.String,java.lang.Object>
key
- The key whose value is to be returned.
public java.lang.Object put(java.lang.String key, java.lang.Object value)
Dictionary
put
in interface Dictionary<java.lang.String,java.lang.Object>
key
- The key whose value is to be set.value
- The value to be associated with the given key.public java.lang.Object remove(java.lang.String key)
Dictionary
remove
in interface Dictionary<java.lang.String,java.lang.Object>
key
- The key whose mapping is to be removed.
public boolean containsKey(java.lang.String key)
Dictionary
containsKey
in interface Dictionary<java.lang.String,java.lang.Object>
key
- The key whose presence in the dictionary is to be tested.
public boolean isEmpty()
Dictionary
isEmpty
in interface Dictionary<java.lang.String,java.lang.Object>
public void save() throws java.io.IOException, SerializationException
java.io.IOException
SerializationException
public java.util.Iterator<java.lang.String> iterator()
iterator
in interface java.lang.Iterable<java.lang.String>
public ListenerList<PreferencesListener> getPreferencesListeners()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |