public abstract class FloatExpression extends NumberExpressionBase
FloatExpression
is an
javafx.beans.value.ObservableFloatValue
plus additional convenience
methods to generate bindings in a fluent style.
A concrete sub-class of FloatExpression
has to implement the method
javafx.beans.value.ObservableFloatValue#get()
, which provides the
actual value of this expression.
Constructor and Description |
---|
FloatExpression() |
Modifier and Type | Method and Description |
---|---|
DoubleBinding |
add(double other)
Creates a new
NumberBinding that calculates
the sum of this NumberExpression and another
javafx.beans.value.ObservableNumberValue . |
FloatBinding |
add(float other)
Creates a new
NumberBinding that calculates
the sum of this NumberExpression and another
javafx.beans.value.ObservableNumberValue . |
FloatBinding |
add(int other)
Creates a new
NumberBinding that calculates
the sum of this NumberExpression and another
javafx.beans.value.ObservableNumberValue . |
FloatBinding |
add(long other)
Creates a new
NumberBinding that calculates
the sum of this NumberExpression and another
javafx.beans.value.ObservableNumberValue . |
ObjectExpression<java.lang.Float> |
asObject()
Creates an
ObjectExpression that holds the value
of this FloatExpression . |
DoubleBinding |
divide(double other)
Creates a new
NumberBinding that calculates
the division of this NumberExpression and another
javafx.beans.value.ObservableNumberValue . |
FloatBinding |
divide(float other)
Creates a new
NumberBinding that calculates
the division of this NumberExpression and another
javafx.beans.value.ObservableNumberValue . |
FloatBinding |
divide(int other)
Creates a new
NumberBinding that calculates
the division of this NumberExpression and another
javafx.beans.value.ObservableNumberValue . |
FloatBinding |
divide(long other)
Creates a new
NumberBinding that calculates
the division of this NumberExpression and another
javafx.beans.value.ObservableNumberValue . |
double |
doubleValue() |
static <T extends java.lang.Number> |
floatExpression(<any> value)
Returns a
FloatExpression that wraps an
javafx.beans.value.ObservableValue . |
static FloatExpression |
floatExpression(ObservableFloatValue value)
Returns a
FloatExpression that wraps a
javafx.beans.value.ObservableFloatValue . |
float |
floatValue() |
java.lang.Float |
getValue() |
int |
intValue() |
long |
longValue() |
DoubleBinding |
multiply(double other)
Creates a new
NumberBinding that calculates
the product of this NumberExpression and another
javafx.beans.value.ObservableNumberValue . |
FloatBinding |
multiply(float other)
Creates a new
NumberBinding that calculates
the product of this NumberExpression and another
javafx.beans.value.ObservableNumberValue . |
FloatBinding |
multiply(int other)
Creates a new
NumberBinding that calculates
the product of this NumberExpression and another
javafx.beans.value.ObservableNumberValue . |
FloatBinding |
multiply(long other)
Creates a new
NumberBinding that calculates
the product of this NumberExpression and another
javafx.beans.value.ObservableNumberValue . |
FloatBinding |
negate()
Creates a new
NumberBinding that calculates
the negation of NumberExpression . |
DoubleBinding |
subtract(double other)
Creates a new
NumberBinding that calculates
the difference of this NumberExpression and another
javafx.beans.value.ObservableNumberValue . |
FloatBinding |
subtract(float other)
Creates a new
NumberBinding that calculates
the difference of this NumberExpression and another
javafx.beans.value.ObservableNumberValue . |
FloatBinding |
subtract(int other)
Creates a new
NumberBinding that calculates
the difference of this NumberExpression and another
javafx.beans.value.ObservableNumberValue . |
FloatBinding |
subtract(long other)
Creates a new
NumberBinding that calculates
the difference of this NumberExpression and another
javafx.beans.value.ObservableNumberValue . |
asString, asString, asString, greaterThan, greaterThanOrEqualTo, isEqualTo, isEqualTo, isNotEqualTo, isNotEqualTo, lessThan, lessThanOrEqualTo, numberExpression
public int intValue()
public long longValue()
public float floatValue()
public double doubleValue()
public java.lang.Float getValue()
public static FloatExpression floatExpression(ObservableFloatValue value)
FloatExpression
that wraps a
javafx.beans.value.ObservableFloatValue
. If the
ObservableFloatValue
is already a FloatExpression
, it
will be returned. Otherwise a new
FloatBinding
is created that is bound to the
ObservableFloatValue
.value
- The source ObservableFloatValue
FloatExpression
that wraps the
ObservableFloatValue
if necessaryjava.lang.NullPointerException
- if value
is null
public static <T extends java.lang.Number> FloatExpression floatExpression(<any> value)
FloatExpression
that wraps an
javafx.beans.value.ObservableValue
. If the
ObservableValue
is already a FloatExpression
, it
will be returned. Otherwise a new
FloatBinding
is created that is bound to
the ObservableValue
.
Note: this method can be used to convert an ObjectExpression
or
javafx.beans.property.ObjectProperty
of specific number type to FloatExpression, which
is essentially an ObservableValue<Number>
. See sample below.
Note: null values will be interpreted as 0fFloatProperty floatProperty = new SimpleFloatProperty(1.0f); ObjectProperty<Float> objectProperty = new SimpleObjectProperty<>(2.0f); BooleanBinding binding = floatProperty.greaterThan(FloatExpression.floatExpression(objectProperty));
T
- The type of Number to be wrappedvalue
- The source ObservableValue
FloatExpression
that wraps the
ObservableValue
if necessaryjava.lang.NullPointerException
- if value
is null
public FloatBinding negate()
NumberExpression
NumberBinding
that calculates
the negation of NumberExpression
.NumberBinding
public DoubleBinding add(double other)
NumberExpression
NumberBinding
that calculates
the sum of this NumberExpression
and another
javafx.beans.value.ObservableNumberValue
.add
in interface NumberExpression
add
in class NumberExpressionBase
other
- the second ObservableNumberValue
NumberBinding
public FloatBinding add(float other)
NumberExpression
NumberBinding
that calculates
the sum of this NumberExpression
and another
javafx.beans.value.ObservableNumberValue
.add
in interface NumberExpression
add
in class NumberExpressionBase
other
- the second ObservableNumberValue
NumberBinding
public FloatBinding add(long other)
NumberExpression
NumberBinding
that calculates
the sum of this NumberExpression
and another
javafx.beans.value.ObservableNumberValue
.add
in interface NumberExpression
add
in class NumberExpressionBase
other
- the second ObservableNumberValue
NumberBinding
public FloatBinding add(int other)
NumberExpression
NumberBinding
that calculates
the sum of this NumberExpression
and another
javafx.beans.value.ObservableNumberValue
.add
in interface NumberExpression
add
in class NumberExpressionBase
other
- the second ObservableNumberValue
NumberBinding
public DoubleBinding subtract(double other)
NumberExpression
NumberBinding
that calculates
the difference of this NumberExpression
and another
javafx.beans.value.ObservableNumberValue
.subtract
in interface NumberExpression
subtract
in class NumberExpressionBase
other
- the second ObservableNumberValue
NumberBinding
public FloatBinding subtract(float other)
NumberExpression
NumberBinding
that calculates
the difference of this NumberExpression
and another
javafx.beans.value.ObservableNumberValue
.subtract
in interface NumberExpression
subtract
in class NumberExpressionBase
other
- the second ObservableNumberValue
NumberBinding
public FloatBinding subtract(long other)
NumberExpression
NumberBinding
that calculates
the difference of this NumberExpression
and another
javafx.beans.value.ObservableNumberValue
.subtract
in interface NumberExpression
subtract
in class NumberExpressionBase
other
- the second ObservableNumberValue
NumberBinding
public FloatBinding subtract(int other)
NumberExpression
NumberBinding
that calculates
the difference of this NumberExpression
and another
javafx.beans.value.ObservableNumberValue
.subtract
in interface NumberExpression
subtract
in class NumberExpressionBase
other
- the second ObservableNumberValue
NumberBinding
public DoubleBinding multiply(double other)
NumberExpression
NumberBinding
that calculates
the product of this NumberExpression
and another
javafx.beans.value.ObservableNumberValue
.multiply
in interface NumberExpression
multiply
in class NumberExpressionBase
other
- the second ObservableNumberValue
NumberBinding
public FloatBinding multiply(float other)
NumberExpression
NumberBinding
that calculates
the product of this NumberExpression
and another
javafx.beans.value.ObservableNumberValue
.multiply
in interface NumberExpression
multiply
in class NumberExpressionBase
other
- the second ObservableNumberValue
NumberBinding
public FloatBinding multiply(long other)
NumberExpression
NumberBinding
that calculates
the product of this NumberExpression
and another
javafx.beans.value.ObservableNumberValue
.multiply
in interface NumberExpression
multiply
in class NumberExpressionBase
other
- the second ObservableNumberValue
NumberBinding
public FloatBinding multiply(int other)
NumberExpression
NumberBinding
that calculates
the product of this NumberExpression
and another
javafx.beans.value.ObservableNumberValue
.multiply
in interface NumberExpression
multiply
in class NumberExpressionBase
other
- the second ObservableNumberValue
NumberBinding
public DoubleBinding divide(double other)
NumberExpression
NumberBinding
that calculates
the division of this NumberExpression
and another
javafx.beans.value.ObservableNumberValue
.divide
in interface NumberExpression
divide
in class NumberExpressionBase
other
- the second ObservableNumberValue
NumberBinding
public FloatBinding divide(float other)
NumberExpression
NumberBinding
that calculates
the division of this NumberExpression
and another
javafx.beans.value.ObservableNumberValue
.divide
in interface NumberExpression
divide
in class NumberExpressionBase
other
- the second ObservableNumberValue
NumberBinding
public FloatBinding divide(long other)
NumberExpression
NumberBinding
that calculates
the division of this NumberExpression
and another
javafx.beans.value.ObservableNumberValue
.divide
in interface NumberExpression
divide
in class NumberExpressionBase
other
- the second ObservableNumberValue
NumberBinding
public FloatBinding divide(int other)
NumberExpression
NumberBinding
that calculates
the division of this NumberExpression
and another
javafx.beans.value.ObservableNumberValue
.divide
in interface NumberExpression
divide
in class NumberExpressionBase
other
- the second ObservableNumberValue
NumberBinding
public ObjectExpression<java.lang.Float> asObject()
ObjectExpression
that holds the value
of this FloatExpression
. If the
value of this FloatExpression
changes, the value of the
ObjectExpression
will be updated automatically.ObjectExpression