Module javafx.base
Package javafx.beans.value
The package javafx.beans.value
contains the two
fundamental interfaces ObservableValue
and WritableValue
and all of its sub-interfaces.
ObservableValue
An ObservableValue wraps a value that can be read and observed for invalidations and changes. Listeners have to implement eitherInvalidationListener
or ChangeListener
. To allow
working with primitive types directly a number of sub-interfaces are
defined.
Type | Sub-interface of ObservableValue |
---|---|
boolean |
ObservableBooleanValue |
double |
ObservableDoubleValue |
float |
ObservableFloatValue |
int |
ObservableIntegerValue |
long |
ObservableLongValue |
double , float , int , long |
ObservableNumberValue |
Object |
ObservableObjectValue |
String |
ObservableStringValue |
WritableValue
A WritableValue wraps a value that can be read and set. As with
ObservableValues
, a number of sub-interfaces are defined to work with
primitive types directly.
Type | Sub-interface of WritableValue |
---|---|
boolean |
WritableBooleanValue |
double |
WritableDoubleValue |
float |
WritableFloatValue |
int |
WritableIntegerValue |
long |
WritableLongValue |
double , float , int , long |
WritableNumberValue |
Object |
WritableObjectValue |
String |
WritableStringValue |
-
Interface Summary Interface Description ChangeListener<T> AChangeListener
is notified whenever the value of anObservableValue
changes.ObservableBooleanValue An observable boolean value.ObservableDoubleValue An observable double value.ObservableFloatValue An observable float value.ObservableIntegerValue An observable integer value.ObservableListValue<E> An observable reference to anObservableList
.ObservableLongValue An observable long value.ObservableMapValue<K,V> An observable reference to anObservableMap
.ObservableNumberValue A common interface of all sub-interfaces ofObservableValue
that wrap a number.ObservableObjectValue<T> An observable typedObject
value.ObservableSetValue<E> An observable reference to anObservableSet
.ObservableStringValue An observable String value.ObservableValue<T> AnObservableValue
is an entity that wraps a value and allows to observe the value for changes.WritableBooleanValue A writable boolean value.WritableDoubleValue A writable double value.WritableFloatValue A writable float value.WritableIntegerValue A writable int value.WritableListValue<E> A writable reference to anObservableList
.WritableLongValue A writable long value.WritableMapValue<K,V> A writable reference to anObservableMap
.WritableNumberValue A tagging interface that marks all sub-interfaces ofWritableValue
that wrap a number.WritableObjectValue<T> A writable typed value.WritableSetValue<E> A writable reference to anObservableSet
.WritableStringValue A writable String.WritableValue<T> AWritableValue
is an entity that wraps a value that can be read and set. -
Class Summary Class Description ObservableValueBase<T> A convenience class for creating implementations ofObservableValue
.WeakChangeListener<T> AWeakChangeListener
can be used, if anObservableValue
should only maintain a weak reference to the listener.