Spec-Zone.ru › OpenJavaFX 17

Class ObjectExpression<T>

java.lang.Object
javafx.beans.binding.ObjectExpression<T>
All Implemented Interfaces:
Observable, ObservableObjectValue<T>, ObservableValue<T>
Direct Known Subclasses:
ObjectBinding, ReadOnlyObjectProperty
public abstract class ObjectExpression<T>
extends Object
implements ObservableObjectValue<T>
ObjectExpression is an ObservableObjectValue plus additional convenience methods to generate bindings in a fluent style.

A concrete sub-class of ObjectExpression has to implement the method ObservableObjectValue.get(), which provides the actual value of this expression.

Since:
JavaFX 2.0

Constructor Summary

Constructors
Constructor Description
ObjectExpression()
Creates a default ObjectExpression.

Method Summary

Modifier and Type Method Description
StringBinding asString()
Creates a StringBinding that holds the value of this ObjectExpression turned into a String.
StringBinding asString​(String format)
Creates a StringBinding that holds the value of the ObjectExpression turned into a String.
StringBinding asString​(Locale locale, String format)
Creates a StringBinding that holds the value of the NumberExpression turned into a String.
BooleanBinding isEqualTo​(Object other)
Creates a new BooleanExpression that holds true if this ObjectExpression is equal to a constant value.
BooleanBinding isEqualTo​(ObservableObjectValue<?> other)
Creates a new BooleanExpression that holds true if this and another ObservableObjectValue are equal.
BooleanBinding isNotEqualTo​(Object other)
Creates a new BooleanExpression that holds true if this ObjectExpression is not equal to a constant value.
BooleanBinding isNotEqualTo​(ObservableObjectValue<?> other)
Creates a new BooleanExpression that holds true if this and another ObservableObjectValue are not equal.
BooleanBinding isNotNull()
Creates a new BooleanBinding that holds true if this ObjectExpression is not null.
BooleanBinding isNull()
Creates a new BooleanBinding that holds true if this ObjectExpression is null.
static <T> ObjectExpression<T> objectExpression​(ObservableObjectValue<T> value)
Returns an ObjectExpression that wraps an ObservableObjectValue.

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

get

Methods declared in interface javafx.beans.value.ObservableValue

addListener, getValue, removeListener

Constructor Details

ObjectExpression

public ObjectExpression()
Creates a default ObjectExpression.

Method Details

objectExpression

public static <T> ObjectExpression<T> objectExpression(ObservableObjectValue<T> value)
Returns an ObjectExpression that wraps an ObservableObjectValue. If the ObservableObjectValue is already an ObjectExpression, it will be returned. Otherwise a new ObjectBinding is created that is bound to the ObservableObjectValue.
Type Parameters:
T - the type of the wrapped Object
Parameters:
value - The source ObservableObjectValue
Returns:
A ObjectExpression that wraps the ObservableObjectValue if necessary
Throws:
NullPointerException - if value is null

isEqualTo

public BooleanBinding isEqualTo(ObservableObjectValue<?> other)
Creates a new BooleanExpression that holds true if this and another ObservableObjectValue are equal.
Parameters:
other - the other ObservableObjectValue
Returns:
the new BooleanExpression
Throws:
NullPointerException - if other is null

isEqualTo

public BooleanBinding isEqualTo(Object other)
Creates a new BooleanExpression that holds true if this ObjectExpression is equal to a constant value.
Parameters:
other - the constant value
Returns:
the new BooleanExpression

isNotEqualTo

public BooleanBinding isNotEqualTo(ObservableObjectValue<?> other)
Creates a new BooleanExpression that holds true if this and another ObservableObjectValue are not equal.
Parameters:
other - the other ObservableObjectValue
Returns:
the new BooleanExpression
Throws:
NullPointerException - if other is null

isNotEqualTo

public BooleanBinding isNotEqualTo(Object other)
Creates a new BooleanExpression that holds true if this ObjectExpression is not equal to a constant value.
Parameters:
other - the constant value
Returns:
the new BooleanExpression

isNull

public BooleanBinding isNull()
Creates a new BooleanBinding that holds true if this ObjectExpression is null.
Returns:
the new BooleanBinding

isNotNull

public BooleanBinding isNotNull()
Creates a new BooleanBinding that holds true if this ObjectExpression is not null.
Returns:
the new BooleanBinding

asString

public StringBinding asString()
Creates a StringBinding that holds the value of this ObjectExpression turned into a String. If the value of this ObjectExpression changes, the value of the StringBinding will be updated automatically.
Returns:
the new StringBinding
Since:
JavaFX 8.0

asString

public StringBinding asString(String format)
Creates a StringBinding that holds the value of the ObjectExpression turned into a String. If the value of this ObjectExpression changes, the value of the StringBinding will be updated automatically.

The result is formatted according to the formatting String. See java.util.Formatter for formatting rules.

Parameters:
format - the formatting String
Returns:
the new StringBinding
Since:
JavaFX 8.0

asString

public StringBinding asString(Locale locale, String format)
Creates a StringBinding that holds the value of the NumberExpression turned into a String. If the value of this NumberExpression changes, the value of the StringBinding will be updated automatically.

The result is formatted according to the formatting String and the passed in Locale. See java.util.Formatter for formatting rules. See java.util.Locale for details on Locale.

Parameters:
locale - the Locale to be used
format - the formatting String
Returns:
the new StringBinding
Since:
JavaFX 8.0

© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API