net.corda.client.fxutils

## Class ObservableFoldKt

- net.corda.client.fxutils.ObservableFoldKt

-     public class ObservableFoldKt

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <T,R> R` | `fold(rx.Observable<T> $receiver, R accumulator, kotlin.jvm.functions.Function2<? super R,? super T,kotlin.Unit> folderFun)` fold takes an rx.Observable stream and applies fold function on it, and collects all elements using the accumulator.
    `static <A,B> javafx.beans.value.ObservableValue<B>` | `foldToObservableValue(rx.Observable<A> $receiver, B initial, kotlin.jvm.functions.Function2<? super A,? super B,? extends B> folderFun)` foldToObservableValue takes an rx.Observable stream and creates an ObservableValue out of it.
    `static <A,K> javafx.collections.ObservableMap<K,A>` | `recordAsAssociation(rx.Observable<A> $receiver, kotlin.jvm.functions.Function1<? super A,? extends K> toKey, kotlin.jvm.functions.Function3<? super K,? super A,? super A,? extends A> merge)` This variant simply associates each event with its key.
    `static <A> javafx.collections.ObservableList<A>` | `recordInSequence(rx.Observable<A> $receiver)` recordInSequence records incoming events on the rx.Observable in sequence.

- - ### Method Detail

    - #### foldToObservableValue

          public static <A,B> javafx.beans.value.ObservableValue<B> foldToObservableValue(rx.Observable<A> $receiver,
                                                                                          B initial,
                                                                                          kotlin.jvm.functions.Function2<? super A,? super B,? extends B> folderFun)

      foldToObservableValue takes an rx.Observable stream and creates an ObservableValue out of it.

      Parameters:
        `initial` - The initial value of the returned observable.
        `folderFun` - The transformation function to be called on the observable value when a new element is emitted on the stream.

    - #### fold

          public static <T,R> R fold(rx.Observable<T> $receiver,
                                     R accumulator,
                                     kotlin.jvm.functions.Function2<? super R,? super T,kotlin.Unit> folderFun)

      fold takes an rx.Observable stream and applies fold function on it, and collects all elements using the accumulator.

      Parameters:
        `accumulator` - The accumulator for accumulating elements.
        `folderFun` - The transformation function to be called on the observable list when a new element is emitted on the stream, which should modify the list as needed.

    - #### recordInSequence

          public static <A> javafx.collections.ObservableList<A> recordInSequence(rx.Observable<A> $receiver)

      recordInSequence records incoming events on the rx.Observable in sequence.

    - #### recordAsAssociation

          public static <A,K> javafx.collections.ObservableMap<K,A> recordAsAssociation(rx.Observable<A> $receiver,
                                                                                        kotlin.jvm.functions.Function1<? super A,? extends K> toKey,
                                                                                        kotlin.jvm.functions.Function3<? super K,? super A,? super A,? extends A> merge)

      This variant simply associates each event with its key.

      Parameters:
        `toKey` - Function retrieving the key to associate with.
        `merge` - The function to be called if there is an existing element at the key.