Package javafx.beans.binding
Class LongExpression
java.lang.Object
javafx.beans.binding.NumberExpressionBase
javafx.beans.binding.LongExpression
- All Implemented Interfaces:
NumberExpression,Observable,ObservableLongValue,ObservableNumberValue,ObservableValue<Number>
- Direct Known Subclasses:
LongBinding,ReadOnlyLongProperty
LongExpression is an ObservableLongValue
plus additional convenience methods to generate bindings in a fluent style.
A concrete sub-class of LongExpression has to implement the method
ObservableLongValue.get(), which provides the
actual value of this expression.
- Since:
- JavaFX 2.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of thisObservableNumberValueas adouble.floatReturns the value of thisObservableNumberValueas afloat.getValue()Returns the current value of thisObservableValueintintValue()Returns the value of thisObservableNumberValueas anint.static LongExpressionReturns aLongExpressionthat wraps aObservableLongValue.static <T extends Number>
LongExpressionlongExpression(ObservableValue<T> value) Returns aLongExpressionthat wraps anObservableValue.longReturns the value of thisObservableNumberValueas along.Methods inherited from class javafx.beans.binding.NumberExpressionBase
asStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javafx.beans.Observable
addListener, removeListenerMethods inherited from interface javafx.beans.value.ObservableLongValue
getMethods inherited from interface javafx.beans.value.ObservableValue
addListener, removeListener
-
Constructor Details
-
LongExpression
public LongExpression()
-
-
Method Details
-
intValue
public int intValue()Description copied from interface:ObservableNumberValueReturns the value of thisObservableNumberValueas anint. If the value is not anint, a standard cast is performed.- Specified by:
intValuein interfaceObservableNumberValue- Returns:
- The value of this
ObservableNumberValueas anint
-
longValue
public long longValue()Description copied from interface:ObservableNumberValueReturns the value of thisObservableNumberValueas along. If the value is not along, a standard cast is performed.- Specified by:
longValuein interfaceObservableNumberValue- Returns:
- The value of this
ObservableNumberValueas along
-
floatValue
public float floatValue()Description copied from interface:ObservableNumberValueReturns the value of thisObservableNumberValueas afloat. If the value is not afloat, a standard cast is performed.- Specified by:
floatValuein interfaceObservableNumberValue- Returns:
- The value of this
ObservableNumberValueas afloat
-
doubleValue
public double doubleValue()Description copied from interface:ObservableNumberValueReturns the value of thisObservableNumberValueas adouble. If the value is not adouble, a standard cast is performed.- Specified by:
doubleValuein interfaceObservableNumberValue- Returns:
- The value of this
ObservableNumberValueas adouble
-
getValue
Description copied from interface:ObservableValueReturns the current value of thisObservableValue- Specified by:
getValuein interfaceObservableValue<Number>- Returns:
- The current value
-
longExpression
Returns aLongExpressionthat wraps aObservableLongValue. If theObservableLongValueis already aLongExpression, it will be returned. Otherwise a newLongBindingis created that is bound to theObservableLongValue.- Parameters:
value- The sourceObservableLongValue- Returns:
- A
LongExpressionthat wraps theObservableLongValueif necessary - Throws:
NullPointerException- ifvalueisnull
-
longExpression
Returns aLongExpressionthat wraps anObservableValue. If theObservableValueis already aLongExpression, it will be returned. Otherwise a newLongBindingis created that is bound to theObservableValue.Note: this method can be used to convert an
ObjectExpressionorObjectPropertyof specific number type to LongExpression, which is essentially anObservableValue<Number>. See sample below.
Note: null values will be interpreted as 0LLongProperty longProperty = new SimpleLongProperty(1L); ObjectProperty<Long> objectProperty = new SimpleObjectProperty<>(2L); BooleanBinding binding = longProperty.greaterThan(LongExpression.longExpression(objectProperty));
- Type Parameters:
T- The type of Number to be wrapped- Parameters:
value- The sourceObservableValue- Returns:
- A
LongExpressionthat wraps theObservableValueif necessary - Throws:
NullPointerException- ifvalueisnull- Since:
- JavaFX 8.0
-