package info.metadude.android.typedpreferences;

import android.content.SharedPreferences;

/**
 * A wrapper class to store and restore a double value in preferences.
 */
public class DoublePreference implements TypedPreference<Double> {

    protected LongPreference mLongPreference;
    public static final double DEFAULT_VALUE_VALUE = 0d;

    public DoublePreference(SharedPreferences preferences, String key) {
        this(preferences, key, DEFAULT_VALUE_VALUE);
    }

    public DoublePreference(SharedPreferences preferences, String key, double defaultValue) {
        mLongPreference = new LongPreference(preferences, key, Double.doubleToLongBits(defaultValue));
    }

    public Double get() {
        return Double.longBitsToDouble(mLongPreference.get());
    }

    public boolean isSet() {
        return mLongPreference.isSet();
    }

    public void set(Double value) {
        mLongPreference.set(Double.doubleToLongBits(value));
    }

    public void delete() {
        mLongPreference.delete();
    }

}

@@ -336,16 +336,151 @@
  = 0d;%0A%0A
+    /**%0A     * Constructs a %7B@code double%7D preference for the given key%0A     * having the default value set to zero available.%0A     */%0A
     publ
@@ -596,32 +596,155 @@
 _VALUE);%0A    %7D%0A%0A
+    /**%0A     * Constructs a %7B@code double%7D preference for the given key%0A     * having the default value available.%0A     */%0A
     public Doubl
@@ -939,99 +939,325 @@
     
-public Double get() %7B%0A        return Double.longBitsToDouble(mLongPreference.get());%0A    %7D%0A
+/**%0A     * Returns the stored %7B@code double%7D value if it exists%0A     * or the default value.%0A     */%0A    public Double get() %7B%0A        return Double.longBitsToDouble(mLongPreference.get());%0A    %7D%0A%0A    /**%0A     * Returns %7B@code true%7D if some value is stored for%0A     * this preference, otherwise %7B@code false%7D.%0A     */
 %0A   
@@ -1321,32 +1321,94 @@
 isSet();%0A    %7D%0A%0A
+    /**%0A     * Stores the given %7B@code double%7D value.%0A     */%0A
     public void 
@@ -1491,24 +1491,80 @@
 e));%0A    %7D%0A%0A
+    /**%0A     * Removes this preference setting.%0A     */%0A
     public v

Add missing JavaDoc comments to DoublePreference class.