Class DoubleProperty
java.lang.Object
org.openstreetmap.josm.data.preferences.AbstractProperty<T>
org.openstreetmap.josm.data.preferences.AbstractToStringProperty<Double>
org.openstreetmap.josm.data.preferences.DoubleProperty
A property containing an
Double value.- Since:
- 3246
-
Nested Class Summary
Nested classes/interfaces inherited from class org.openstreetmap.josm.data.preferences.AbstractToStringProperty
AbstractToStringProperty.ChildProperty<T>Nested classes/interfaces inherited from class org.openstreetmap.josm.data.preferences.AbstractProperty
AbstractProperty.InvalidPreferenceValueException, AbstractProperty.ValueChangeEvent<T>, AbstractProperty.ValueChangeListener<T> -
Field Summary
Fields inherited from class org.openstreetmap.josm.data.preferences.AbstractProperty
defaultValue, key, preferences -
Constructor Summary
ConstructorsConstructorDescriptionDoubleProperty(String key, double defaultValue) Constructs a newDoubleProperty. -
Method Summary
Modifier and TypeMethodDescriptionprotected DoublefromString(String string) Converts the string to an object of the given type.get()Replies the value of this property.booleanparseAndPut(String value) parses and saves a double precision valuebooleanSets this property to the specified value.protected StringConverts the string to an object of the given type.Methods inherited from class org.openstreetmap.josm.data.preferences.AbstractToStringProperty
getAsString, getChildProperty, getSpecializedMethods inherited from class org.openstreetmap.josm.data.preferences.AbstractProperty
addListener, addListenerImpl, addWeakListener, cached, equals, getDefaultValue, getKey, getPreferences, hashCode, isSet, remove, removeListener, removeListenerImpl, storeDefaultValue
-
Constructor Details
-
DoubleProperty
Constructs a newDoubleProperty.- Parameters:
key- The property keydefaultValue- The default value
-
-
Method Details
-
get
Description copied from class:AbstractPropertyReplies the value of this property.- Overrides:
getin classAbstractToStringProperty<Double>- Returns:
- the value of this property
-
put
Description copied from class:AbstractPropertySets this property to the specified value.- Overrides:
putin classAbstractToStringProperty<Double>- Parameters:
value- The new value of this property- Returns:
- true if something has changed (i.e. value is different than before)
-
fromString
Description copied from class:AbstractToStringPropertyConverts the string to an object of the given type.- Specified by:
fromStringin classAbstractToStringProperty<Double>- Parameters:
string- The string- Returns:
- The object.
-
toString
Description copied from class:AbstractToStringPropertyConverts the string to an object of the given type.- Specified by:
toStringin classAbstractToStringProperty<Double>- Parameters:
t- The object.- Returns:
- The string representing the object
-
parseAndPut
parses and saves a double precision value- Parameters:
value- the value to be parsed- Returns:
- true - preference value has changed false - parsing failed or preference value has not changed
-