/** * Retrieves the value of this double property. If the property has no * value, returns the default value. If there is no default value, returns * the given default value. In all cases, the returned value is limited to * the min/max value range given during construction. */ public double get(double defaultValue) { final String value = getInternal( Double.toString(defaultValue), false); if (value == null) { return limit(defaultValue); } double v = Double.parseDouble(value); // need to limit value in case setString() was called directly with // an out-of-range value return limit(v); }
/** * Retrieves the value of this double property according to these rules. * * <ul> * <li>If the property has no value, returns the default value.</li> * <li>If there is no default value and {@link #minValue} <= 0.0 <= * {@link #maxValue}, returns 0.0.</li> * <li>If there is no default value and 0.0 is not in the min/max range, * returns {@link #minValue}.</li> * </ul> */ public double get() { final String value = getInternal(null, false); if (value == null) { return noValue(); } double v = Double.parseDouble(value); return limit(v); }