Module javafx.base

Class SetBinding<E>

java.lang.Object
javafx.beans.binding.SetExpression<E>
javafx.beans.binding.SetBinding<E>
Type Parameters:
E - the type of the Set elements
All Implemented Interfaces:
Iterable<E>, Collection<E>, Set<E>, Binding<ObservableSet<E>>, Observable, ObservableObjectValue<ObservableSet<E>>, ObservableSetValue<E>, ObservableValue<ObservableSet<E>>, ObservableSet<E>

public abstract class SetBinding<E> extends SetExpression<E> implements Binding<ObservableSet<E>>
Base class that provides most of the functionality needed to implement a Binding of an ObservableSet.

SetBinding provides a simple invalidation-scheme. An extending class can register dependencies by calling bind(Observable...). If one of the registered dependencies becomes invalid, this SetBinding is marked as invalid. With unbind(Observable...) listening to dependencies can be stopped.

To provide a concrete implementation of this class, the method computeValue() has to be implemented to calculate the value of this binding based on the current state of the dependencies. It is called when get() is called for an invalid binding.

See DoubleBinding for an example how this base class can be extended.

Since:
JavaFX 2.1
See Also: