java.lang.Object
javafx.beans.binding.BooleanExpression
- All Implemented Interfaces:
Observable
,ObservableBooleanValue
,ObservableValue<Boolean>
- Direct Known Subclasses:
BooleanBinding
,ReadOnlyBooleanProperty
public abstract class BooleanExpression extends Object implements ObservableBooleanValue
BooleanExpression
is an
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.
- Since:
- JavaFX 2.0
-
Constructor Summary
Constructors Constructor Description BooleanExpression()
Creates a defaultBooleanExpression
. -
Method Summary
Modifier and Type Method Description BooleanBinding
and(ObservableBooleanValue other)
Creates a newBooleanExpression
that performs the conditional AND-operation on thisBooleanExpression
and aObservableBooleanValue
.ObjectExpression<Boolean>
asObject()
Creates anObjectExpression
that holds the value of thisBooleanExpression
.StringBinding
asString()
static BooleanExpression
booleanExpression(ObservableBooleanValue value)
Returns aBooleanExpression
that wraps aObservableBooleanValue
.static BooleanExpression
booleanExpression(ObservableValue<Boolean> value)
Returns aBooleanExpression
that wraps anObservableValue
.BooleanBinding
isEqualTo(ObservableBooleanValue other)
Creates a newBooleanExpression
that holdstrue
if this and anotherObservableBooleanValue
are equal.BooleanBinding
isNotEqualTo(ObservableBooleanValue other)
Creates a newBooleanExpression
that holdstrue
if this and anotherObservableBooleanValue
are equal.BooleanBinding
not()
Creates a newBooleanExpression
that calculates the negation of thisBooleanExpression
.BooleanBinding
or(ObservableBooleanValue other)
Creates a newBooleanExpression
that performs the conditional OR-operation on thisBooleanExpression
and aObservableBooleanValue
.Methods declared in class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods declared in interface javafx.beans.Observable
addListener, removeListener
Methods declared in interface javafx.beans.value.ObservableBooleanValue
get
Methods declared in interface javafx.beans.value.ObservableValue
addListener, getValue, removeListener
-
Constructor Details
-
BooleanExpression
public BooleanExpression()Creates a defaultBooleanExpression
.
-
-
Method Details
-
booleanExpression
Returns aBooleanExpression
that wraps aObservableBooleanValue
. If theObservableBooleanValue
is already aBooleanExpression
, it will be returned. Otherwise a newBooleanBinding
is created that is bound to theObservableBooleanValue
.- Parameters:
value
- The sourceObservableBooleanValue
- Returns:
- A
BooleanExpression
that wraps theObservableBooleanValue
if necessary - Throws:
NullPointerException
- ifvalue
isnull
-
booleanExpression
Returns aBooleanExpression
that wraps anObservableValue
. If theObservableValue
is already aBooleanExpression
, it will be returned. Otherwise a newBooleanBinding
is created that is bound to theObservableValue
. Note: null values will be interpreted as "false".- Parameters:
value
- The sourceObservableValue
- Returns:
- A
BooleanExpression
that wraps theObservableValue
if necessary - Throws:
NullPointerException
- ifvalue
isnull
- Since:
- JavaFX 8.0
-
and
Creates a newBooleanExpression
that performs the conditional AND-operation on thisBooleanExpression
and aObservableBooleanValue
.- Parameters:
other
- the otherObservableBooleanValue
- Returns:
- the new
BooleanExpression
- Throws:
NullPointerException
- ifother
isnull
-
or
Creates a newBooleanExpression
that performs the conditional OR-operation on thisBooleanExpression
and aObservableBooleanValue
.- Parameters:
other
- the otherObservableBooleanValue
- Returns:
- the new
BooleanExpression
- Throws:
NullPointerException
- ifother
isnull
-
not
Creates a newBooleanExpression
that calculates the negation of thisBooleanExpression
.- Returns:
- the new
BooleanExpression
-
isEqualTo
Creates a newBooleanExpression
that holdstrue
if this and anotherObservableBooleanValue
are equal.- Parameters:
other
- the otherObservableBooleanValue
- Returns:
- the new
BooleanExpression
- Throws:
NullPointerException
- ifother
isnull
-
isNotEqualTo
Creates a newBooleanExpression
that holdstrue
if this and anotherObservableBooleanValue
are equal.- Parameters:
other
- the otherObservableBooleanValue
- Returns:
- the new
BooleanExpression
- Throws:
NullPointerException
- ifother
isnull
-
asString
Creates aStringBinding
that holds the value of thisBooleanExpression
turned into aString
. If the value of thisBooleanExpression
changes, the value of theStringBinding
will be updated automatically.- Returns:
- the new
StringBinding
-
asObject
Creates anObjectExpression
that holds the value of thisBooleanExpression
. If the value of thisBooleanExpression
changes, the value of theObjectExpression
will be updated automatically.- Returns:
- the new
ObjectExpression
- Since:
- JavaFX 8.0
-