ShimIterable<VALUE>
Exported By | |
---|---|
All Extended Interfaces |
|
All Known Implementations |
Common interface extending both goog.iter.Iterable
and ES6 Iterable
,
and providing toGoog()
and toEs6()
methods to get either kind
of iterator. ShimIterable.of()
is the primary entry point for
this library. If it is given an iterable that is not also an
iterator, then it will inherit any reusability from its argument
(i.e. ShimIterable.of(mySet)
will be reusable, since mySet makes
a fresh Iterator every time, whereas ShimIterable.of(myIterator)
will be one-shot).
ShimGoogIterator
and ShimEs6Iterator
extend ShimIterable
and
also implement one or the other iterator API. Since they extend
ShimIterable
, it is easy to convert back and forth between the two
APIs. Any such conversion will expose a view to the same underlying
iterator, so elements pulled via one API will not be available from
the other.