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

Hierarchy

  • FilteredStreamDatasource

Implements

Constructors

Properties

_current: ITERATION_STATUS | T = ITERATION_STATUS.BEF_STRM
_filterIdx: {} = {}

Type declaration

    _unfilteredPos: number = 0
    filterFunc: ((T: any) => boolean)

    Type declaration

      • (T: any): boolean
      • Parameters

        • T: any

        Returns 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)

      Returns

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

      Parameters

      • cnt: number = 1

        the elements to look ahead

      Returns ITERATION_STATUS | T

    Generated using TypeDoc