public abstract class FloatExpression extends NumberExpressionBase implements ObservableFloatValue
FloatExpression is a
ObservableFloatValue plus additional convenience
methods to generate bindings in a fluent style.
A concrete sub-class of FloatExpression has to implement the method
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 a constant value. |
FloatBinding |
add(float other)
Creates a new
NumberBinding that calculates
the sum of this NumberExpression and a constant value. |
FloatBinding |
add(int other)
Creates a new
NumberBinding that calculates
the sum of this NumberExpression and a constant value. |
FloatBinding |
add(long other)
Creates a new
NumberBinding that calculates
the sum of this NumberExpression and a constant value. |
ObjectExpression<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 a constant value. |
FloatBinding |
divide(float other)
Creates a new
NumberBinding that calculates
the division of this NumberExpression and a constant value. |
FloatBinding |
divide(int other)
Creates a new
NumberBinding that calculates
the division of this NumberExpression and a constant value. |
FloatBinding |
divide(long other)
Creates a new
NumberBinding that calculates
the division of this NumberExpression and a constant value. |
double |
doubleValue()
Returns the value of this
ObservableNumberValue as a
double. |
static FloatExpression |
floatExpression(ObservableFloatValue value)
Returns a
FloatExpression that wraps a
ObservableFloatValue. |
static <T extends Number> |
floatExpression(ObservableValue<T> value)
Returns a
FloatExpression that wraps an
ObservableValue. |
float |
floatValue()
Returns the value of this
ObservableNumberValue as a
float. |
Float |
getValue()
Returns the current value of this
ObservableValue |
int |
intValue()
Returns the value of this
ObservableNumberValue as an int
. |
long |
longValue()
Returns the value of this
ObservableNumberValue as a long
. |
DoubleBinding |
multiply(double other)
Creates a new
NumberBinding that calculates
the product of this NumberExpression and a constant value. |
FloatBinding |
multiply(float other)
Creates a new
NumberBinding that calculates
the product of this NumberExpression and a constant value. |
FloatBinding |
multiply(int other)
Creates a new
NumberBinding that calculates
the product of this NumberExpression and a constant value. |
FloatBinding |
multiply(long other)
Creates a new
NumberBinding that calculates
the product of this NumberExpression and a constant value. |
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 a constant value. |
FloatBinding |
subtract(float other)
Creates a new
NumberBinding that calculates
the difference of this NumberExpression and a constant value. |
FloatBinding |
subtract(int other)
Creates a new
NumberBinding that calculates
the difference of this NumberExpression and a constant value. |
FloatBinding |
subtract(long other)
Creates a new
NumberBinding that calculates
the difference of this NumberExpression and a constant value. |
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, numberExpression, subtractclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetaddListener, removeListeneraddListener, removeListenerpublic int intValue()
ObservableNumberValueObservableNumberValue as an int
. If the value is not an int, a standard cast is performed.intValue in interface ObservableNumberValueObservableNumberValue as an intpublic long longValue()
ObservableNumberValueObservableNumberValue as a long
. If the value is not a long, a standard cast is performed.longValue in interface ObservableNumberValueObservableNumberValue as a longpublic float floatValue()
ObservableNumberValueObservableNumberValue as a
float. If the value is not a float, a standard cast is
performed.floatValue in interface ObservableNumberValueObservableNumberValue as a
floatpublic double doubleValue()
ObservableNumberValueObservableNumberValue as a
double. If the value is not a double, a standard cast is
performed.doubleValue in interface ObservableNumberValueObservableNumberValue as a
doublepublic Float getValue()
ObservableValueObservableValuegetValue in interface ObservableValue<Number>public static FloatExpression floatExpression(ObservableFloatValue value)
FloatExpression that wraps a
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 ObservableFloatValueFloatExpression that wraps the
ObservableFloatValue if necessaryNullPointerException - if value is nullpublic static <T extends Number> FloatExpression floatExpression(ObservableValue<T> value)
FloatExpression that wraps an
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
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));
value - The source ObservableValueFloatExpression that wraps the
ObservableValue if necessaryNullPointerException - if value is nullpublic FloatBinding negate()
NumberExpressionNumberBinding that calculates
the negation of NumberExpression.negate in interface NumberExpressionNumberBindingpublic DoubleBinding add(double other)
NumberExpressionNumberBinding that calculates
the sum of this NumberExpression and a constant value.add in interface NumberExpressionother - the constant valueNumberBindingpublic FloatBinding add(float other)
NumberExpressionNumberBinding that calculates
the sum of this NumberExpression and a constant value.add in interface NumberExpressionother - the constant valueNumberBindingpublic FloatBinding add(long other)
NumberExpressionNumberBinding that calculates
the sum of this NumberExpression and a constant value.add in interface NumberExpressionother - the constant valueNumberBindingpublic FloatBinding add(int other)
NumberExpressionNumberBinding that calculates
the sum of this NumberExpression and a constant value.add in interface NumberExpressionother - the constant valueNumberBindingpublic DoubleBinding subtract(double other)
NumberExpressionNumberBinding that calculates
the difference of this NumberExpression and a constant value.subtract in interface NumberExpressionother - the constant valueNumberBindingpublic FloatBinding subtract(float other)
NumberExpressionNumberBinding that calculates
the difference of this NumberExpression and a constant value.subtract in interface NumberExpressionother - the constant valueNumberBindingpublic FloatBinding subtract(long other)
NumberExpressionNumberBinding that calculates
the difference of this NumberExpression and a constant value.subtract in interface NumberExpressionother - the constant valueNumberBindingpublic FloatBinding subtract(int other)
NumberExpressionNumberBinding that calculates
the difference of this NumberExpression and a constant value.subtract in interface NumberExpressionother - the constant valueNumberBindingpublic DoubleBinding multiply(double other)
NumberExpressionNumberBinding that calculates
the product of this NumberExpression and a constant value.multiply in interface NumberExpressionother - the constant valueNumberBindingpublic FloatBinding multiply(float other)
NumberExpressionNumberBinding that calculates
the product of this NumberExpression and a constant value.multiply in interface NumberExpressionother - the constant valueNumberBindingpublic FloatBinding multiply(long other)
NumberExpressionNumberBinding that calculates
the product of this NumberExpression and a constant value.multiply in interface NumberExpressionother - the constant valueNumberBindingpublic FloatBinding multiply(int other)
NumberExpressionNumberBinding that calculates
the product of this NumberExpression and a constant value.multiply in interface NumberExpressionother - the constant valueNumberBindingpublic DoubleBinding divide(double other)
NumberExpressionNumberBinding that calculates
the division of this NumberExpression and a constant value.divide in interface NumberExpressionother - the constant valueNumberBindingpublic FloatBinding divide(float other)
NumberExpressionNumberBinding that calculates
the division of this NumberExpression and a constant value.divide in interface NumberExpressionother - the constant valueNumberBindingpublic FloatBinding divide(long other)
NumberExpressionNumberBinding that calculates
the division of this NumberExpression and a constant value.divide in interface NumberExpressionother - the constant valueNumberBindingpublic FloatBinding divide(int other)
NumberExpressionNumberBinding that calculates
the division of this NumberExpression and a constant value.divide in interface NumberExpressionother - the constant valueNumberBindingpublic ObjectExpression<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.ObjectExpressionCopyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.