mona-dish
    Preparing search index...

    Interface IStreamDataSource<T>

    Every data source which feeds data into the lazy stream or stream generally must implement this interface

    It is basically an iteratable to the core

    interface IStreamDataSource<T> {
        current(): T | ITERATION_STATUS;
        hasNext(): boolean;
        lookAhead(cnt?: number): T | ITERATION_STATUS;
        next(): T | ITERATION_STATUS;
        reset(): void;
    }

    Type Parameters

    • T

    Implemented by

    Index

    Methods

    • returns the current element, returns the same element as the previous next call if there is no next before current called then we will call next as initial element

      Returns T | ITERATION_STATUS

    • Returns boolean

      true if additional data is present false if not

    • looks ahead cnt without changing the internal data "pointers" of the data source (this is mostly needed by possibly infinite constructs like lazy streams, because they do not know by definition their boundaries)

      Parameters

      • Optionalcnt: number

        the elements to look ahead

      Returns T | ITERATION_STATUS

      either the element or ITERATION_STATUS.EO_STRM if we hit the end of the stream before finding the "cnt" element

    • returns the next element in the stream

      Returns T | ITERATION_STATUS