|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.horstmann.violet.framework.PreferencesService
public abstract class PreferencesService
A service for storing and loading user preferences. This service uses either the standard Java preferences API or the WebStart persistence service ("muffins").
Constructor Summary | |
---|---|
PreferencesService()
|
Method Summary | |
---|---|
abstract java.lang.String |
get(java.lang.String key,
java.lang.String defval)
Gets a previously stored string from the service. |
static PreferencesService |
getInstance(java.lang.Class appClass)
Gets an instance of the service, suitable for the package of the given class. |
abstract void |
put(java.lang.String key,
java.lang.String value)
Saves a key/value pair for later retrieval. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PreferencesService()
Method Detail |
---|
public static PreferencesService getInstance(java.lang.Class appClass)
appClass
- the main application class (only the package name is used as the path to
app-specific preferences storage)
public abstract java.lang.String get(java.lang.String key, java.lang.String defval)
key
- the key of the stringdefval
- the value to return if no matching value was found
public abstract void put(java.lang.String key, java.lang.String value)
key
- the key of the string to be storedvalue
- the value to to be stored
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |