- 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 anObservableBooleanValue
plus additional convenience methods to generate bindings in a fluent style.A concrete sub-class of
BooleanExpression
has to implement the methodObservableBooleanValue.get()
, which provides the actual value of this expression.- Since:
- JavaFX 2.0
-
-
Constructor Summary
Constructors Constructor Description BooleanExpression()
Sole constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods 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
.Boolean
getValue()
Returns the current value of thisObservableValue
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 inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javafx.beans.Observable
addListener, removeListener
-
Methods inherited from interface javafx.beans.value.ObservableBooleanValue
get
-
Methods inherited from interface javafx.beans.value.ObservableValue
addListener, removeListener
-
-
-
-
Method Detail
-
getValue
public Boolean getValue()
Description copied from interface:ObservableValue
Returns the current value of thisObservableValue
- Specified by:
getValue
in interfaceObservableValue<Boolean>
- Returns:
- The current value
-
booleanExpression
public static BooleanExpression booleanExpression(ObservableBooleanValue value)
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
public static BooleanExpression booleanExpression(ObservableValue<Boolean> value)
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
public BooleanBinding and(ObservableBooleanValue other)
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
public BooleanBinding or(ObservableBooleanValue other)
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
public BooleanBinding not()
Creates a newBooleanExpression
that calculates the negation of thisBooleanExpression
.- Returns:
- the new
BooleanExpression
-
isEqualTo
public BooleanBinding isEqualTo(ObservableBooleanValue other)
Creates a newBooleanExpression
that holdstrue
if this and anotherObservableBooleanValue
are equal.- Parameters:
other
- the otherObservableBooleanValue
- Returns:
- the new
BooleanExpression
- Throws:
NullPointerException
- ifother
isnull
-
isNotEqualTo
public BooleanBinding isNotEqualTo(ObservableBooleanValue other)
Creates a newBooleanExpression
that holdstrue
if this and anotherObservableBooleanValue
are equal.- Parameters:
other
- the otherObservableBooleanValue
- Returns:
- the new
BooleanExpression
- Throws:
NullPointerException
- ifother
isnull
-
asString
public StringBinding 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
public ObjectExpression<Boolean> 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
-
-