textbender.g.util.prefs
Class FloatPreference

java.lang.Object
  extended by Preference
      extended by FloatPreference
Direct Known Subclasses:
FloatPreferenceDC

public class FloatPreference
extends Preference

A float in a preference node.


Field Summary
 
Fields inherited from class Preference
key, preferences
 
Constructor Summary
FloatPreference(Preferences preferences, String key, float def)
          Creates a FloatPreference.
 
Method Summary
 float get()
          Retrieves the value of this preference from storage.
 float getDefault()
          Returns the default value of this preference.
 void put(float value)
          Stores a new value for the preference.
 void setDefault(float newDefault)
          Sets the default value, per getDefault().
 
Methods inherited from class Preference
key, preferences, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FloatPreference

public FloatPreference(Preferences preferences,
                       String key,
                       float def)
Creates a FloatPreference.

Parameters:
preferences - per preferences()
key - per key()
def - default per getDefault()
Method Detail

get

public float get()
Retrieves the value of this preference from storage. Equivalent to preferences.getFloat(key,default)

Returns:
value if any was stored; else the default

getDefault

public float getDefault()
Returns the default value of this preference.


setDefault

public void setDefault(float newDefault)
Sets the default value, per getDefault().


put

public void put(float value)
Stores a new value for the preference. Equivalent to preferences.putFloat(key,value).

Parameters:
value - new value of the preference