Class BooleanExpression

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
A 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.

Since:
JavaFX 2.0
  • Constructor Details

    • BooleanExpression

      public BooleanExpression()
      Sole constructor
  • Method Details

    • getValue

      public Boolean getValue()
      Description copied from interface: ObservableValue
      Returns the current value of this ObservableValue
      Specified by:
      getValue in interface ObservableValue<Boolean>
      Returns:
      The current value
    • booleanExpression

      public static BooleanExpression booleanExpression(ObservableBooleanValue value)
      Returns a 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.
      Parameters:
      value - The source ObservableBooleanValue
      Returns:
      A BooleanExpression that wraps the ObservableBooleanValue if necessary
      Throws:
      NullPointerException - if value is null
    • booleanExpression

      public static BooleanExpression booleanExpression(ObservableValue<Boolean> value)
      Returns a 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".
      Parameters:
      value - The source ObservableValue
      Returns:
      A BooleanExpression that wraps the ObservableValue if necessary
      Throws:
      NullPointerException - if value is null
      Since:
      JavaFX 8.0
    • and

      Creates a new BooleanExpression that performs the conditional AND-operation on this BooleanExpression and a ObservableBooleanValue.
      Parameters:
      other - the other ObservableBooleanValue
      Returns:
      the new BooleanExpression
      Throws:
      NullPointerException - if other is null
    • or

      Creates a new BooleanExpression that performs the conditional OR-operation on this BooleanExpression and a ObservableBooleanValue.
      Parameters:
      other - the other ObservableBooleanValue
      Returns:
      the new BooleanExpression
      Throws:
      NullPointerException - if other is null
    • not

      public BooleanBinding not()
      Creates a new BooleanExpression that calculates the negation of this BooleanExpression.
      Returns:
      the new BooleanExpression