properties.SparseSegmentDensityThreshold.get(); if (densityThreshold < 0) { densityThreshold = 0;
/** * Sets the value of this double property. The value is limited to the * min/max range given during construction. * * @return the previous value, or if not set: the default value. If no * default value exists, 0.0 if that value is in the range [minValue, * maxValue], or minValue if 0.0 is not in the range */ public double set(double value) { String prevValue = setString(Double.toString(limit(value))); if (prevValue == null) { prevValue = getDefaultValue(); if (prevValue == null) { return noValue(); } } double v = Double.parseDouble(prevValue); 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); }
/** * 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); }