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
public abstract class LongExpression extends NumberExpressionBase implements ObservableLongValue
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 Constructor Description LongExpression()Creates a defaultLongExpression. -
Method Summary
Modifier and Type Method Description DoubleBindingadd(double other)Creates a newNumberBindingthat calculates the sum of thisNumberExpressionand a constant value.FloatBindingadd(float other)Creates a newNumberBindingthat calculates the sum of thisNumberExpressionand a constant value.LongBindingadd(int other)Creates a newNumberBindingthat calculates the sum of thisNumberExpressionand a constant value.LongBindingadd(long other)Creates a newNumberBindingthat calculates the sum of thisNumberExpressionand a constant value.ObjectExpression<Long>asObject()Creates anObjectExpressionthat holds the value of thisLongExpression.DoubleBindingdivide(double other)Creates a newNumberBindingthat calculates the division of thisNumberExpressionand a constant value.FloatBindingdivide(float other)Creates a newNumberBindingthat calculates the division of thisNumberExpressionand a constant value.LongBindingdivide(int other)Creates a newNumberBindingthat calculates the division of thisNumberExpressionand a constant value.LongBindingdivide(long other)Creates a newNumberBindingthat calculates the division of thisNumberExpressionand a constant value.static LongExpressionlongExpression(ObservableLongValue value)Returns aLongExpressionthat wraps aObservableLongValue.static <T extends Number>
LongExpressionlongExpression(ObservableValue<T> value)Returns aLongExpressionthat wraps anObservableValue.DoubleBindingmultiply(double other)Creates a newNumberBindingthat calculates the product of thisNumberExpressionand a constant value.FloatBindingmultiply(float other)Creates a newNumberBindingthat calculates the product of thisNumberExpressionand a constant value.LongBindingmultiply(int other)Creates a newNumberBindingthat calculates the product of thisNumberExpressionand a constant value.LongBindingmultiply(long other)Creates a newNumberBindingthat calculates the product of thisNumberExpressionand a constant value.LongBindingnegate()Creates a newNumberBindingthat calculates the negation ofNumberExpression.DoubleBindingsubtract(double other)Creates a newNumberBindingthat calculates the difference of thisNumberExpressionand a constant value.FloatBindingsubtract(float other)Creates a newNumberBindingthat calculates the difference of thisNumberExpressionand a constant value.LongBindingsubtract(int other)Creates a newNumberBindingthat calculates the difference of thisNumberExpressionand a constant value.LongBindingsubtract(long other)Creates a newNumberBindingthat calculates the difference of thisNumberExpressionand a constant value.Methods declared in class javafx.beans.binding.NumberExpressionBase
numberExpressionMethods declared in class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods declared in interface javafx.beans.binding.NumberExpression
add, asString, asString, asString, divide, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThanOrEqualTo, greaterThanOrEqualTo, greaterThanOrEqualTo, greaterThanOrEqualTo, greaterThanOrEqualTo, isEqualTo, isEqualTo, isEqualTo, isEqualTo, isEqualTo, isEqualTo, isEqualTo, isEqualTo, isNotEqualTo, isNotEqualTo, isNotEqualTo, isNotEqualTo, isNotEqualTo, isNotEqualTo, isNotEqualTo, isNotEqualTo, lessThan, lessThan, lessThan, lessThan, lessThan, lessThanOrEqualTo, lessThanOrEqualTo, lessThanOrEqualTo, lessThanOrEqualTo, lessThanOrEqualTo, multiply, subtractMethods declared in interface javafx.beans.Observable
addListener, removeListenerMethods declared in interface javafx.beans.value.ObservableLongValue
getMethods declared in interface javafx.beans.value.ObservableNumberValue
doubleValue, floatValue, intValue, longValueMethods declared in interface javafx.beans.value.ObservableValue
addListener, getValue, removeListener
-
Constructor Details
-
LongExpression
public LongExpression()Creates a defaultLongExpression.
-
-
Method Details
-
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
-
negate
Description copied from interface:NumberExpressionCreates a newNumberBindingthat calculates the negation ofNumberExpression.- Specified by:
negatein interfaceNumberExpression- Returns:
- the new
NumberBinding
-
add
Description copied from interface:NumberExpressionCreates a newNumberBindingthat calculates the sum of thisNumberExpressionand a constant value.- Specified by:
addin interfaceNumberExpression- Parameters:
other- the constant value- Returns:
- the new
NumberBinding
-
add
Description copied from interface:NumberExpressionCreates a newNumberBindingthat calculates the sum of thisNumberExpressionand a constant value.- Specified by:
addin interfaceNumberExpression- Parameters:
other- the constant value- Returns:
- the new
NumberBinding
-
add
Description copied from interface:NumberExpressionCreates a newNumberBindingthat calculates the sum of thisNumberExpressionand a constant value.- Specified by:
addin interfaceNumberExpression- Parameters:
other- the constant value- Returns:
- the new
NumberBinding
-
add
Description copied from interface:NumberExpressionCreates a newNumberBindingthat calculates the sum of thisNumberExpressionand a constant value.- Specified by:
addin interfaceNumberExpression- Parameters:
other- the constant value- Returns:
- the new
NumberBinding
-
subtract
Description copied from interface:NumberExpressionCreates a newNumberBindingthat calculates the difference of thisNumberExpressionand a constant value.- Specified by:
subtractin interfaceNumberExpression- Parameters:
other- the constant value- Returns:
- the new
NumberBinding
-
subtract
Description copied from interface:NumberExpressionCreates a newNumberBindingthat calculates the difference of thisNumberExpressionand a constant value.- Specified by:
subtractin interfaceNumberExpression- Parameters:
other- the constant value- Returns:
- the new
NumberBinding
-
subtract
Description copied from interface:NumberExpressionCreates a newNumberBindingthat calculates the difference of thisNumberExpressionand a constant value.- Specified by:
subtractin interfaceNumberExpression- Parameters:
other- the constant value- Returns:
- the new
NumberBinding
-
subtract
Description copied from interface:NumberExpressionCreates a newNumberBindingthat calculates the difference of thisNumberExpressionand a constant value.- Specified by:
subtractin interfaceNumberExpression- Parameters:
other- the constant value- Returns:
- the new
NumberBinding
-
multiply
Description copied from interface:NumberExpressionCreates a newNumberBindingthat calculates the product of thisNumberExpressionand a constant value.- Specified by:
multiplyin interfaceNumberExpression- Parameters:
other- the constant value- Returns:
- the new
NumberBinding
-
multiply
Description copied from interface:NumberExpressionCreates a newNumberBindingthat calculates the product of thisNumberExpressionand a constant value.- Specified by:
multiplyin interfaceNumberExpression- Parameters:
other- the constant value- Returns:
- the new
NumberBinding
-
multiply
Description copied from interface:NumberExpressionCreates a newNumberBindingthat calculates the product of thisNumberExpressionand a constant value.- Specified by:
multiplyin interfaceNumberExpression- Parameters:
other- the constant value- Returns:
- the new
NumberBinding
-
multiply
Description copied from interface:NumberExpressionCreates a newNumberBindingthat calculates the product of thisNumberExpressionand a constant value.- Specified by:
multiplyin interfaceNumberExpression- Parameters:
other- the constant value- Returns:
- the new
NumberBinding
-
divide
Description copied from interface:NumberExpressionCreates a newNumberBindingthat calculates the division of thisNumberExpressionand a constant value.- Specified by:
dividein interfaceNumberExpression- Parameters:
other- the constant value- Returns:
- the new
NumberBinding
-
divide
Description copied from interface:NumberExpressionCreates a newNumberBindingthat calculates the division of thisNumberExpressionand a constant value.- Specified by:
dividein interfaceNumberExpression- Parameters:
other- the constant value- Returns:
- the new
NumberBinding
-
divide
Description copied from interface:NumberExpressionCreates a newNumberBindingthat calculates the division of thisNumberExpressionand a constant value.- Specified by:
dividein interfaceNumberExpression- Parameters:
other- the constant value- Returns:
- the new
NumberBinding
-
divide
Description copied from interface:NumberExpressionCreates a newNumberBindingthat calculates the division of thisNumberExpressionand a constant value.- Specified by:
dividein interfaceNumberExpression- Parameters:
other- the constant value- Returns:
- the new
NumberBinding
-
asObject
Creates anObjectExpressionthat holds the value of thisLongExpression. If the value of thisLongExpressionchanges, the value of theObjectExpressionwill be updated automatically.- Returns:
- the new
ObjectExpression - Since:
- JavaFX 8.0
-