Class FlattenedNestedListStreamBinding<T>

java.lang.Object
javafx.beans.binding.ObjectExpression<Stream<T>>
javafx.beans.binding.ObjectBinding<Stream<T>>
com.dlsc.gemsfx.binding.AbstractNestedListBinding<T, Stream<T>>
com.dlsc.gemsfx.binding.FlattenedNestedListStreamBinding<T>
Type Parameters:
T - the type of the elements contained within the nested lists
All Implemented Interfaces:
javafx.beans.binding.Binding<Stream<T>>, javafx.beans.Observable, javafx.beans.value.ObservableObjectValue<Stream<T>>, javafx.beans.value.ObservableValue<Stream<T>>

public class FlattenedNestedListStreamBinding<T> extends AbstractNestedListBinding<T, Stream<T>>
Binds a nested structure of ObservableList<ObservableList<T>> to a flattened Stream<T>. This binding class listens for changes in the nested lists and provides a continuously updated stream that represents the flattened view of these lists. This stream can be used for further processing such as collecting into lists, sets, or applying transformations.

Each call to getValue() will provide a new stream based on the current state of the nested lists.

  • Field Summary

    Fields inherited from class AbstractNestedListBinding

    source
  • Constructor Summary

    Constructors
    Constructor
    Description
    FlattenedNestedListStreamBinding(javafx.collections.ObservableList<javafx.collections.ObservableList<T>> source)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Stream<T>
    Computes the value of the binding by flattening all elements contained within the source nested lists into a single stream.

    Methods inherited from class javafx.beans.binding.ObjectBinding

    addListener, addListener, allowValidation, bind, get, getDependencies, invalidate, isObserved, isValid, onInvalidating, removeListener, removeListener, toString, unbind

    Methods inherited from class javafx.beans.binding.ObjectExpression

    asString, asString, asString, getValue, isEqualTo, isEqualTo, isNotEqualTo, isNotEqualTo, isNotNull, isNull, objectExpression

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface javafx.beans.Observable

    subscribe

    Methods inherited from interface javafx.beans.value.ObservableValue

    flatMap, getValue, map, orElse, subscribe, subscribe, when
  • Constructor Details

    • FlattenedNestedListStreamBinding

      public FlattenedNestedListStreamBinding(javafx.collections.ObservableList<javafx.collections.ObservableList<T>> source)
  • Method Details

    • computeValue

      protected Stream<T> computeValue()
      Computes the value of the binding by flattening all elements contained within the source nested lists into a single stream. This method provides a stream of all elements, which can be collected or further processed by the consumer as needed.
      Specified by:
      computeValue in class javafx.beans.binding.ObjectBinding<Stream<T>>
      Returns:
      The flattened stream of all elements.