public abstract class LongExpression extends NumberExpressionBase implements ObservableLongValue
LongExpression
is a ObservableLongValue
plus additional convenience methods to generate bindings in a fluent style.
A concrete sub-class of LongExpression
has to implement the method
ObservableLongValue.get()
, which provides the
actual value of this expression.
Constructor and Description |
---|
LongExpression() |
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. |
LongBinding |
add(int other)
Creates a new
NumberBinding that calculates
the sum of this NumberExpression and a constant value. |
LongBinding |
add(long other)
Creates a new
NumberBinding that calculates
the sum of this NumberExpression and a constant value. |
ObjectExpression<Long> |
asObject()
Creates an
ObjectExpression that holds the value
of this LongExpression . |
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. |
LongBinding |
divide(int other)
Creates a new
NumberBinding that calculates
the division of this NumberExpression and a constant value. |
LongBinding |
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 . |
float |
floatValue()
Returns the value of this
ObservableNumberValue as a
float . |
Long |
getValue()
Returns the current value of this
ObservableValue |
int |
intValue()
Returns the value of this
ObservableNumberValue as an int
. |
static LongExpression |
longExpression(ObservableLongValue value)
Returns a
LongExpression that wraps a
ObservableLongValue . |
static <T extends Number> |
longExpression(ObservableValue<T> value)
Returns a
LongExpression that wraps an
ObservableValue . |
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. |
LongBinding |
multiply(int other)
Creates a new
NumberBinding that calculates
the product of this NumberExpression and a constant value. |
LongBinding |
multiply(long other)
Creates a new
NumberBinding that calculates
the product of this NumberExpression and a constant value. |
LongBinding |
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. |
LongBinding |
subtract(int other)
Creates a new
NumberBinding that calculates
the difference of this NumberExpression and a constant value. |
LongBinding |
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, subtract
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
get
addListener, removeListener
addListener, removeListener
public int intValue()
ObservableNumberValue
ObservableNumberValue
as an int
. If the value is not an int
, a standard cast is performed.intValue
in interface ObservableNumberValue
ObservableNumberValue
as an int
public long longValue()
ObservableNumberValue
ObservableNumberValue
as a long
. If the value is not a long
, a standard cast is performed.longValue
in interface ObservableNumberValue
ObservableNumberValue
as a long
public float floatValue()
ObservableNumberValue
ObservableNumberValue
as a
float
. If the value is not a float
, a standard cast is
performed.floatValue
in interface ObservableNumberValue
ObservableNumberValue
as a
float
public double doubleValue()
ObservableNumberValue
ObservableNumberValue
as a
double
. If the value is not a double
, a standard cast is
performed.doubleValue
in interface ObservableNumberValue
ObservableNumberValue
as a
double
public Long getValue()
ObservableValue
ObservableValue
getValue
in interface ObservableValue<Number>
public static LongExpression longExpression(ObservableLongValue value)
LongExpression
that wraps a
ObservableLongValue
. If the
ObservableLongValue
is already a LongExpression
, it will
be returned. Otherwise a new LongBinding
is
created that is bound to the ObservableLongValue
.value
- The source ObservableLongValue
LongExpression
that wraps the
ObservableLongValue
if necessaryNullPointerException
- if value
is null
public static <T extends Number> LongExpression longExpression(ObservableValue<T> value)
LongExpression
that wraps an
ObservableValue
. If the
ObservableValue
is already a LongExpression
, it
will be returned. Otherwise a new
LongBinding
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 LongExpression, which
is essentially an ObservableValue<Number>
. See sample below.
Note: null values will be interpreted as 0LLongProperty longProperty = new SimpleLongProperty(1L); ObjectProperty<Long> objectProperty = new SimpleObjectProperty<>(2L); BooleanBinding binding = longProperty.greaterThan(LongExpression.longExpression(objectProperty));
value
- The source ObservableValue
LongExpression
that wraps the
ObservableValue
if necessaryNullPointerException
- if value
is null
public LongBinding negate()
NumberExpression
NumberBinding
that calculates
the negation of NumberExpression
.negate
in interface NumberExpression
NumberBinding
public DoubleBinding add(double other)
NumberExpression
NumberBinding
that calculates
the sum of this NumberExpression
and a constant value.add
in interface NumberExpression
other
- the constant valueNumberBinding
public FloatBinding add(float other)
NumberExpression
NumberBinding
that calculates
the sum of this NumberExpression
and a constant value.add
in interface NumberExpression
other
- the constant valueNumberBinding
public LongBinding add(long other)
NumberExpression
NumberBinding
that calculates
the sum of this NumberExpression
and a constant value.add
in interface NumberExpression
other
- the constant valueNumberBinding
public LongBinding add(int other)
NumberExpression
NumberBinding
that calculates
the sum of this NumberExpression
and a constant value.add
in interface NumberExpression
other
- the constant valueNumberBinding
public DoubleBinding subtract(double other)
NumberExpression
NumberBinding
that calculates
the difference of this NumberExpression
and a constant value.subtract
in interface NumberExpression
other
- the constant valueNumberBinding
public FloatBinding subtract(float other)
NumberExpression
NumberBinding
that calculates
the difference of this NumberExpression
and a constant value.subtract
in interface NumberExpression
other
- the constant valueNumberBinding
public LongBinding subtract(long other)
NumberExpression
NumberBinding
that calculates
the difference of this NumberExpression
and a constant value.subtract
in interface NumberExpression
other
- the constant valueNumberBinding
public LongBinding subtract(int other)
NumberExpression
NumberBinding
that calculates
the difference of this NumberExpression
and a constant value.subtract
in interface NumberExpression
other
- the constant valueNumberBinding
public DoubleBinding multiply(double other)
NumberExpression
NumberBinding
that calculates
the product of this NumberExpression
and a constant value.multiply
in interface NumberExpression
other
- the constant valueNumberBinding
public FloatBinding multiply(float other)
NumberExpression
NumberBinding
that calculates
the product of this NumberExpression
and a constant value.multiply
in interface NumberExpression
other
- the constant valueNumberBinding
public LongBinding multiply(long other)
NumberExpression
NumberBinding
that calculates
the product of this NumberExpression
and a constant value.multiply
in interface NumberExpression
other
- the constant valueNumberBinding
public LongBinding multiply(int other)
NumberExpression
NumberBinding
that calculates
the product of this NumberExpression
and a constant value.multiply
in interface NumberExpression
other
- the constant valueNumberBinding
public DoubleBinding divide(double other)
NumberExpression
NumberBinding
that calculates
the division of this NumberExpression
and a constant value.divide
in interface NumberExpression
other
- the constant valueNumberBinding
public FloatBinding divide(float other)
NumberExpression
NumberBinding
that calculates
the division of this NumberExpression
and a constant value.divide
in interface NumberExpression
other
- the constant valueNumberBinding
public LongBinding divide(long other)
NumberExpression
NumberBinding
that calculates
the division of this NumberExpression
and a constant value.divide
in interface NumberExpression
other
- the constant valueNumberBinding
public LongBinding divide(int other)
NumberExpression
NumberBinding
that calculates
the division of this NumberExpression
and a constant value.divide
in interface NumberExpression
other
- the constant valueNumberBinding
public ObjectExpression<Long> asObject()
ObjectExpression
that holds the value
of this LongExpression
. If the
value of this LongExpression
changes, the value of the
ObjectExpression
will be updated automatically.ObjectExpression
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 2008, 2017, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.