Class LongProperty
- java.lang.Object
-
- org.openstreetmap.josm.data.preferences.AbstractProperty<T>
-
- org.openstreetmap.josm.data.preferences.AbstractToStringProperty<Long>
-
- org.openstreetmap.josm.data.preferences.LongProperty
-
public class LongProperty extends AbstractToStringProperty<Long>
A property containing anLong
value.- Since:
- 10087
-
-
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 LongProperty(String key, long defaultValue)
Constructs a newLongProperty
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Long
fromString(String string)
Converts the string to an object of the given type.Long
get()
Replies the value of this property.boolean
put(Long value)
Sets this property to the specified value.protected String
toString(Long 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
-
LongProperty
public LongProperty(String key, long defaultValue)
Constructs a newLongProperty
- Parameters:
key
- property keydefaultValue
- default value
-
-
Method Detail
-
get
public Long get()
Description copied from class:AbstractProperty
Replies the value of this property.- Overrides:
get
in classAbstractToStringProperty<Long>
- Returns:
- the value of this property
-
put
public boolean put(Long value)
Description copied from class:AbstractProperty
Sets this property to the specified value.- Overrides:
put
in classAbstractToStringProperty<Long>
- Parameters:
value
- The new value of this property- Returns:
- true if something has changed (i.e. value is different than before)
-
fromString
protected Long fromString(String string)
Description copied from class:AbstractToStringProperty
Converts the string to an object of the given type.- Specified by:
fromString
in classAbstractToStringProperty<Long>
- Parameters:
string
- The string- Returns:
- The object.
-
toString
protected String toString(Long t)
Description copied from class:AbstractToStringProperty
Converts the string to an object of the given type.- Specified by:
toString
in classAbstractToStringProperty<Long>
- Parameters:
t
- The object.- Returns:
- The string representing the object
-
-