Class AbstractNestedListBinding<T,U>
java.lang.Object
javafx.beans.binding.ObjectExpression<U>
javafx.beans.binding.ObjectBinding<U>
com.dlsc.gemsfx.binding.AbstractNestedListBinding<T,U>
- Type Parameters:
T- the type of the elements in the nested observable listsU- the type of the value computed by the binding, based on the nested list structure
- All Implemented Interfaces:
javafx.beans.binding.Binding<U>, javafx.beans.Observable, javafx.beans.value.ObservableObjectValue<U>, javafx.beans.value.ObservableValue<U>
- Direct Known Subclasses:
FlattenedNestedListStreamBinding, TransformedFlattenedNestedListStreamBinding, TransformedNestedListBinding
public abstract class AbstractNestedListBinding<T,U>
extends javafx.beans.binding.ObjectBinding<U>
Provides a base for creating bindings based on a nested structure of observable lists.
This abstract class handles the addition and removal of listeners to these nested observable lists
to facilitate easy updates and maintenance of bindings that depend on their content.
The class uses weak listeners to prevent memory leaks and ensure that lists can be garbage collected
when no longer in use. Changes in any of the nested lists will trigger an invalidation in the binding,
prompting a re-computation of its value based on the specific implementation of ObjectBinding.computeValue() in the subclass.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractNestedListBinding(javafx.collections.ObservableList<javafx.collections.ObservableList<T>> source) Constructs an AbstractNestedListBinding with the specified source of nested observable lists. -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()protected voidInitializes listeners on the source list and any existing nested lists.Methods inherited from class javafx.beans.binding.ObjectBinding
addListener, addListener, allowValidation, bind, computeValue, get, getDependencies, invalidate, isObserved, isValid, onInvalidating, removeListener, removeListener, toString, unbindMethods inherited from class javafx.beans.binding.ObjectExpression
asString, asString, asString, getValue, isEqualTo, isEqualTo, isNotEqualTo, isNotEqualTo, isNotNull, isNull, objectExpressionMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface javafx.beans.Observable
subscribeMethods inherited from interface javafx.beans.value.ObservableValue
flatMap, getValue, map, orElse, subscribe, subscribe, when
-
Field Details
-
source
-
-
Constructor Details
-
AbstractNestedListBinding
public AbstractNestedListBinding(javafx.collections.ObservableList<javafx.collections.ObservableList<T>> source) Constructs an AbstractNestedListBinding with the specified source of nested observable lists.- Parameters:
source- The observable list of observable lists that serves as the source for this binding.
-
-
Method Details
-
initListeners
protected void initListeners()Initializes listeners on the source list and any existing nested lists. This method should be called after subclass constructors have fully initialized any necessary fields to ensure that listeners interact with a fully initialized object. -
flattenSource
-
dispose
-