public abstract class BooleanExpression extends Object implements ObservableBooleanValue
BooleanExpression
is a
ObservableBooleanValue
plus additional convenience
methods to generate bindings in a fluent style.
A concrete sub-class of BooleanExpression
has to implement the method
ObservableBooleanValue.get()
, which provides the
actual value of this expression.
Constructor and Description |
---|
BooleanExpression()
Sole constructor
|
Modifier and Type | Method and Description |
---|---|
BooleanBinding |
and(ObservableBooleanValue other)
Creates a new
BooleanExpression that performs the conditional
AND-operation on this BooleanExpression and a
ObservableBooleanValue . |
ObjectExpression<Boolean> |
asObject()
Creates an
ObjectExpression that holds the value
of this BooleanExpression . |
StringBinding |
asString()
|
static BooleanExpression |
booleanExpression(ObservableBooleanValue value)
Returns a
BooleanExpression that wraps a
ObservableBooleanValue . |
static BooleanExpression |
booleanExpression(ObservableValue<Boolean> value)
Returns a
BooleanExpression that wraps an
ObservableValue . |
Boolean |
getValue()
Returns the current value of this
ObservableValue |
BooleanBinding |
isEqualTo(ObservableBooleanValue other)
Creates a new
BooleanExpression that holds true if this and
another ObservableBooleanValue are equal. |
BooleanBinding |
isNotEqualTo(ObservableBooleanValue other)
Creates a new
BooleanExpression that holds true if this and
another ObservableBooleanValue are equal. |
BooleanBinding |
not()
Creates a new
BooleanExpression that calculates the negation of
this BooleanExpression . |
BooleanBinding |
or(ObservableBooleanValue other)
Creates a new
BooleanExpression that performs the conditional
OR-operation on this BooleanExpression and a
ObservableBooleanValue . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
get
addListener, removeListener
addListener, removeListener
public Boolean getValue()
ObservableValue
ObservableValue
getValue
in interface ObservableValue<Boolean>
public static BooleanExpression booleanExpression(ObservableBooleanValue value)
BooleanExpression
that wraps a
ObservableBooleanValue
. If the
ObservableBooleanValue
is already a BooleanExpression
, it
will be returned. Otherwise a new
BooleanBinding
is created that is bound to
the ObservableBooleanValue
.value
- The source ObservableBooleanValue
BooleanExpression
that wraps the
ObservableBooleanValue
if necessaryNullPointerException
- if value
is null
public static BooleanExpression booleanExpression(ObservableValue<Boolean> value)
BooleanExpression
that wraps an
ObservableValue
. If the
ObservableValue
is already a BooleanExpression
, it
will be returned. Otherwise a new
BooleanBinding
is created that is bound to
the ObservableValue
.
Note: null values will be interpreted as "false".value
- The source ObservableValue
BooleanExpression
that wraps the
ObservableValue
if necessaryNullPointerException
- if value
is null
public BooleanBinding and(ObservableBooleanValue other)
BooleanExpression
that performs the conditional
AND-operation on this BooleanExpression
and a
ObservableBooleanValue
.other
- the other ObservableBooleanValue
BooleanExpression
NullPointerException
- if other
is null
public BooleanBinding or(ObservableBooleanValue other)
BooleanExpression
that performs the conditional
OR-operation on this BooleanExpression
and a
ObservableBooleanValue
.other
- the other ObservableBooleanValue
BooleanExpression
NullPointerException
- if other
is null
public BooleanBinding not()
BooleanExpression
that calculates the negation of
this BooleanExpression
.BooleanExpression
public BooleanBinding isEqualTo(ObservableBooleanValue other)
BooleanExpression
that holds true
if this and
another ObservableBooleanValue
are equal.other
- the other ObservableBooleanValue
BooleanExpression
NullPointerException
- if other
is null
public BooleanBinding isNotEqualTo(ObservableBooleanValue other)
BooleanExpression
that holds true
if this and
another ObservableBooleanValue
are equal.other
- the other ObservableBooleanValue
BooleanExpression
NullPointerException
- if other
is null
public StringBinding asString()
StringBinding
that holds the value
of this BooleanExpression
turned into a String
. If the
value of this BooleanExpression
changes, the value of the
StringBinding
will be updated automatically.StringBinding
public ObjectExpression<Boolean> asObject()
ObjectExpression
that holds the value
of this BooleanExpression
. If the
value of this BooleanExpression
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, 2020, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.