Top Description Constructors Methods
javafx.beans.binding

public abstract Class DoubleExpression

extends NumberExpressionBase
implements ObservableDoubleValue
Class Inheritance
All Implemented Interfaces
javafx.beans.value.ObservableDoubleValue, javafx.beans.value.ObservableNumberValue, javafx.beans.value.ObservableValue, javafx.beans.Observable
Known Direct Subclasses
javafx.beans.property.ReadOnlyDoubleProperty, javafx.beans.binding.DoubleBinding
Imports
javafx.beans.value.ObservableDoubleValue, .ObservableNumberValue, .ObservableValue, javafx.collections.FXCollections, .ObservableList

DoubleExpression is an javafx.beans.value.ObservableDoubleValue plus additional convenience methods to generate bindings in a fluent style.

A concrete sub-class of DoubleExpression has to implement the method javafx.beans.value.ObservableDoubleValue#get(), which provides the actual value of this expression.

Since
JavaFX 2.0

Constructor Summary

AccessConstructor and Description
public
DoubleExpression()

Creates a default DoubleExpression.

Method Summary

Modifier and TypeMethod and Description
public DoubleBinding
add(final ObservableNumberValue
the second ObservableNumberValue
other
)

Overrides javafx.beans.binding.NumberExpressionBase.add.

Implements javafx.beans.binding.NumberExpression.add.

Creates a new javafx.beans.binding.NumberBinding that calculates the sum of this NumberExpression and another javafx.beans.value.ObservableNumberValue.

public DoubleBinding
add(final double
the constant value
other
)

Implements javafx.beans.binding.NumberExpression.add.

Creates a new javafx.beans.binding.NumberBinding that calculates the sum of this NumberExpression and a constant value.

public DoubleBinding
add(final float
the constant value
other
)

Implements javafx.beans.binding.NumberExpression.add.

Creates a new javafx.beans.binding.NumberBinding that calculates the sum of this NumberExpression and a constant value.

public DoubleBinding
add(final long
the constant value
other
)

Implements javafx.beans.binding.NumberExpression.add.

Creates a new javafx.beans.binding.NumberBinding that calculates the sum of this NumberExpression and a constant value.

public DoubleBinding
add(final int
the constant value
other
)

Implements javafx.beans.binding.NumberExpression.add.

Creates a new javafx.beans.binding.NumberBinding that calculates the sum of this NumberExpression and a constant value.

public ObjectExpression<Double>

Returns:

the new ObjectExpression
asObject
()

Creates an javafx.beans.binding.ObjectExpression that holds the value of this DoubleExpression.

public DoubleBinding
divide(final ObservableNumberValue
the second ObservableNumberValue
other
)

Overrides javafx.beans.binding.NumberExpressionBase.divide.

Implements javafx.beans.binding.NumberExpression.divide.

Creates a new javafx.beans.binding.NumberBinding that calculates the division of this NumberExpression and another javafx.beans.value.ObservableNumberValue.

public DoubleBinding
divide(final double
the constant value
other
)

Implements javafx.beans.binding.NumberExpression.divide.

Creates a new javafx.beans.binding.NumberBinding that calculates the division of this NumberExpression and a constant value.

public DoubleBinding
divide(final float
the constant value
other
)

Implements javafx.beans.binding.NumberExpression.divide.

Creates a new javafx.beans.binding.NumberBinding that calculates the division of this NumberExpression and a constant value.

public DoubleBinding
divide(final long
the constant value
other
)

Implements javafx.beans.binding.NumberExpression.divide.

Creates a new javafx.beans.binding.NumberBinding that calculates the division of this NumberExpression and a constant value.

public DoubleBinding
divide(final int
the constant value
other
)

Implements javafx.beans.binding.NumberExpression.divide.

Creates a new javafx.beans.binding.NumberBinding that calculates the division of this NumberExpression and a constant value.

public static DoubleExpression

Returns:

A DoubleExpression that wraps the ObservableDoubleValue if necessary
doubleExpression
(final ObservableDoubleValue
The source ObservableDoubleValue
value
)

Returns a DoubleExpression that wraps a javafx.beans.value.ObservableDoubleValue.

public static <
The type of Number to be wrapped
T extends Number
>
DoubleExpression

Returns:

A DoubleExpression that wraps the ObservableValue if necessary
doubleExpression
(final ObservableValue<T>
The source ObservableValue
value
)

Returns a DoubleExpression that wraps an javafx.beans.value.ObservableValue.

public double
doubleValue()

Implements javafx.beans.value.ObservableNumberValue.doubleValue.

Returns the value of this ObservableNumberValue as a double.

public float
floatValue()

Implements javafx.beans.value.ObservableNumberValue.floatValue.

Returns the value of this ObservableNumberValue as a float.

public Double
getValue()

Implements javafx.beans.value.ObservableValue.getValue.

Returns the current value of this ObservableValue

public int
intValue()

Implements javafx.beans.value.ObservableNumberValue.intValue.

Returns the value of this ObservableNumberValue as an int .

public long
longValue()

Implements javafx.beans.value.ObservableNumberValue.longValue.

Returns the value of this ObservableNumberValue as a long .

public DoubleBinding
multiply(final ObservableNumberValue
the second ObservableNumberValue
other
)

Overrides javafx.beans.binding.NumberExpressionBase.multiply.

Implements javafx.beans.binding.NumberExpression.multiply.

Creates a new javafx.beans.binding.NumberBinding that calculates the product of this NumberExpression and another javafx.beans.value.ObservableNumberValue.

public DoubleBinding
multiply(final double
the constant value
other
)

Implements javafx.beans.binding.NumberExpression.multiply.

Creates a new javafx.beans.binding.NumberBinding that calculates the product of this NumberExpression and a constant value.

public DoubleBinding
multiply(final float
the constant value
other
)

Implements javafx.beans.binding.NumberExpression.multiply.

Creates a new javafx.beans.binding.NumberBinding that calculates the product of this NumberExpression and a constant value.

public DoubleBinding
multiply(final long
the constant value
other
)

Implements javafx.beans.binding.NumberExpression.multiply.

Creates a new javafx.beans.binding.NumberBinding that calculates the product of this NumberExpression and a constant value.

public DoubleBinding
multiply(final int
the constant value
other
)

Implements javafx.beans.binding.NumberExpression.multiply.

Creates a new javafx.beans.binding.NumberBinding that calculates the product of this NumberExpression and a constant value.

public DoubleBinding
negate()

Implements javafx.beans.binding.NumberExpression.negate.

Creates a new javafx.beans.binding.NumberBinding that calculates the negation of NumberExpression.

public DoubleBinding
subtract(final ObservableNumberValue
the second ObservableNumberValue
other
)

Overrides javafx.beans.binding.NumberExpressionBase.subtract.

Implements javafx.beans.binding.NumberExpression.subtract.

Creates a new javafx.beans.binding.NumberBinding that calculates the difference of this NumberExpression and another javafx.beans.value.ObservableNumberValue.

public DoubleBinding
subtract(final double
the constant value
other
)

Implements javafx.beans.binding.NumberExpression.subtract.

Creates a new javafx.beans.binding.NumberBinding that calculates the difference of this NumberExpression and a constant value.

public DoubleBinding
subtract(final float
the constant value
other
)

Implements javafx.beans.binding.NumberExpression.subtract.

Creates a new javafx.beans.binding.NumberBinding that calculates the difference of this NumberExpression and a constant value.

public DoubleBinding
subtract(final long
the constant value
other
)

Implements javafx.beans.binding.NumberExpression.subtract.

Creates a new javafx.beans.binding.NumberBinding that calculates the difference of this NumberExpression and a constant value.

public DoubleBinding
subtract(final int
the constant value
other
)

Implements javafx.beans.binding.NumberExpression.subtract.

Creates a new javafx.beans.binding.NumberBinding that calculates the difference of this NumberExpression and a constant value.

Inherited from javafx.beans.binding.NumberExpressionBase:
asStringasStringasStringgreaterThangreaterThangreaterThangreaterThangreaterThangreaterThanOrEqualTogreaterThanOrEqualTogreaterThanOrEqualTogreaterThanOrEqualTogreaterThanOrEqualToisEqualToisEqualToisEqualToisEqualToisEqualToisEqualToisEqualToisEqualToisNotEqualToisNotEqualToisNotEqualToisNotEqualToisNotEqualToisNotEqualToisNotEqualToisNotEqualTolessThanlessThanlessThanlessThanlessThanlessThanOrEqualTolessThanOrEqualTolessThanOrEqualTolessThanOrEqualTolessThanOrEqualTonumberExpression

Constructor Detail

DoubleExpressionback to summary
public DoubleExpression()

Creates a default DoubleExpression.

Method Detail

addback to summary
public DoubleBinding add(final ObservableNumberValue other)

Overrides javafx.beans.binding.NumberExpressionBase.add.

Implements javafx.beans.binding.NumberExpression.add.

Doc from javafx.beans.binding.NumberExpression.add.

Creates a new javafx.beans.binding.NumberBinding that calculates the sum of this NumberExpression and another javafx.beans.value.ObservableNumberValue.

Parameters
other:ObservableNumberValue

the second ObservableNumberValue

Returns:DoubleBinding

the new NumberBinding

Annotations
@Override
addback to summary
public DoubleBinding add(final double other)

Implements javafx.beans.binding.NumberExpression.add.

Doc from javafx.beans.binding.NumberExpression.add.

Creates a new javafx.beans.binding.NumberBinding that calculates the sum of this NumberExpression and a constant value.

Parameters
other:double

the constant value

Returns:DoubleBinding

the new NumberBinding

Annotations
@Override
addback to summary
public DoubleBinding add(final float other)

Implements javafx.beans.binding.NumberExpression.add.

Doc from javafx.beans.binding.NumberExpression.add.

Creates a new javafx.beans.binding.NumberBinding that calculates the sum of this NumberExpression and a constant value.

Parameters
other:float

the constant value

Returns:DoubleBinding

the new NumberBinding

Annotations
@Override
addback to summary
public DoubleBinding add(final long other)

Implements javafx.beans.binding.NumberExpression.add.

Doc from javafx.beans.binding.NumberExpression.add.

Creates a new javafx.beans.binding.NumberBinding that calculates the sum of this NumberExpression and a constant value.

Parameters
other:long

the constant value

Returns:DoubleBinding

the new NumberBinding

Annotations
@Override
addback to summary
public DoubleBinding add(final int other)

Implements javafx.beans.binding.NumberExpression.add.

Doc from javafx.beans.binding.NumberExpression.add.

Creates a new javafx.beans.binding.NumberBinding that calculates the sum of this NumberExpression and a constant value.

Parameters
other:int

the constant value

Returns:DoubleBinding

the new NumberBinding

Annotations
@Override
asObjectback to summary
public ObjectExpression<Double> asObject()

Creates an javafx.beans.binding.ObjectExpression that holds the value of this DoubleExpression. If the value of this DoubleExpression changes, the value of the ObjectExpression will be updated automatically.

Returns:ObjectExpression<Double>

the new ObjectExpression

Since
JavaFX 8.0
divideback to summary
public DoubleBinding divide(final ObservableNumberValue other)

Overrides javafx.beans.binding.NumberExpressionBase.divide.

Implements javafx.beans.binding.NumberExpression.divide.

Doc from javafx.beans.binding.NumberExpression.divide.

Creates a new javafx.beans.binding.NumberBinding that calculates the division of this NumberExpression and another javafx.beans.value.ObservableNumberValue.

Parameters
other:ObservableNumberValue

the second ObservableNumberValue

Returns:DoubleBinding

the new NumberBinding

Annotations
@Override
divideback to summary
public DoubleBinding divide(final double other)

Implements javafx.beans.binding.NumberExpression.divide.

Doc from javafx.beans.binding.NumberExpression.divide.

Creates a new javafx.beans.binding.NumberBinding that calculates the division of this NumberExpression and a constant value.

Parameters
other:double

the constant value

Returns:DoubleBinding

the new NumberBinding

Annotations
@Override
divideback to summary
public DoubleBinding divide(final float other)

Implements javafx.beans.binding.NumberExpression.divide.

Doc from javafx.beans.binding.NumberExpression.divide.

Creates a new javafx.beans.binding.NumberBinding that calculates the division of this NumberExpression and a constant value.

Parameters
other:float

the constant value

Returns:DoubleBinding

the new NumberBinding

Annotations
@Override
divideback to summary
public DoubleBinding divide(final long other)

Implements javafx.beans.binding.NumberExpression.divide.

Doc from javafx.beans.binding.NumberExpression.divide.

Creates a new javafx.beans.binding.NumberBinding that calculates the division of this NumberExpression and a constant value.

Parameters
other:long

the constant value

Returns:DoubleBinding

the new NumberBinding

Annotations
@Override
divideback to summary
public DoubleBinding divide(final int other)

Implements javafx.beans.binding.NumberExpression.divide.

Doc from javafx.beans.binding.NumberExpression.divide.

Creates a new javafx.beans.binding.NumberBinding that calculates the division of this NumberExpression and a constant value.

Parameters
other:int

the constant value

Returns:DoubleBinding

the new NumberBinding

Annotations
@Override
doubleExpressionback to summary
public static DoubleExpression doubleExpression(final ObservableDoubleValue value)

Returns a DoubleExpression that wraps a javafx.beans.value.ObservableDoubleValue. If the ObservableDoubleValue is already a DoubleExpression, it will be returned. Otherwise a new javafx.beans.binding.DoubleBinding is created that is bound to the ObservableDoubleValue.

Parameters
value:ObservableDoubleValue

The source ObservableDoubleValue

Returns:DoubleExpression

A DoubleExpression that wraps the ObservableDoubleValue if necessary

Exceptions
NullPointerException:
if value is null
doubleExpressionback to summary
public static <T extends Number> DoubleExpression doubleExpression(final ObservableValue<T> value)

Returns a DoubleExpression that wraps an javafx.beans.value.ObservableValue. If the ObservableValue is already a DoubleExpression, it will be returned. Otherwise a new javafx.beans.binding.DoubleBinding 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 DoubleExpression, which is essentially an ObservableValue<Number>. See sample below.

  DoubleProperty doubleProperty = new SimpleDoubleProperty(1.0);
  ObjectProperty<Double> objectProperty = new SimpleObjectProperty<>(2.0);
  BooleanBinding binding = doubleProperty.greaterThan(DoubleExpression.doubleExpression(objectProperty));
Note: null values will be interpreted as 0.0
Parameters
<T>
The type of Number to be wrapped
value:ObservableValue<T>

The source ObservableValue

Returns:DoubleExpression

A DoubleExpression that wraps the ObservableValue if necessary

Exceptions
NullPointerException:
if value is null
Since
JavaFX 8.0
doubleValueback to summary
public double doubleValue()

Implements javafx.beans.value.ObservableNumberValue.doubleValue.

Doc from javafx.beans.value.ObservableNumberValue.doubleValue.

Returns the value of this ObservableNumberValue as a double. If the value is not a double, a standard cast is performed.

Returns:double

The value of this ObservableNumberValue as a double

Annotations
@Override
floatValueback to summary
public float floatValue()

Implements javafx.beans.value.ObservableNumberValue.floatValue.

Doc from javafx.beans.value.ObservableNumberValue.floatValue.

Returns the value of this ObservableNumberValue as a float. If the value is not a float, a standard cast is performed.

Returns:float

The value of this ObservableNumberValue as a float

Annotations
@Override
getValueback to summary
public Double getValue()

Implements javafx.beans.value.ObservableValue.getValue.

Doc from javafx.beans.value.ObservableValue.getValue.

Returns the current value of this ObservableValue

Returns:Double

The current value

Annotations
@Override
intValueback to summary
public int intValue()

Implements javafx.beans.value.ObservableNumberValue.intValue.

Doc from javafx.beans.value.ObservableNumberValue.intValue.

Returns the value of this ObservableNumberValue as an int . If the value is not an int, a standard cast is performed.

Returns:int

The value of this ObservableNumberValue as an int

Annotations
@Override
longValueback to summary
public long longValue()

Implements javafx.beans.value.ObservableNumberValue.longValue.

Doc from javafx.beans.value.ObservableNumberValue.longValue.

Returns the value of this ObservableNumberValue as a long . If the value is not a long, a standard cast is performed.

Returns:long

The value of this ObservableNumberValue as a long

Annotations
@Override
multiplyback to summary
public DoubleBinding multiply(final ObservableNumberValue other)

Overrides javafx.beans.binding.NumberExpressionBase.multiply.

Implements javafx.beans.binding.NumberExpression.multiply.

Doc from javafx.beans.binding.NumberExpression.multiply.

Creates a new javafx.beans.binding.NumberBinding that calculates the product of this NumberExpression and another javafx.beans.value.ObservableNumberValue.

Parameters
other:ObservableNumberValue

the second ObservableNumberValue

Returns:DoubleBinding

the new NumberBinding

Annotations
@Override
multiplyback to summary
public DoubleBinding multiply(final double other)

Implements javafx.beans.binding.NumberExpression.multiply.

Doc from javafx.beans.binding.NumberExpression.multiply.

Creates a new javafx.beans.binding.NumberBinding that calculates the product of this NumberExpression and a constant value.

Parameters
other:double

the constant value

Returns:DoubleBinding

the new NumberBinding

Annotations
@Override
multiplyback to summary
public DoubleBinding multiply(final float other)

Implements javafx.beans.binding.NumberExpression.multiply.

Doc from javafx.beans.binding.NumberExpression.multiply.

Creates a new javafx.beans.binding.NumberBinding that calculates the product of this NumberExpression and a constant value.

Parameters
other:float

the constant value

Returns:DoubleBinding

the new NumberBinding

Annotations
@Override
multiplyback to summary
public DoubleBinding multiply(final long other)

Implements javafx.beans.binding.NumberExpression.multiply.

Doc from javafx.beans.binding.NumberExpression.multiply.

Creates a new javafx.beans.binding.NumberBinding that calculates the product of this NumberExpression and a constant value.

Parameters
other:long

the constant value

Returns:DoubleBinding

the new NumberBinding

Annotations
@Override
multiplyback to summary
public DoubleBinding multiply(final int other)

Implements javafx.beans.binding.NumberExpression.multiply.

Doc from javafx.beans.binding.NumberExpression.multiply.

Creates a new javafx.beans.binding.NumberBinding that calculates the product of this NumberExpression and a constant value.

Parameters
other:int

the constant value

Returns:DoubleBinding

the new NumberBinding

Annotations
@Override
negateback to summary
public DoubleBinding negate()

Implements javafx.beans.binding.NumberExpression.negate.

Doc from javafx.beans.binding.NumberExpression.negate.

Creates a new javafx.beans.binding.NumberBinding that calculates the negation of NumberExpression.

Returns:DoubleBinding

the new NumberBinding

Annotations
@Override
subtractback to summary
public DoubleBinding subtract(final ObservableNumberValue other)

Overrides javafx.beans.binding.NumberExpressionBase.subtract.

Implements javafx.beans.binding.NumberExpression.subtract.

Doc from javafx.beans.binding.NumberExpression.subtract.

Creates a new javafx.beans.binding.NumberBinding that calculates the difference of this NumberExpression and another javafx.beans.value.ObservableNumberValue.

Parameters
other:ObservableNumberValue

the second ObservableNumberValue

Returns:DoubleBinding

the new NumberBinding

Annotations
@Override
subtractback to summary
public DoubleBinding subtract(final double other)

Implements javafx.beans.binding.NumberExpression.subtract.

Doc from javafx.beans.binding.NumberExpression.subtract.

Creates a new javafx.beans.binding.NumberBinding that calculates the difference of this NumberExpression and a constant value.

Parameters
other:double

the constant value

Returns:DoubleBinding

the new NumberBinding

Annotations
@Override
subtractback to summary
public DoubleBinding subtract(final float other)

Implements javafx.beans.binding.NumberExpression.subtract.

Doc from javafx.beans.binding.NumberExpression.subtract.

Creates a new javafx.beans.binding.NumberBinding that calculates the difference of this NumberExpression and a constant value.

Parameters
other:float

the constant value

Returns:DoubleBinding

the new NumberBinding

Annotations
@Override
subtractback to summary
public DoubleBinding subtract(final long other)

Implements javafx.beans.binding.NumberExpression.subtract.

Doc from javafx.beans.binding.NumberExpression.subtract.

Creates a new javafx.beans.binding.NumberBinding that calculates the difference of this NumberExpression and a constant value.

Parameters
other:long

the constant value

Returns:DoubleBinding

the new NumberBinding

Annotations
@Override
subtractback to summary
public DoubleBinding subtract(final int other)

Implements javafx.beans.binding.NumberExpression.subtract.

Doc from javafx.beans.binding.NumberExpression.subtract.

Creates a new javafx.beans.binding.NumberBinding that calculates the difference of this NumberExpression and a constant value.

Parameters
other:int

the constant value

Returns:DoubleBinding

the new NumberBinding

Annotations
@Override