public abstract class DoubleExpression extends NumberExpressionBase implements ObservableDoubleValue
DoubleExpression is a
ObservableDoubleValue plus additional convenience
methods to generate bindings in a fluent style.
A concrete sub-class of DoubleExpression has to implement the method
ObservableDoubleValue.get(), which provides the
actual value of this expression.
| Constructor and Description |
|---|
DoubleExpression() |
| 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. |
DoubleBinding |
add(float other)
Creates a new
NumberBinding that calculates
the sum of this NumberExpression and a constant value. |
DoubleBinding |
add(int other)
Creates a new
NumberBinding that calculates
the sum of this NumberExpression and a constant value. |
DoubleBinding |
add(long other)
Creates a new
NumberBinding that calculates
the sum of this NumberExpression and a constant value. |
DoubleBinding |
add(ObservableNumberValue other)
Creates a new
NumberBinding that calculates
the sum of this NumberExpression and another
ObservableNumberValue. |
ObjectExpression<Double> |
asObject()
Creates an
ObjectExpression that holds the value
of this DoubleExpression. |
DoubleBinding |
divide(double other)
Creates a new
NumberBinding that calculates
the division of this NumberExpression and a constant value. |
DoubleBinding |
divide(float other)
Creates a new
NumberBinding that calculates
the division of this NumberExpression and a constant value. |
DoubleBinding |
divide(int other)
Creates a new
NumberBinding that calculates
the division of this NumberExpression and a constant value. |
DoubleBinding |
divide(long other)
Creates a new
NumberBinding that calculates
the division of this NumberExpression and a constant value. |
DoubleBinding |
divide(ObservableNumberValue other)
Creates a new
NumberBinding that calculates
the division of this NumberExpression and another
ObservableNumberValue. |
static DoubleExpression |
doubleExpression(ObservableDoubleValue value)
Returns a
DoubleExpression that wraps a
ObservableDoubleValue. |
static <T extends Number> |
doubleExpression(ObservableValue<T> value)
Returns a
DoubleExpression that wraps an
ObservableValue. |
double |
doubleValue()
Returns the value of this
ObservableNumberValue as a
double. |
float |
floatValue()
Returns the value of this
ObservableNumberValue as a
float. |
Double |
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. |
DoubleBinding |
multiply(float other)
Creates a new
NumberBinding that calculates
the product of this NumberExpression and a constant value. |
DoubleBinding |
multiply(int other)
Creates a new
NumberBinding that calculates
the product of this NumberExpression and a constant value. |
DoubleBinding |
multiply(long other)
Creates a new
NumberBinding that calculates
the product of this NumberExpression and a constant value. |
DoubleBinding |
multiply(ObservableNumberValue other)
Creates a new
NumberBinding that calculates
the product of this NumberExpression and another
ObservableNumberValue. |
DoubleBinding |
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. |
DoubleBinding |
subtract(float other)
Creates a new
NumberBinding that calculates
the difference of this NumberExpression and a constant value. |
DoubleBinding |
subtract(int other)
Creates a new
NumberBinding that calculates
the difference of this NumberExpression and a constant value. |
DoubleBinding |
subtract(long other)
Creates a new
NumberBinding that calculates
the difference of this NumberExpression and a constant value. |
DoubleBinding |
subtract(ObservableNumberValue other)
Creates a new
NumberBinding that calculates
the difference of this NumberExpression and another
ObservableNumberValue. |
asString, asString, asString, 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, numberExpressionclone, 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 Double getValue()
ObservableValueObservableValuegetValue in interface ObservableValue<Number>public static DoubleExpression doubleExpression(ObservableDoubleValue value)
DoubleExpression that wraps a
ObservableDoubleValue. If the
ObservableDoubleValue is already a DoubleExpression, it
will be returned. Otherwise a new
DoubleBinding is created that is bound to
the ObservableDoubleValue.value - The source ObservableDoubleValueDoubleExpression that wraps the
ObservableDoubleValue if necessaryNullPointerException - if value is nullpublic static <T extends Number> DoubleExpression doubleExpression(ObservableValue<T> value)
DoubleExpression that wraps an
ObservableValue. If the
ObservableValue is already a DoubleExpression, it
will be returned. Otherwise a new
DoubleBinding 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 DoubleExpression, which
is essentially an ObservableValue<Number>. See sample below.
Note: null values will be interpreted as 0.0DoubleProperty doubleProperty = new SimpleDoubleProperty(1.0); ObjectProperty<Double> objectProperty = new SimpleObjectProperty<>(2.0); BooleanBinding binding = doubleProperty.greaterThan(DoubleExpression.doubleExpression(objectProperty));
value - The source ObservableValueDoubleExpression that wraps the
ObservableValue if necessaryNullPointerException - if value is nullpublic DoubleBinding negate()
NumberExpressionNumberBinding that calculates
the negation of NumberExpression.negate in interface NumberExpressionNumberBindingpublic DoubleBinding add(ObservableNumberValue other)
NumberExpressionNumberBinding that calculates
the sum of this NumberExpression and another
ObservableNumberValue.add in interface NumberExpressionadd in class NumberExpressionBaseother - the second ObservableNumberValueNumberBindingpublic DoubleBinding add(double other)
NumberExpressionNumberBinding that calculates
the sum of this NumberExpression and a constant value.add in interface NumberExpressionother - the constant valueNumberBindingpublic DoubleBinding add(float other)
NumberExpressionNumberBinding that calculates
the sum of this NumberExpression and a constant value.add in interface NumberExpressionother - the constant valueNumberBindingpublic DoubleBinding add(long other)
NumberExpressionNumberBinding that calculates
the sum of this NumberExpression and a constant value.add in interface NumberExpressionother - the constant valueNumberBindingpublic DoubleBinding add(int other)
NumberExpressionNumberBinding that calculates
the sum of this NumberExpression and a constant value.add in interface NumberExpressionother - the constant valueNumberBindingpublic DoubleBinding subtract(ObservableNumberValue other)
NumberExpressionNumberBinding that calculates
the difference of this NumberExpression and another
ObservableNumberValue.subtract in interface NumberExpressionsubtract in class NumberExpressionBaseother - the second ObservableNumberValueNumberBindingpublic DoubleBinding subtract(double other)
NumberExpressionNumberBinding that calculates
the difference of this NumberExpression and a constant value.subtract in interface NumberExpressionother - the constant valueNumberBindingpublic DoubleBinding subtract(float other)
NumberExpressionNumberBinding that calculates
the difference of this NumberExpression and a constant value.subtract in interface NumberExpressionother - the constant valueNumberBindingpublic DoubleBinding subtract(long other)
NumberExpressionNumberBinding that calculates
the difference of this NumberExpression and a constant value.subtract in interface NumberExpressionother - the constant valueNumberBindingpublic DoubleBinding subtract(int other)
NumberExpressionNumberBinding that calculates
the difference of this NumberExpression and a constant value.subtract in interface NumberExpressionother - the constant valueNumberBindingpublic DoubleBinding multiply(ObservableNumberValue other)
NumberExpressionNumberBinding that calculates
the product of this NumberExpression and another
ObservableNumberValue.multiply in interface NumberExpressionmultiply in class NumberExpressionBaseother - the second ObservableNumberValueNumberBindingpublic DoubleBinding multiply(double other)
NumberExpressionNumberBinding that calculates
the product of this NumberExpression and a constant value.multiply in interface NumberExpressionother - the constant valueNumberBindingpublic DoubleBinding multiply(float other)
NumberExpressionNumberBinding that calculates
the product of this NumberExpression and a constant value.multiply in interface NumberExpressionother - the constant valueNumberBindingpublic DoubleBinding multiply(long other)
NumberExpressionNumberBinding that calculates
the product of this NumberExpression and a constant value.multiply in interface NumberExpressionother - the constant valueNumberBindingpublic DoubleBinding multiply(int other)
NumberExpressionNumberBinding that calculates
the product of this NumberExpression and a constant value.multiply in interface NumberExpressionother - the constant valueNumberBindingpublic DoubleBinding divide(ObservableNumberValue other)
NumberExpressionNumberBinding that calculates
the division of this NumberExpression and another
ObservableNumberValue.divide in interface NumberExpressiondivide in class NumberExpressionBaseother - the second ObservableNumberValueNumberBindingpublic DoubleBinding divide(double other)
NumberExpressionNumberBinding that calculates
the division of this NumberExpression and a constant value.divide in interface NumberExpressionother - the constant valueNumberBindingpublic DoubleBinding divide(float other)
NumberExpressionNumberBinding that calculates
the division of this NumberExpression and a constant value.divide in interface NumberExpressionother - the constant valueNumberBindingpublic DoubleBinding divide(long other)
NumberExpressionNumberBinding that calculates
the division of this NumberExpression and a constant value.divide in interface NumberExpressionother - the constant valueNumberBindingpublic DoubleBinding divide(int other)
NumberExpressionNumberBinding that calculates
the division of this NumberExpression and a constant value.divide in interface NumberExpressionother - the constant valueNumberBindingpublic ObjectExpression<Double> asObject()
ObjectExpression that holds the value
of this DoubleExpression. If the
value of this DoubleExpression changes, the value of the
ObjectExpression will be updated automatically.ObjectExpressionCopyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.