|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openbandy.service.Service org.openbandy.service.PreferencesService
public class PreferencesService
This is a helper class to simplify (and abstract) the usage of the preference
class by providing static methods.
Note: Unlike as within the Preferences class itself, we are allowed to use
the LogService here, as the Log itself does not use the PreferencesService
but rather Preferences directly.
(c) Copyright Philipp Bolliger 2008, ALL RIGHTS RESERVED.
Preferences
Constructor Summary | |
---|---|
PreferencesService()
|
Method Summary | |
---|---|
static void |
add(java.lang.String name,
boolean screenModifiable)
Add a new preference to the persistent store with the given name. |
static boolean |
getBooleanValue(java.lang.String name)
Reads the boolean preference with the given name from the persistent store. |
static int |
getIntValue(java.lang.String name)
Reads the int preference with the given name from the persistent store. |
static java.lang.String |
getValue(java.lang.String name)
Reads the String preference with the given name from the persistent store. |
static void |
remove(java.lang.String name)
Remove the preference with the given name from the persistent store. |
static void |
setBooleanValue(java.lang.String name,
boolean value)
Set the value of the preference that is identified with the given name string to the given value. |
static void |
setIntValue(java.lang.String name,
int value)
Set the value of the preference that is identified with the given name string to the given value. |
static void |
setValue(java.lang.String name,
java.lang.String value)
Set the value of the preference that is identified with the given name string to the given value. |
Methods inherited from class org.openbandy.service.Service |
---|
runningOnMicroEdition, runningOnSunWTK |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PreferencesService()
Method Detail |
---|
public static void add(java.lang.String name, boolean screenModifiable)
name
- The (unique) string used to identify the preference.screenModifiable
- screenModifiable if true, the preference will appear in the
preferences form screenpublic static void remove(java.lang.String name)
name
- The (unique) string used to identify the preference.public static java.lang.String getValue(java.lang.String name)
name
- The (unique) name description of the stored preference value
public static int getIntValue(java.lang.String name)
name
- The (unique) name description of the stored preference value
0
if no int value is stored
with the given namepublic static boolean getBooleanValue(java.lang.String name)
name
- The (unique) name description of the stored preference value
false
if no boolean value is
stored with the given namepublic static void setValue(java.lang.String name, java.lang.String value)
name
- The (unique) name description of the stored preference valuevalue
- The value to be setpublic static void setIntValue(java.lang.String name, int value)
name
- The (unique) name description of the stored preference valuevalue
- The int value to be setpublic static void setBooleanValue(java.lang.String name, boolean value)
name
- The (unique) name description of the stored preference valuevalue
- The boolean value to be set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |