Top Description Constructors Methods
javafx.beans.binding

public abstract Class IntegerExpression

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

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.

Since
JavaFX 2.0

Constructor Summary

AccessConstructor and Description
public
IntegerExpression()

Creates a default IntegerExpression.

Method Summary

Modifier and TypeMethod and Description
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 FloatBinding
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 LongBinding
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 IntegerBinding
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<Integer>

Returns:

the new ObjectExpression
asObject
()

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

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 FloatBinding
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 LongBinding
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 IntegerBinding
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 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 Integer
getValue()

Implements javafx.beans.value.ObservableValue.getValue.

Returns the current value of this ObservableValue

public static IntegerExpression

Returns:

A IntegerExpression that wraps the ObservableIntegerValue if necessary
integerExpression
(final ObservableIntegerValue
The source ObservableIntegerValue
value
)

Returns a IntegerExpression that wraps a javafx.beans.value.ObservableIntegerValue.

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

Returns:

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

Returns an IntegerExpression that wraps an javafx.beans.value.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 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 FloatBinding
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 LongBinding
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 IntegerBinding
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 IntegerBinding
negate()

Implements javafx.beans.binding.NumberExpression.negate.

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

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 FloatBinding
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 LongBinding
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 IntegerBinding
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:
addasStringasStringasStringdividegreaterThangreaterThangreaterThangreaterThangreaterThangreaterThanOrEqualTogreaterThanOrEqualTogreaterThanOrEqualTogreaterThanOrEqualTogreaterThanOrEqualToisEqualToisEqualToisEqualToisEqualToisEqualToisEqualToisEqualToisEqualToisNotEqualToisNotEqualToisNotEqualToisNotEqualToisNotEqualToisNotEqualToisNotEqualToisNotEqualTolessThanlessThanlessThanlessThanlessThanlessThanOrEqualTolessThanOrEqualTolessThanOrEqualTolessThanOrEqualTolessThanOrEqualTomultiplynumberExpressionsubtract

Constructor Detail

IntegerExpressionback to summary
public IntegerExpression()

Creates a default IntegerExpression.

Method Detail

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 FloatBinding 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:FloatBinding

the new NumberBinding

Annotations
@Override
addback to summary
public LongBinding 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:LongBinding

the new NumberBinding

Annotations
@Override
addback to summary
public IntegerBinding 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:IntegerBinding

the new NumberBinding

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

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

Returns:ObjectExpression<Integer>

the new ObjectExpression

Since
JavaFX 8.0
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 FloatBinding 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:FloatBinding

the new NumberBinding

Annotations
@Override
divideback to summary
public LongBinding 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:LongBinding

the new NumberBinding

Annotations
@Override
divideback to summary
public IntegerBinding 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:IntegerBinding

the new NumberBinding

Annotations
@Override
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 Integer getValue()

Implements javafx.beans.value.ObservableValue.getValue.

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

Returns the current value of this ObservableValue

Returns:Integer

The current value

Annotations
@Override
integerExpressionback to summary
public static IntegerExpression integerExpression(final ObservableIntegerValue value)

Returns a IntegerExpression that wraps a javafx.beans.value.ObservableIntegerValue. If the ObservableIntegerValue is already a IntegerExpression, it will be returned. Otherwise a new javafx.beans.binding.IntegerBinding is created that is bound to the ObservableIntegerValue.

Parameters
value:ObservableIntegerValue

The source ObservableIntegerValue

Returns:IntegerExpression

A IntegerExpression that wraps the ObservableIntegerValue if necessary

Exceptions
NullPointerException:
if value is null
integerExpressionback to summary
public static <T extends Number> IntegerExpression integerExpression(final ObservableValue<T> value)

Returns an IntegerExpression that wraps an javafx.beans.value.ObservableValue. If the ObservableValue is already a IntegerExpression, it will be returned. Otherwise a new javafx.beans.binding.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.

  IntegerProperty integerProperty = new SimpleIntegerProperty(1);
  ObjectProperty<Integer> objectProperty = new SimpleObjectProperty<>(2);
  BooleanBinding binding = integerProperty.greaterThan(IntegerExpression.integerExpression(objectProperty));
Note: null values will be interpreted as 0
Parameters
<T>
The type of Number to be wrapped
value:ObservableValue<T>

The source ObservableValue

Returns:IntegerExpression

A IntegerExpression that wraps the ObservableValue if necessary

Exceptions
NullPointerException:
if value is null
Since
JavaFX 8.0
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 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 FloatBinding 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:FloatBinding

the new NumberBinding

Annotations
@Override
multiplyback to summary
public LongBinding 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:LongBinding

the new NumberBinding

Annotations
@Override
multiplyback to summary
public IntegerBinding 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:IntegerBinding

the new NumberBinding

Annotations
@Override
negateback to summary
public IntegerBinding 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:IntegerBinding

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 FloatBinding 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:FloatBinding

the new NumberBinding

Annotations
@Override
subtractback to summary
public LongBinding 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:LongBinding

the new NumberBinding

Annotations
@Override
subtractback to summary
public IntegerBinding 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:IntegerBinding

the new NumberBinding

Annotations
@Override