mona-dish
    Preparing search index...

    Class FilteredStreamDatasource<T>

    an intermediate data source which prefilters incoming stream data and lets only the data out which passes the filter function check

    Type Parameters

    • T

    Implements

    Index

    Constructors

    Properties

    _current: ITERATION_STATUS | T = ITERATION_STATUS.BEF_STRM
    _filterIdx: { [key: number]: boolean } = {}
    _unfilteredPos: number = 0
    filterFunc: (data: T) => boolean
    inputDataSource: IStreamDataSource<T>

    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 ITERATION_STATUS | T

    • in order to filter we have to make a look ahead until the first next allowed element hence we prefetch the element and then serve it via next

      Returns boolean

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

      Parameters

      • cnt: number = 1

        the elements to look ahead

      Returns ITERATION_STATUS | T

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