Class ObjectExpression<T>
- javafx.beans.binding.ObjectExpression<T>
All Implemented Interfaces:
Direct Known Subclasses:
public abstract class ObjectExpression<T> extends Object implements ObservableObjectValue<T>
ObjectExpression is a 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 and Description ObjectExpression()
-
Method Summary
All MethodsStatic MethodsInstance MethodsConcrete Methods Modifier and Type Method and Description StringBindingasString()StringBindingasString(Locale locale, String format)StringBindingasString(String format)TgetValue()Returns the current value of thisObservableValueBooleanBindingisEqualTo(Object other)Creates a newBooleanExpressionthat holdstrueif thisObjectExpressionis equal to a constant value.BooleanBindingisEqualTo(ObservableObjectValue<?> other)Creates a newBooleanExpressionthat holdstrueif this and anotherObservableObjectValueare equal.BooleanBindingisNotEqualTo(Object other)Creates a newBooleanExpressionthat holdstrueif thisObjectExpressionis not equal to a constant value.BooleanBindingisNotEqualTo(ObservableObjectValue<?> other)Creates a newBooleanExpressionthat holdstrueif this and anotherObservableObjectValueare not equal.BooleanBindingisNotNull()BooleanBindingisNull()static <T> ObjectExpression<T>objectExpression(ObservableObjectValue<T> value)Returns anObjectExpressionthat wraps anObservableObjectValue.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javafx.beans.value.ObservableObjectValue
get
-
Methods inherited from interface javafx.beans.value.ObservableValue
addListener, removeListener
-
Methods inherited from interface javafx.beans.Observable
addListener, removeListener
-
-
Constructor Detail
-
ObjectExpression
public ObjectExpression()
-
-
Method Detail
-
getValue
public T getValue()
Description copied from interface:ObservableValueReturns the current value of thisObservableValueSpecified by:
getValuein interfaceObservableValue<T>Returns:
The current value
-
objectExpression
public static <T> ObjectExpression<T> objectExpression(ObservableObjectValue<T> value)
Returns anObjectExpressionthat wraps anObservableObjectValue. If theObservableObjectValueis already anObjectExpression, it will be returned. Otherwise a newObjectBindingis created that is bound to theObservableObjectValue.Parameters:
value- The sourceObservableObjectValueReturns:
A
ObjectExpressionthat wraps theObservableObjectValueif necessaryThrows:
NullPointerException- ifvalueisnull
-
isEqualTo
public BooleanBinding isEqualTo(ObservableObjectValue<?> other)
Creates a newBooleanExpressionthat holdstrueif this and anotherObservableObjectValueare equal.Parameters:
other- the otherObservableObjectValueReturns:
the new
BooleanExpressionThrows:
NullPointerException- ifotherisnull
-
isEqualTo
public BooleanBinding isEqualTo(Object other)
Creates a newBooleanExpressionthat holdstrueif thisObjectExpressionis equal to a constant value.Parameters:
other- the constant valueReturns:
the new
BooleanExpression
-
isNotEqualTo
public BooleanBinding isNotEqualTo(ObservableObjectValue<?> other)
Creates a newBooleanExpressionthat holdstrueif this and anotherObservableObjectValueare not equal.Parameters:
other- the otherObservableObjectValueReturns:
the new
BooleanExpressionThrows:
NullPointerException- ifotherisnull
-
isNotEqualTo
public BooleanBinding isNotEqualTo(Object other)
Creates a newBooleanExpressionthat holdstrueif thisObjectExpressionis not equal to a constant value.Parameters:
other- the constant valueReturns:
the new
BooleanExpression
-
isNull
public BooleanBinding isNull()
Returns:
the new
BooleanBinding
-
isNotNull
public BooleanBinding isNotNull()
Returns:
the new
BooleanBinding
-
asString
public StringBinding asString()
Creates aStringBindingthat holds the value of thisObjectExpressionturned into aString. If the value of thisObjectExpressionchanges, the value of theStringBindingwill be updated automatically.Returns:
the new
StringBindingSince:
JavaFX 8.0
-
asString
public StringBinding asString(String format)
Creates aStringBindingthat holds the value of theObjectExpressionturned into aString. If the value of thisObjectExpressionchanges, the value of theStringBindingwill be updated automatically.The result is formatted according to the formatting
String. Seejava.util.Formatterfor formatting rules.Parameters:
format- the formattingStringReturns:
the new
StringBindingSince:
JavaFX 8.0
-
asString
public StringBinding asString(Locale locale, String format)Creates aStringBindingthat holds the value of theNumberExpressionturned into aString. If the value of thisNumberExpressionchanges, the value of theStringBindingwill be updated automatically.The result is formatted according to the formatting
Stringand the passed inLocale. Seejava.util.Formatterfor formatting rules. Seejava.util.Localefor details onLocale.Parameters:
format- the formattingStringReturns:
the new
StringBindingSince:
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.