Changeset 10824 in josm for trunk/src/org/openstreetmap/josm/data/preferences/DoubleProperty.java
- Timestamp:
- 2016-08-17T09:18:31+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/preferences/DoubleProperty.java
r9818 r10824 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.data.preferences; 3 4 import org.openstreetmap.josm.Main;5 3 6 4 /** … … 8 6 * @since 3246 9 7 */ 10 public class DoubleProperty extends Abstract Property<Double> {8 public class DoubleProperty extends AbstractToStringProperty<Double> { 11 9 12 10 /** … … 21 19 @Override 22 20 public Double get() { 23 return Main.pref.getDouble(getKey(), getDefaultValue()); 21 // Removing this implementation breaks binary compatibility 22 return super.get(); 24 23 } 25 24 26 25 @Override 27 26 public boolean put(Double value) { 28 return Main.pref.putDouble(getKey(), value); 27 // Removing this implementation breaks binary compatibility 28 return super.put(value); 29 } 30 31 @Override 32 protected Double fromString(String string) { 33 try { 34 return Double.valueOf(string); 35 } catch (NumberFormatException e) { 36 throw new InvalidPreferenceValueException(e); 37 } 38 } 39 40 @Override 41 protected String toString(Double t) { 42 return t.toString(); 29 43 } 30 44
Note:
See TracChangeset
for help on using the changeset viewer.