public class Preferences extends Object
Modifier and Type | Method and Description |
---|---|
static void |
clearAll()
Remove all preferences
|
static void |
delete(String pref)
Deletes a value for the given setting
|
static boolean |
get(String pref,
boolean def)
Gets the value as a number
|
static double |
get(String pref,
double def)
Gets the value as a number
|
static float |
get(String pref,
float def)
Gets the value as a number
|
static int |
get(String pref,
int def)
Gets the value as a number
|
static long |
get(String pref,
long def)
Gets the value as a number
|
static String |
get(String pref,
String def)
Gets the value as a String
|
static void |
set(String pref,
boolean b)
Sets a preference value
|
static void |
set(String pref,
double d)
Sets a preference value
|
static void |
set(String pref,
float f)
Sets a preference value
|
static void |
set(String pref,
int i)
Sets a preference value
|
static void |
set(String pref,
long l)
Sets a preference value
|
static void |
set(String pref,
String s)
Sets a preference value
|
public static void set(String pref, String s)
pref
- the key any unique none null value that doesn't start with cn1s
- a Stringpublic static void set(String pref, int i)
pref
- the key any unique none null value that doesn't start with cn1i
- a numberpublic static void set(String pref, long l)
pref
- the key any unique none null value that doesn't start with cn1l
- a numberpublic static void set(String pref, double d)
pref
- the key any unique none null value that doesn't start with cn1d
- a numberpublic static void set(String pref, float f)
pref
- the key any unique none null value that doesn't start with cn1f
- a numberpublic static void delete(String pref)
pref
- the preference valuepublic static void clearAll()
public static void set(String pref, boolean b)
pref
- the key any unique none null value that doesn't start with cn1o
- a Stringpublic static String get(String pref, String def)
pref
- the preference keydef
- the default valuepublic static int get(String pref, int def)
pref
- the preference keydef
- the default valuepublic static long get(String pref, long def)
pref
- the preference keydef
- the default valuepublic static double get(String pref, double def)
pref
- the preference keydef
- the default valuepublic static float get(String pref, float def)
pref
- the preference keydef
- the default valuepublic static boolean get(String pref, boolean def)
pref
- the preference keydef
- the default value