Property wrapping a long value.
The value of a LongProperty can be get and set with get(),
getValue(), set(long), and setValue(Number).
A property can be bound and unbound unidirectional with
bind(ObservableValue) and unbind(). Bidirectional bindings
can be created and removed with bindBidirectional(Property) and
unbindBidirectional(Property).
The context of a LongProperty can be read with getBean()
and getName().
Note
setting or binding this property to a null value will set the property to "0.0". See setValue(java..
javafx.beans.value.ObservableLongValue , javafx.beans.value.WritableLongValue , ReadOnlyLongProperty, Property
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public ObjectProperty | Returns: the newObjectPropertyOverrides javafx. Creates an |
| public void | bindBidirectional(Property<Number> other)
Implements javafx. Create a bidirectional binding between this |
| public static LongProperty | Returns: ALongProperty that wraps the
PropertyThe source property)PropertyReturns a |
| public void | setValue(Number v)
Implements javafx. Set the wrapped value. |
| public String | Returns: a string representation of thisLongProperty object.Overrides javafx. Returns a string representation of this |
| public void | unbindBidirectional(Property<Number> other)
Implements javafx. Removes a bidirectional binding between this |
| LongProperty | back to summary |
|---|---|
| public LongProperty() Creates a default | |
| asObject | back to summary |
|---|---|
| public ObjectProperty Overrides javafx. Creates an Can be used for binding an ObjectProperty to LongProperty. LongProperty longProperty = new SimpleLongProperty(1L); ObjectProperty<Long> objectProperty = new SimpleObjectProperty<>(2L); objectProperty.bind(longProperty.asObject());
| |
| bindBidirectional | back to summary |
|---|---|
| public void bindBidirectional(Property<Number> other) Implements javafx. Doc from javafx. Create a bidirectional binding between this It is possible to have multiple bidirectional bindings of one Property. JavaFX bidirectional binding implementation use weak listeners. This means bidirectional binding does not prevent properties from being garbage collected.
| |
| longProperty | back to summary |
|---|---|
| public static LongProperty longProperty(final Property<Long> property) Returns a This is very useful when bidirectionally binding an ObjectProperty<Long> and a LongProperty. Another approach is to convert the LongProperty to ObjectProperty usingLongProperty longProperty = new SimpleLongProperty(1L); ObjectProperty<Long> objectProperty = new SimpleObjectProperty<>(2L); // Need to keep the reference as bidirectional binding uses weak references LongProperty objectAsLong = LongProperty.longProperty(objectProperty); longProperty.bindBidirectional(objectAsLong); asObject() method.Note null values in the source property will be interpreted as 0L
| |
| setValue | back to summary |
|---|---|
| public void setValue(Number v) Implements javafx. Doc from javafx. Set the wrapped value. Note this method should accept null without throwing an exception, setting "0" instead.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides javafx. Returns a string representation of this | |
| unbindBidirectional | back to summary |
|---|---|
| public void unbindBidirectional(Property<Number> other) Implements javafx. Doc from javafx. Removes a bidirectional binding between this
| |