java.lang.Object
javafx.beans.binding.BooleanExpression
- All Implemented Interfaces:
Observable
,ObservableBooleanValue
,ObservableValue<Boolean>
- Direct Known Subclasses:
BooleanBinding
,ReadOnlyBooleanProperty
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
-
Method Summary
Modifier and TypeMethodDescriptionand
(ObservableBooleanValue other) Creates a newBooleanExpression
that performs the conditional AND-operation on thisBooleanExpression
and aObservableBooleanValue
.asObject()
Creates anObjectExpression
that holds the value of thisBooleanExpression
.asString()
static BooleanExpression
Returns aBooleanExpression
that wraps aObservableBooleanValue
.static BooleanExpression
booleanExpression
(ObservableValue<Boolean> value) Returns aBooleanExpression
that wraps anObservableValue
.getValue()
Returns the current value of thisObservableValue
isEqualTo
(ObservableBooleanValue other) Creates a newBooleanExpression
that holdstrue
if this and anotherObservableBooleanValue
are equal.Creates a newBooleanExpression
that holdstrue
if this and anotherObservableBooleanValue
are equal.not()
Creates a newBooleanExpression
that calculates the negation of thisBooleanExpression
.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, subscribe
Methods declared in interface javafx.beans.value.ObservableBooleanValue
get
Methods declared in interface javafx.beans.value.ObservableValue
addListener, flatMap, map, orElse, removeListener, subscribe, subscribe, when
-
Constructor Details
-
BooleanExpression
public BooleanExpression()Creates a defaultBooleanExpression
.
-
-
Method Details
-
getValue
Description copied from interface:ObservableValue
Returns the current value of thisObservableValue
- Specified by:
getValue
in interfaceObservableValue<Boolean>
- Returns:
- The current value
-
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
-