Package snap.util
Class Prefs
java.lang.Object
snap.util.Prefs
A platform implementation of preferences.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears all the preferences.void
flush()
Updates any persistant store associated with these preferences.boolean
getBoolean
(String aKey, boolean aDefault) Returns an boolean value for given key.Returns a child prefs for given name.static Prefs
Returns the default prefs.double
Returns a float value for given key.static Prefs
getFake()
Returns a prefs instance that doesn't do anything.int
Returns an int value for given key.abstract String[]
getKeys()
Returns the currently set prefs keys.long
Returns a long value for given key.getName()
Returns the name.static Prefs
getPrefsForName
(String aName) Returns the preferences for given node name.Returns a value for given string.Returns a value for given string and default.Returns a value for given string.abstract Object
Returns a value for given string and default.void
Removes a value for given key.static void
setDefaultPrefs
(Prefs thePrefs) Sets the default preferences instance.abstract void
Sets a value for given string.
-
Constructor Details
-
Prefs
public Prefs()Constructor.
-
-
Method Details
-
getName
Returns the name. -
getValue
Returns a value for given string. -
getValue
Returns a value for given string and default. -
setValue
Sets a value for given string. -
remove
Removes a value for given key. -
getString
Returns a value for given string. -
getString
Returns a value for given string and default. -
getInt
Returns an int value for given key. -
getLong
Returns a long value for given key. -
getDouble
Returns a float value for given key. -
getBoolean
Returns an boolean value for given key. -
getKeys
Returns the currently set prefs keys. -
getChild
Returns a child prefs for given name. -
flush
public void flush()Updates any persistant store associated with these preferences. -
clear
public void clear()Clears all the preferences. -
getDefaultPrefs
Returns the default prefs. -
setDefaultPrefs
Sets the default preferences instance. -
getPrefsForName
Returns the preferences for given node name. -
getFake
Returns a prefs instance that doesn't do anything.
-