Interface ObservableNumberValue
- All Superinterfaces:
Observable, ObservableValue<Number>
- All Known Subinterfaces:
NumberBinding, NumberExpression, ObservableDoubleValue, ObservableFloatValue, ObservableIntegerValue, ObservableLongValue
- All Known Implementing Classes:
DoubleBinding, DoubleExpression, DoubleProperty, DoublePropertyBase, FloatBinding, FloatExpression, FloatProperty, FloatPropertyBase, IntegerBinding, IntegerExpression, IntegerProperty, IntegerPropertyBase, JavaBeanDoubleProperty, JavaBeanFloatProperty, JavaBeanIntegerProperty, JavaBeanLongProperty, LongBinding, LongExpression, LongProperty, LongPropertyBase, NumberExpressionBase, ReadOnlyDoubleProperty, ReadOnlyDoublePropertyBase, ReadOnlyDoubleWrapper, ReadOnlyFloatProperty, ReadOnlyFloatPropertyBase, ReadOnlyFloatWrapper, ReadOnlyIntegerProperty, ReadOnlyIntegerPropertyBase, ReadOnlyIntegerWrapper, ReadOnlyJavaBeanDoubleProperty, ReadOnlyJavaBeanFloatProperty, ReadOnlyJavaBeanIntegerProperty, ReadOnlyJavaBeanLongProperty, ReadOnlyLongProperty, ReadOnlyLongPropertyBase, ReadOnlyLongWrapper, SimpleDoubleProperty, SimpleFloatProperty, SimpleIntegerProperty, SimpleLongProperty, SimpleStyleableDoubleProperty, SimpleStyleableFloatProperty, SimpleStyleableIntegerProperty, SimpleStyleableLongProperty, StyleableDoubleProperty, StyleableFloatProperty, StyleableIntegerProperty, StyleableLongProperty
A common interface of all sub-interfaces of
ObservableValue that wrap
a number.- Since:
- JavaFX 2.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of thisObservableNumberValueas adouble.floatReturns the value of thisObservableNumberValueas afloat.intintValue()Returns the value of thisObservableNumberValueas anint.longReturns the value of thisObservableNumberValueas along.Methods declared in interface Observable
addListener, removeListener, subscribeModifier and TypeMethodDescriptionvoidaddListener(InvalidationListener listener) Adds anInvalidationListenerwhich will be notified whenever theObservablebecomes invalid.voidremoveListener(InvalidationListener listener) Removes the given listener from the list of listeners, that are notified whenever the value of theObservablebecomes invalid.default SubscriptionCreates aSubscriptionon thisObservablewhich callsinvalidationSubscriberwhenever it becomes invalid.Methods declared in interface ObservableValue
addListener, flatMap, getValue, map, orElse, removeListener, subscribe, subscribe, whenModifier and TypeMethodDescriptionvoidaddListener(ChangeListener<? super Number> listener) Adds aChangeListenerwhich will be notified whenever the value of theObservableValuechanges.default <U> ObservableValue<U> flatMap(Function<? super Number, ? extends ObservableValue<? extends U>> mapper) Returns anObservableValuethat holds the value of anObservableValueproduced by applying the given mapping function on this value.getValue()Returns the current value of thisObservableValuedefault <U> ObservableValue<U> Returns anObservableValuethat holds the result of applying the given mapping function on this value.default ObservableValue<Number> Returns anObservableValuethat holds this value, or the given constant if it isnull.voidremoveListener(ChangeListener<? super Number> listener) Removes the given listener from the list of listeners that are notified whenever the value of theObservableValuechanges.default Subscriptionsubscribe(BiConsumer<? super Number, ? super Number> changeSubscriber) Creates aSubscriptionon thisObservableValuewhich calls the givenchangeSubscriberwith the old and new value whenever its value changes.default SubscriptionCreates aSubscriptionon thisObservableValuewhich immediately provides the current value to the givenvalueSubscriber, followed by any subsequent values whenever its value changes.default ObservableValue<Number> when(ObservableValue<Boolean> condition) Returns anObservableValuethat holds this value and is updated only whenconditionholdstrue.
-
Method Details
-
intValue
int intValue()Returns the value of thisObservableNumberValueas anint. If the value is not anint, a standard cast is performed.- Returns:
- The value of this
ObservableNumberValueas anint
-
longValue
long longValue()Returns the value of thisObservableNumberValueas along. If the value is not along, a standard cast is performed.- Returns:
- The value of this
ObservableNumberValueas along
-
floatValue
float floatValue()Returns the value of thisObservableNumberValueas afloat. If the value is not afloat, a standard cast is performed.- Returns:
- The value of this
ObservableNumberValueas afloat
-
doubleValue
double doubleValue()Returns the value of thisObservableNumberValueas adouble. If the value is not adouble, a standard cast is performed.- Returns:
- The value of this
ObservableNumberValueas adouble
-