public abstract class IntegerExpression extends NumberExpressionBase
IntegerExpression
is an
javafx.beans.value.ObservableIntegerValue
plus additional convenience
methods to generate bindings in a fluent style.
A concrete sub-class of IntegerExpression
has to implement the method
javafx.beans.value.ObservableIntegerValue#get()
, which provides the
actual value of this expression.
Constructor and Description |
---|
IntegerExpression() |
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 . |
IntegerBinding |
add(int other)
Creates a new
NumberBinding that calculates
the sum of this NumberExpression and another
javafx.beans.value.ObservableNumberValue . |
LongBinding |
add(long other)
Creates a new
NumberBinding that calculates
the sum of this NumberExpression and another
javafx.beans.value.ObservableNumberValue . |
ObjectExpression<java.lang.Integer> |
asObject()
Creates an
ObjectExpression that holds the value
of this IntegerExpression . |
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 . |
IntegerBinding |
divide(int other)
Creates a new
NumberBinding that calculates
the division of this NumberExpression and another
javafx.beans.value.ObservableNumberValue . |
LongBinding |
divide(long other)
Creates a new
NumberBinding that calculates
the division of this NumberExpression and another
javafx.beans.value.ObservableNumberValue . |
double |
doubleValue() |
float |
floatValue() |
java.lang.Integer |
getValue() |
static <T extends java.lang.Number> |
integerExpression(<any> value)
Returns an
IntegerExpression that wraps an
javafx.beans.value.ObservableValue . |
static IntegerExpression |
integerExpression(ObservableIntegerValue value)
Returns a
IntegerExpression that wraps a
javafx.beans.value.ObservableIntegerValue . |
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 . |
IntegerBinding |
multiply(int other)
Creates a new
NumberBinding that calculates
the product of this NumberExpression and another
javafx.beans.value.ObservableNumberValue . |
LongBinding |
multiply(long other)
Creates a new
NumberBinding that calculates
the product of this NumberExpression and another
javafx.beans.value.ObservableNumberValue . |
IntegerBinding |
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 . |
IntegerBinding |
subtract(int other)
Creates a new
NumberBinding that calculates
the difference of this NumberExpression and another
javafx.beans.value.ObservableNumberValue . |
LongBinding |
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.Integer getValue()
public static IntegerExpression integerExpression(ObservableIntegerValue value)
IntegerExpression
that wraps a
javafx.beans.value.ObservableIntegerValue
. If the
ObservableIntegerValue
is already a IntegerExpression
, it
will be returned. Otherwise a new
IntegerBinding
is created that is bound to
the ObservableIntegerValue
.value
- The source ObservableIntegerValue
IntegerExpression
that wraps the
ObservableIntegerValue
if necessaryjava.lang.NullPointerException
- if value
is null
public static <T extends java.lang.Number> IntegerExpression integerExpression(<any> value)
IntegerExpression
that wraps an
javafx.beans.value.ObservableValue
. If the
ObservableValue
is already a IntegerExpression
, it
will be returned. Otherwise a new
IntegerBinding
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 IntegerExpression, which
is essentially an ObservableValue<Number>
. See sample below.
Note: null values will be interpreted as 0IntegerProperty integerProperty = new SimpleIntegerProperty(1); ObjectProperty<Integer> objectProperty = new SimpleObjectProperty<>(2); BooleanBinding binding = integerProperty.greaterThan(IntegerExpression.integerExpression(objectProperty));
T
- The type of Number to be wrappedvalue
- The source ObservableValue
IntegerExpression
that wraps the
ObservableValue
if necessaryjava.lang.NullPointerException
- if value
is null
public IntegerBinding 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 LongBinding 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 IntegerBinding 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 LongBinding 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 IntegerBinding 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 LongBinding 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 IntegerBinding 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 LongBinding 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 IntegerBinding 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.Integer> asObject()
ObjectExpression
that holds the value
of this IntegerExpression
. If the
value of this IntegerExpression
changes, the value of the
ObjectExpression
will be updated automatically.ObjectExpression