Class DoubleProperty
- java.lang.Object
-
- org.openstreetmap.josm.data.preferences.AbstractProperty<T>
-
- org.openstreetmap.josm.data.preferences.AbstractToStringProperty<java.lang.Double>
-
- org.openstreetmap.josm.data.preferences.DoubleProperty
-
public class DoubleProperty extends AbstractToStringProperty<java.lang.Double>
A property containing anDoublevalue.- 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
Constructors Constructor Description DoubleProperty(java.lang.String key, double defaultValue)Constructs a newDoubleProperty.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.DoublefromString(java.lang.String string)Converts the string to an object of the given type.java.lang.Doubleget()Replies the value of this property.booleanparseAndPut(java.lang.String value)parses and saves a double precision valuebooleanput(java.lang.Double value)Sets this property to the specified value.protected java.lang.StringtoString(java.lang.Double t)Converts the string to an object of the given type.-
Methods inherited from class org.openstreetmap.josm.data.preferences.AbstractToStringProperty
getAsString, getChildProperty, getSpecialized
-
Methods inherited from class org.openstreetmap.josm.data.preferences.AbstractProperty
addListener, addListenerImpl, addWeakListener, cached, equals, getDefaultValue, getKey, getPreferences, hashCode, isSet, remove, removeListener, removeListenerImpl, storeDefaultValue
-
-
-
-
Constructor Detail
-
DoubleProperty
public DoubleProperty(java.lang.String key, double defaultValue)
Constructs a newDoubleProperty.- Parameters:
key- The property keydefaultValue- The default value
-
-
Method Detail
-
get
public java.lang.Double get()
Description copied from class:AbstractPropertyReplies the value of this property.- Overrides:
getin classAbstractToStringProperty<java.lang.Double>- Returns:
- the value of this property
-
put
public boolean put(java.lang.Double value)
Description copied from class:AbstractPropertySets this property to the specified value.- Overrides:
putin classAbstractToStringProperty<java.lang.Double>- Parameters:
value- The new value of this property- Returns:
- true if something has changed (i.e. value is different than before)
-
fromString
protected java.lang.Double fromString(java.lang.String string)
Description copied from class:AbstractToStringPropertyConverts the string to an object of the given type.- Specified by:
fromStringin classAbstractToStringProperty<java.lang.Double>- Parameters:
string- The string- Returns:
- The object.
-
toString
protected java.lang.String toString(java.lang.Double t)
Description copied from class:AbstractToStringPropertyConverts the string to an object of the given type.- Specified by:
toStringin classAbstractToStringProperty<java.lang.Double>- Parameters:
t- The object.- Returns:
- The string representing the object
-
parseAndPut
public boolean parseAndPut(java.lang.String value)
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
-
-