Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Iterator

A lazy collection iterator yields a single value at time upon request

Hierarchy

  • Iterator

Index

Constructors

constructor

  • Parameters

    • source: Source

      An iterable object or function. Array - return one element per cycle Object{next:Function} - call next() for the next value (this also handles generator functions) Function - call to return the next value

    Returns Iterator

Properties

Private __buf

__buf: AnyVal[]

Private __done

__done: boolean

Private __first

__first: boolean

Private __iteratees

__iteratees: Iteratee[]

Private __next

__next: Callback<Value>

Methods

Private _push

Private _validate

  • _validate(): void

drop

  • Drop a number of values from the sequence

    Parameters

    • n: number

      Number of items to drop greater than 0

    Returns Iterator

each

  • Execute the funcion for each value. Will stop when an execution returns false.

    Parameters

    Returns boolean

    false iff f return false for AnyVal execution, otherwise true

filter

first

  • Mark this lazy object to return only the first result on lazy.value(). No more iteratees or transformations can be added after this method is called.

    Returns Iterator

map

next

reduce

  • reduce<T>(f: Callback<T>, initialValue: T): T
  • Returns the reduction of sequence according the reducing function

    Type parameters

    • T

    Parameters

    • f: Callback<T>

      a reducing function

    • initialValue: T

    Returns T

size

  • size(): number
  • Returns the number of matched items in the sequence

    Returns number

take

  • Take given numbe for values from sequence

    Parameters

    • n: number

      A number greater than 0

    Returns Iterator

transform

  • Returns a new lazy object with results of the transformation The entire sequence is realized.

    Parameters

    Returns Iterator

value

  • Returns the fully realized values of the iterators. The return value will be an array unless lazy.first() was used. The realized values are cached for subsequent calls

    Returns AnyVal

Generated using TypeDoc