public abstract class ObjectExpression<T> extends Object implements ObservableObjectValue<T>
ObjectExpression
is a
ObservableObjectValue
plus additional convenience
methods to generate bindings in a fluent style.
A concrete sub-class of ObjectExpression
has to implement the method
ObservableObjectValue.get()
, which provides the
actual value of this expression.
Constructor and Description |
---|
ObjectExpression() |
Modifier and Type | Method and Description |
---|---|
StringBinding |
asString()
|
StringBinding |
asString(Locale locale,
String format)
|
StringBinding |
asString(String format)
|
T |
getValue()
Returns the current value of this
ObservableValue |
BooleanBinding |
isEqualTo(Object other)
Creates a new
BooleanExpression that holds true if this
ObjectExpression is equal to a constant value. |
BooleanBinding |
isEqualTo(ObservableObjectValue<?> other)
Creates a new
BooleanExpression that holds true if this and
another ObservableObjectValue are equal. |
BooleanBinding |
isNotEqualTo(Object other)
Creates a new
BooleanExpression that holds true if this
ObjectExpression is not equal to a constant value. |
BooleanBinding |
isNotEqualTo(ObservableObjectValue<?> other)
Creates a new
BooleanExpression that holds true if this and
another ObservableObjectValue are not equal. |
BooleanBinding |
isNotNull()
|
BooleanBinding |
isNull()
|
static <T> ObjectExpression<T> |
objectExpression(ObservableObjectValue<T> value)
Returns an
ObjectExpression that wraps an
ObservableObjectValue . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
get
addListener, removeListener
addListener, removeListener
public T getValue()
ObservableValue
ObservableValue
getValue
in interface ObservableValue<T>
public static <T> ObjectExpression<T> objectExpression(ObservableObjectValue<T> value)
ObjectExpression
that wraps an
ObservableObjectValue
. If the
ObservableObjectValue
is already an ObjectExpression
, it
will be returned. Otherwise a new
ObjectBinding
is created that is bound to
the ObservableObjectValue
.value
- The source ObservableObjectValue
ObjectExpression
that wraps the
ObservableObjectValue
if necessaryNullPointerException
- if value
is null
public BooleanBinding isEqualTo(ObservableObjectValue<?> other)
BooleanExpression
that holds true
if this and
another ObservableObjectValue
are equal.other
- the other ObservableObjectValue
BooleanExpression
NullPointerException
- if other
is null
public BooleanBinding isEqualTo(Object other)
BooleanExpression
that holds true
if this
ObjectExpression
is equal to a constant value.other
- the constant valueBooleanExpression
public BooleanBinding isNotEqualTo(ObservableObjectValue<?> other)
BooleanExpression
that holds true
if this and
another ObservableObjectValue
are not equal.other
- the other ObservableObjectValue
BooleanExpression
NullPointerException
- if other
is null
public BooleanBinding isNotEqualTo(Object other)
BooleanExpression
that holds true
if this
ObjectExpression
is not equal to a constant value.other
- the constant valueBooleanExpression
public BooleanBinding isNull()
BooleanBinding
public BooleanBinding isNotNull()
BooleanBinding
public StringBinding asString()
StringBinding
that holds the value
of this ObjectExpression
turned into a String
. If the
value of this ObjectExpression
changes, the value of the
StringBinding
will be updated automatically.StringBinding
public StringBinding asString(String format)
StringBinding
that holds the value
of the ObjectExpression
turned into a String
. If the
value of this ObjectExpression
changes, the value of the
StringBinding
will be updated automatically.
The result is formatted according to the formatting String
. See
java.util.Formatter
for formatting rules.
format
- the formatting String
StringBinding
public StringBinding asString(Locale locale, String format)
StringBinding
that holds the value
of the NumberExpression
turned into a String
. If the
value of this NumberExpression
changes, the value of the
StringBinding
will be updated automatically.
The result is formatted according to the formatting String
and
the passed in Locale
. See java.util.Formatter
for
formatting rules. See java.util.Locale
for details on
Locale
.
format
- the formatting String
StringBinding
Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.