Package snap.util

Class Prefs

java.lang.Object
snap.util.Prefs

public abstract class Prefs extends Object
A platform implementation of preferences.
  • Constructor Details

    • Prefs

      public Prefs()
      Constructor.
  • Method Details

    • getName

      public String getName()
      Returns the name.
    • getValue

      public Object getValue(String aKey)
      Returns a value for given string.
    • getValue

      public abstract Object getValue(String aKey, Object aDefault)
      Returns a value for given string and default.
    • setValue

      public abstract void setValue(String aKey, Object aValue)
      Sets a value for given string.
    • remove

      public void remove(String aKey)
      Removes a value for given key.
    • getString

      public String getString(String aKey)
      Returns a value for given string.
    • getString

      public String getString(String aKey, String aDefault)
      Returns a value for given string and default.
    • getInt

      public int getInt(String aKey, int aDefault)
      Returns an int value for given key.
    • getLong

      public long getLong(String aKey, long aDefault)
      Returns a long value for given key.
    • getDouble

      public double getDouble(String aKey, double aDefault)
      Returns a float value for given key.
    • getBoolean

      public boolean getBoolean(String aKey, boolean aDefault)
      Returns an boolean value for given key.
    • getKeys

      public abstract String[] getKeys()
      Returns the currently set prefs keys.
    • getChild

      public Prefs getChild(String aName)
      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

      public static Prefs getDefaultPrefs()
      Returns the default prefs.
    • setDefaultPrefs

      public static void setDefaultPrefs(Prefs thePrefs)
      Sets the default preferences instance.
    • getPrefsForName

      public static Prefs getPrefsForName(String aName)
      Returns the preferences for given node name.
    • getFake

      public static Prefs getFake()
      Returns a prefs instance that doesn't do anything.