You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
189 lines
52 KiB
189 lines
52 KiB
<!DOCTYPE html><meta charset="UTF-8"><meta http-equiv="Content-Language" content="en" /><title>goog.iter</title><link href="dossier.css" rel="stylesheet" type="text/css"><div id="main-wrapper"><input type="checkbox" id="sidenav-toggle" /><main><header><h1>Namespace goog.iter</h1><a class="source" href="source/lib/goog/iter/iter.js.src.html#l21">code »</a></header><section></section><section><h2>Classes</h2><div class="type-summary"><table><tbody><tr><td><dl><dt><a href="class_goog_iter_GroupByIterator_.html">goog.iter.GroupByIterator_</a><dd>Implements the <code >goog.iter.groupBy</code> iterator.<dt><a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a><dd>Class/interface for iterators.</dl></table></div></section><div id="visibility-controls"><b>Show:</b><label for="show-public"><span><input type="checkbox" id="show-public" checked/></span>Public</label><label for="show-protected"><span><input type="checkbox" id="show-protected"/></span>Protected</label><label for="show-private"><span><input type="checkbox" id="show-private"/></span>Private</label></div><section id="typedefs"><h2>Type Definitions</h2><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l35">code »</a><a class="member" name="goog.iter.Iterable">goog.iter.Iterable</a> : <code class="type">(<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>|{length: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>}|{__iterator__: ?})</code></div><div>No description.</div></summary></details></div></div></section><section id="static-functions"><h2>Global Functions</h2><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l774">code »</a><span class="member"><a name="goog.iter.accumulate">goog.iter.accumulate</a> <span class="args">( iterable )</span> ⇒ <code class="type">!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>></code></span></div><p>Creates an iterator that returns running totals from the numbers in
|
|
<code >iterable</code>. For example, the array <code >[1, 2, 3, 4, 5]</code> yields
|
|
<code >1 -> 3 -> 6 -> 10 -> 15</code>.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>iterable: <code class="type">!<a href="namespace_goog_iter.html#goog.iter.Iterable">goog.iter.Iterable</a>.<<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>></code><dd>The iterable of numbers to
|
|
accumulate.</dl><tr><th>Returns<tr><td><dl>A new iterator that returns the
|
|
numbers in the series.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l427">code »</a><code class="type"><VALUE></code> <span class="member"><a name="goog.iter.chain">goog.iter.chain</a> <span class="args">( var_args )</span> ⇒ <code class="type">!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE></code></span></div><p>Takes zero or more iterables and returns one iterator that will iterate over
|
|
them in the order chained.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>var_args: <code class="type">...(!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>|!<a href="namespace_goog_iter.html#goog.iter.Iterable">goog.iter.Iterable</a>)</code><dd>Any
|
|
number of iterable objects.</dl><tr><th>Returns<tr><td><dl>Returns a new iterator that will
|
|
iterate over all the given iterables' contents.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l463">code »</a><code class="type"><VALUE></code> <span class="member"><a name="goog.iter.chainFromIterable">goog.iter.chainFromIterable</a> <span class="args">( iterable )</span> ⇒ <code class="type">!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE></code></span></div><p>Takes a single iterable containing zero or more iterables and returns one
|
|
iterator that will iterate over each one in the order given.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>iterable: <code class="type"><a href="namespace_goog_iter.html#goog.iter.Iterable">goog.iter.Iterable</a></code><dd>The iterable of iterables to chain.</dl><tr><th>Returns<tr><td><dl>Returns a new iterator that will
|
|
iterate over all the contents of the iterables contained within
|
|
<code >iterable</code>.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l1247">code »</a><code class="type"><VALUE></code> <span class="member"><a name="goog.iter.combinations">goog.iter.combinations</a> <span class="args">( iterable, length )</span> ⇒ <code class="type">!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a></code></span></div><p>Creates an iterator that returns combinations of elements from
|
|
<code >iterable</code>.
|
|
|
|
Combinations are obtained by taking the goog.iter#permutations of
|
|
<code >iterable</code> and filtering those whose elements appear in the order they
|
|
are encountered in <code >iterable</code>. For example, the 3-length combinations
|
|
of <code >[0,1,2,3]</code> are <code >[[0,1,2], [0,1,3], [0,2,3], [1,2,3]]</code>.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>iterable: <code class="type">(!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>|!<a href="namespace_goog_iter.html#goog.iter.Iterable">goog.iter.Iterable</a>)</code><dd>The
|
|
iterable from which to generate combinations.<dt>length: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd>The length of each combination.</dl><tr><th>Returns<tr><td><dl>A new iterator containing
|
|
combinations from the <code >iterable</code>.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l1290">code »</a><code class="type"><VALUE></code> <span class="member"><a name="goog.iter.combinationsWithReplacement">goog.iter.combinationsWithReplacement</a> <span class="args">( iterable, length )</span> ⇒ <code class="type">!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a></code></span></div><p>Creates an iterator that returns combinations of elements from
|
|
<code >iterable</code>, with repeated elements possible.
|
|
|
|
Combinations are obtained by taking the Cartesian product of <code >length</code>
|
|
iterables and filtering those whose elements appear in the order they are
|
|
encountered in <code >iterable</code>. For example, the 2-length combinations of
|
|
<code >[1,2,3]</code> are <code >[[1,1], [1,2], [1,3], [2,2], [2,3], [3,3]]</code>.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>iterable: <code class="type">(!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>|!<a href="namespace_goog_iter.html#goog.iter.Iterable">goog.iter.Iterable</a>)</code><dd>The
|
|
iterable to combine.<dt>length: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd>The length of each combination.</dl><tr><th>Returns<tr><td><dl>A new iterator containing
|
|
combinations from the <code >iterable</code>.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l888">code »</a><code class="type"><VALUE></code> <span class="member"><a name="goog.iter.compress">goog.iter.compress</a> <span class="args">( iterable, selectors )</span> ⇒ <code class="type">!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE></code></span></div><p>Creates an iterator that filters <code >iterable</code> based on a series of
|
|
<code >selectors</code>. On each call to <code >next()</code>, one item is taken from
|
|
both the <code >iterable</code> and <code >selectors</code> iterators. If the item from
|
|
<code >selectors</code> evaluates to true, the item from <code >iterable</code> is given.
|
|
Otherwise, it is skipped. Once either <code >iterable</code> or <code >selectors</code>
|
|
is exhausted, subsequent calls to <code >next()</code> will throw
|
|
<code >goog.iter.StopIteration</code>.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>iterable: <code class="type">(!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>|!<a href="namespace_goog_iter.html#goog.iter.Iterable">goog.iter.Iterable</a>)</code><dd>The
|
|
iterable to filter.<dt>selectors: <code class="type">(!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>|!<a href="namespace_goog_iter.html#goog.iter.Iterable">goog.iter.Iterable</a>)</code><dd>An
|
|
iterable of items to be evaluated in a boolean context to determine if
|
|
the corresponding element in <code >iterable</code> should be included in the
|
|
result.</dl><tr><th>Returns<tr><td><dl>A new iterator that returns the
|
|
filtered values.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l1145">code »</a><code class="type"><VALUE></code> <span class="member"><a name="goog.iter.consume">goog.iter.consume</a> <span class="args">( iterable, count )</span> ⇒ <code class="type">!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE></code></span></div><p>Creates an iterator that is advanced <code >count</code> steps ahead. Consumed
|
|
values are silently discarded. If <code >count</code> is greater than the number
|
|
of elements in <code >iterable</code>, an empty iterator is returned. Subsequent
|
|
calls to <code >next()</code> will throw <code >goog.iter.StopIteration</code>.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>iterable: <code class="type">(!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>|!<a href="namespace_goog_iter.html#goog.iter.Iterable">goog.iter.Iterable</a>)</code><dd>The
|
|
iterable to consume.<dt>count: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd>The number of elements to consume from the iterator.</dl><tr><th>Returns<tr><td><dl>An iterator advanced zero or more steps
|
|
ahead.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l733">code »</a><span class="member"><a name="goog.iter.count">goog.iter.count</a> <span class="args">( opt_start, opt_step )</span> ⇒ <code class="type">!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>></code></span></div><p>Creates an iterator that counts indefinitely from a starting value.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>opt_start: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>=</code><dd>The starting value. Default is 0.<dt>opt_step: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>=</code><dd>The number to increment with between each call to
|
|
next. Negative and floating point numbers are allowed. Default is 1.</dl><tr><th>Returns<tr><td><dl>A new iterator that returns the values
|
|
in the series.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l676">code »</a><code class="type"><VALUE></code> <span class="member"><a name="goog.iter.cycle">goog.iter.cycle</a> <span class="args">( iterable )</span> ⇒ <code class="type">!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE></code></span></div><p>Create an iterator to cycle over the iterable's elements indefinitely.
|
|
For example, ([1, 2, 3]) would return : 1, 2, 3, 1, 2, 3, ...</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>iterable: <code class="type">(!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>|!<a href="namespace_goog_iter.html#goog.iter.Iterable">goog.iter.Iterable</a>)</code><dd>The
|
|
iterable object.</dl><tr><th>Returns<tr><td><dl>An iterator that iterates indefinitely
|
|
over the values in <code >iterable</code>.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l483">code »</a><code class="type"><THIS, VALUE></code> <span class="member"><a name="goog.iter.dropWhile">goog.iter.dropWhile</a> <span class="args">( iterable, f, opt_obj )</span> ⇒ <code class="type">!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE></code></span></div><p>Builds a new iterator that iterates over the original, but skips elements as
|
|
long as a supplied function returns true.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>iterable: <code class="type">(<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>|<a href="namespace_goog_iter.html#goog.iter.Iterable">goog.iter.Iterable</a>)</code><dd>The iterator
|
|
object.<dt>f: <code class="type">function(this: THIS, VALUE, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined">undefined</a>, <a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code><dd>The function to call for every value. This function takes 3 arguments
|
|
(the value, undefined, and the iterator) and should return a boolean.<dt>opt_obj: <code class="type">THIS=</code><dd>The object to be used as the value of 'this' within
|
|
<code >f</code>.</dl><tr><th>Returns<tr><td><dl>A new iterator that drops elements from
|
|
the original iterator as long as <code >f</code> is true.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l1097">code »</a><code class="type"><VALUE></code> <span class="member"><a name="goog.iter.enumerate">goog.iter.enumerate</a> <span class="args">( iterable, opt_start )</span> ⇒ <code class="type">!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a></code></span></div><p>Creates an iterator that returns arrays containing a count and an element
|
|
obtained from the given <code >iterable</code>.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>iterable: <code class="type">(!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>|!<a href="namespace_goog_iter.html#goog.iter.Iterable">goog.iter.Iterable</a>)</code><dd>The
|
|
iterable to enumerate.<dt>opt_start: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>=</code><dd>Optional starting value. Default is 0.</dl><tr><th>Returns<tr><td><dl>A new iterator containing count/item
|
|
pairs.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l570">code »</a><code class="type"><VALUE></code> <span class="member"><a name="goog.iter.equals">goog.iter.equals</a> <span class="args">( iterable1, iterable2 )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Iterates over two iterables and returns true if they contain the same
|
|
sequence of elements and have the same length.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>iterable1: <code class="type">(!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>|!<a href="namespace_goog_iter.html#goog.iter.Iterable">goog.iter.Iterable</a>)</code><dd>The first
|
|
iterable object.<dt>iterable2: <code class="type">(!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>|!<a href="namespace_goog_iter.html#goog.iter.Iterable">goog.iter.Iterable</a>)</code><dd>The second
|
|
iterable object.</dl><tr><th>Returns<tr><td><dl>true if the iterables contain the same sequence of elements
|
|
and have the same length.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l400">code »</a><code class="type"><THIS, VALUE></code> <span class="member"><a name="goog.iter.every">goog.iter.every</a> <span class="args">( iterable, f, opt_obj )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Goes through the values in the iterator. Calls f for each of these and if any
|
|
of them returns false this returns false (without checking the rest). If all
|
|
return true this will return true.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>iterable: <code class="type">(<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>|<a href="namespace_goog_iter.html#goog.iter.Iterable">goog.iter.Iterable</a>)</code><dd>The iterator
|
|
object.<dt>f: <code class="type">function(this: THIS, VALUE, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined">undefined</a>, <a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code><dd>The function to call for every value. This function takes 3 arguments
|
|
(the value, undefined, and the iterator) and should return a boolean.<dt>opt_obj: <code class="type">THIS=</code><dd>The object to be used as the value of 'this' within
|
|
<code >f</code>.</dl><tr><th>Returns<tr><td><dl>true if every value passes the test.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l201">code »</a><code class="type"><THIS, VALUE></code> <span class="member"><a name="goog.iter.filter">goog.iter.filter</a> <span class="args">( iterable, f, opt_obj )</span> ⇒ <code class="type">!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE></code></span></div><p>Calls a function for every element in the iterator, and if the function
|
|
returns true adds the element to a new iterator.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>iterable: <code class="type">(<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>|<a href="namespace_goog_iter.html#goog.iter.Iterable">goog.iter.Iterable</a>)</code><dd>The iterator
|
|
to iterate over.<dt>f: <code class="type">function(this: THIS, VALUE, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined">undefined</a>, <a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code><dd>The function to call for every element. This function takes 3 arguments
|
|
(the element, undefined, and the iterator) and should return a boolean.
|
|
If the return value is true the element will be included in the returned
|
|
iterator. If it is false the element is not included.<dt>opt_obj: <code class="type">THIS=</code><dd>The object to be used as the value of 'this' within
|
|
<code >f</code>.</dl><tr><th>Returns<tr><td><dl>A new iterator in which only elements
|
|
that passed the test are present.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l234">code »</a><code class="type"><THIS, VALUE></code> <span class="member"><a name="goog.iter.filterFalse">goog.iter.filterFalse</a> <span class="args">( iterable, f, opt_obj )</span> ⇒ <code class="type">!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE></code></span></div><p>Calls a function for every element in the iterator, and if the function
|
|
returns false adds the element to a new iterator.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>iterable: <code class="type">(<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>|<a href="namespace_goog_iter.html#goog.iter.Iterable">goog.iter.Iterable</a>)</code><dd>The iterator
|
|
to iterate over.<dt>f: <code class="type">function(this: THIS, VALUE, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined">undefined</a>, <a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code><dd>The function to call for every element. This function takes 3 arguments
|
|
(the element, undefined, and the iterator) and should return a boolean.
|
|
If the return value is false the element will be included in the returned
|
|
iterator. If it is true the element is not included.<dt>opt_obj: <code class="type">THIS=</code><dd>The object to be used as the value of 'this' within
|
|
<code >f</code>.</dl><tr><th>Returns<tr><td><dl>A new iterator in which only elements
|
|
that did not pass the test are present.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l154">code »</a><code class="type"><THIS, VALUE></code> <span class="member"><a name="goog.iter.forEach">goog.iter.forEach</a> <span class="args">( iterable, f, opt_obj )</span></span></div><p>Calls a function for each element in the iterator with the element of the
|
|
iterator passed as argument.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>iterable: <code class="type">(<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>|<a href="namespace_goog_iter.html#goog.iter.Iterable">goog.iter.Iterable</a>)</code><dd>The iterator
|
|
to iterate over. If the iterable is an object <code >toIterator</code> will be
|
|
called on it.<dt>f: <code class="type">(function(this: THIS, VALUE, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined">undefined</a>, <a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>)|function(this: THIS, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined">undefined</a>, <a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>))</code><dd>The function to call for every element. This function takes 3 arguments
|
|
(the element, undefined, and the iterator) and the return value is
|
|
irrelevant. The reason for passing undefined as the second argument is
|
|
so that the same function can be used in goog.array#forEach as
|
|
well as others.<dt>opt_obj: <code class="type">THIS=</code><dd>The object to be used as the value of 'this' within
|
|
<code >f</code>.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l999">code »</a><code class="type"><KEY, VALUE></code> <span class="member"><a name="goog.iter.groupBy">goog.iter.groupBy</a> <span class="args">( iterable, opt_keyFunc )</span> ⇒ <code class="type">!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a></code></span></div><p>Creates an iterator that returns arrays containing elements from the
|
|
<code >iterable</code> grouped by a key value. For iterables with repeated
|
|
elements (i.e. sorted according to a particular key function), this function
|
|
has a <code >uniq</code>-like effect. For example, grouping the array:
|
|
<code >[A, B, B, C, C, A]</code> produces
|
|
<code >[A, [A]], [B, [B, B]], [C, [C, C]], [A, [A]]</code>.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>iterable: <code class="type">(!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>|!<a href="namespace_goog_iter.html#goog.iter.Iterable">goog.iter.Iterable</a>)</code><dd>The
|
|
iterable to group.<dt>opt_keyFunc: <code class="type">function(VALUE): KEY=</code><dd>Optional function for
|
|
determining the key value for each group in the <code >iterable</code>. Default
|
|
is the identity function.</dl><tr><th>Returns<tr><td><dl>A new iterator that returns arrays of
|
|
consecutive key and groups.</dl></table></div></details></div></div><div class="wrap-details private"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l1194">code »</a><code class="type"><VALUE></code> <span class="member"><a name="goog.iter.hasDuplicates_">goog.iter.hasDuplicates_</a> <span class="args">( arr )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Checks an array for duplicate elements.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>arr: <code class="type">(<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.<VALUE>|<a href="namespace_goog_array.html#goog.array.ArrayLike">goog.array.ArrayLike</a>)</code><dd>The array to check for
|
|
duplicates.</dl><tr><th>Returns<tr><td><dl>True, if the array contains duplicates, false otherwise.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l290">code »</a><code class="type"><VALUE></code> <span class="member"><a name="goog.iter.join">goog.iter.join</a> <span class="args">( iterable, deliminator )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>Joins the values in a iterator with a delimiter.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>iterable: <code class="type">(<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>|<a href="namespace_goog_iter.html#goog.iter.Iterable">goog.iter.Iterable</a>)</code><dd>The iterator
|
|
to get the values from.<dt>deliminator: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>The text to put between the values.</dl><tr><th>Returns<tr><td><dl>The joined value string.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l1114">code »</a><code class="type"><VALUE></code> <span class="member"><a name="goog.iter.limit">goog.iter.limit</a> <span class="args">( iterable, limitSize )</span> ⇒ <code class="type">!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE></code></span></div><p>Creates an iterator that returns the first <code >limitSize</code> elements from an
|
|
iterable. If this number is greater than the number of elements in the
|
|
iterable, all the elements are returned.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>iterable: <code class="type">(!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>|!<a href="namespace_goog_iter.html#goog.iter.Iterable">goog.iter.Iterable</a>)</code><dd>The
|
|
iterable to limit.<dt>limitSize: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd>The maximum number of elements to return.</dl><tr><th>Returns<tr><td><dl>A new iterator containing
|
|
<code >limitSize</code> elements.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l312">code »</a><code class="type"><THIS, VALUE, RESULT></code> <span class="member"><a name="goog.iter.map">goog.iter.map</a> <span class="args">( iterable, f, opt_obj )</span> ⇒ <code class="type">!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<RESULT></code></span></div><p>For every element in the iterator call a function and return a new iterator
|
|
with that value.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>iterable: <code class="type">(!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>|!<a href="namespace_goog_iter.html#goog.iter.Iterable">goog.iter.Iterable</a>)</code><dd>The
|
|
iterator to iterate over.<dt>f: <code class="type">function(this: THIS, VALUE, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined">undefined</a>, !<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>): RESULT</code><dd>The function to call for every element. This function takes 3 arguments
|
|
(the element, undefined, and the iterator) and should return a new value.<dt>opt_obj: <code class="type">THIS=</code><dd>The object to be used as the value of 'this' within
|
|
<code >f</code>.</dl><tr><th>Returns<tr><td><dl>A new iterator that returns the
|
|
results of applying the function to each element in the original
|
|
iterator.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l589">code »</a><code class="type"><VALUE></code> <span class="member"><a name="goog.iter.nextOrValue">goog.iter.nextOrValue</a> <span class="args">( iterable, defaultValue )</span> ⇒ <code class="type">VALUE</code></span></div><p>Advances the iterator to the next position, returning the given default value
|
|
instead of throwing an exception if the iterator has no more entries.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>iterable: <code class="type">(<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>|<a href="namespace_goog_iter.html#goog.iter.Iterable">goog.iter.Iterable</a>)</code><dd>The iterable
|
|
object.<dt>defaultValue: <code class="type">VALUE</code><dd>The value to return if the iterator is empty.</dl><tr><th>Returns<tr><td><dl>The next item in the iteration, or defaultValue if the
|
|
iterator was empty.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l1218">code »</a><code class="type"><VALUE></code> <span class="member"><a name="goog.iter.permutations">goog.iter.permutations</a> <span class="args">( iterable, opt_length )</span> ⇒ <code class="type">!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a></code></span></div><p>Creates an iterator that returns permutations of elements in
|
|
<code >iterable</code>.
|
|
|
|
Permutations are obtained by taking the Cartesian product of
|
|
<code >opt_length</code> iterables and filtering out those with repeated
|
|
elements. For example, the permutations of <code >[1,2,3]</code> are
|
|
<code >[[1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1]]</code>.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>iterable: <code class="type">(!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>|!<a href="namespace_goog_iter.html#goog.iter.Iterable">goog.iter.Iterable</a>)</code><dd>The
|
|
iterable from which to generate permutations.<dt>opt_length: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>=</code><dd>Length of each permutation. If omitted, defaults
|
|
to the length of <code >iterable</code>.</dl><tr><th>Returns<tr><td><dl>A new iterator containing the
|
|
permutations of <code >iterable</code>.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l612">code »</a><code class="type"><VALUE></code> <span class="member"><a name="goog.iter.product">goog.iter.product</a> <span class="args">( var_args )</span> ⇒ <code class="type">!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a></code></span></div><p>Cartesian product of zero or more sets. Gives an iterator that gives every
|
|
combination of one element chosen from each set. For example,
|
|
([1, 2], [3, 4]) gives ([1, 3], [1, 4], [2, 3], [2, 4]).</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>var_args: <code class="type">...!<a href="namespace_goog_array.html#goog.array.ArrayLike">goog.array.ArrayLike</a>.<VALUE></code><dd>Zero or more sets, as
|
|
arrays.</dl><tr><th>Returns<tr><td><dl>An iterator that gives each
|
|
n-tuple (as an array).</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l257">code »</a><span class="member"><a name="goog.iter.range">goog.iter.range</a> <span class="args">( startOrStop, opt_stop, opt_step )</span> ⇒ <code class="type">!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>></code></span></div><p>Creates a new iterator that returns the values in a range. This function
|
|
can take 1, 2 or 3 arguments:
|
|
<pre>
|
|
range(5) same as range(0, 5, 1)
|
|
range(2, 5) same as range(2, 5, 1)
|
|
</pre></summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>startOrStop: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd>The stop value if only one argument is provided.
|
|
The start value if 2 or more arguments are provided. If only one
|
|
argument is used the start value is 0.<dt>opt_stop: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>=</code><dd>The stop value. If left out then the first
|
|
argument is used as the stop value.<dt>opt_step: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>=</code><dd>The number to increment with between each call to
|
|
next. This can be negative.</dl><tr><th>Returns<tr><td><dl>A new iterator that returns the values
|
|
in the range.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l341">code »</a><code class="type"><THIS, VALUE></code> <span class="member"><a name="goog.iter.reduce">goog.iter.reduce</a> <span class="args">( iterable, f, val, opt_obj )</span> ⇒ <code class="type">VALUE</code></span></div><p>Passes every element of an iterator into a function and accumulates the
|
|
result.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>iterable: <code class="type">(<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>|<a href="namespace_goog_iter.html#goog.iter.Iterable">goog.iter.Iterable</a>)</code><dd>The iterator
|
|
to iterate over.<dt>f: <code class="type">function(this: THIS, VALUE, VALUE): VALUE</code><dd>The function to call for
|
|
every element. This function takes 2 arguments (the function's previous
|
|
result or the initial value, and the value of the current element).
|
|
function(previousValue, currentElement) : newValue.<dt>val: <code class="type">VALUE</code><dd>The initial value to pass into the function on the first
|
|
call.<dt>opt_obj: <code class="type">THIS=</code><dd>The object to be used as the value of 'this' within
|
|
f.</dl><tr><th>Returns<tr><td><dl>Result of evaluating f repeatedly across the values of
|
|
the iterator.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l755">code »</a><code class="type"><VALUE></code> <span class="member"><a name="goog.iter.repeat">goog.iter.repeat</a> <span class="args">( value )</span> ⇒ <code class="type">!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE></code></span></div><p>Creates an iterator that returns the same object or value repeatedly.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>value: <code class="type">VALUE</code><dd>Any object or value to repeat.</dl><tr><th>Returns<tr><td><dl>A new iterator that returns the
|
|
repeated value.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l1170">code »</a><code class="type"><VALUE></code> <span class="member"><a name="goog.iter.slice">goog.iter.slice</a> <span class="args">( iterable, start, opt_end )</span> ⇒ <code class="type">!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE></code></span></div><p>Creates an iterator that returns a range of elements from an iterable.
|
|
Similar to goog.array#slice but does not support negative indexes.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>iterable: <code class="type">(!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>|!<a href="namespace_goog_iter.html#goog.iter.Iterable">goog.iter.Iterable</a>)</code><dd>The
|
|
iterable to slice.<dt>start: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code><dd>The index of the first element to return.<dt>opt_end: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>=</code><dd>The index after the last element to return. If
|
|
defined, must be greater than or equal to <code >start</code>.</dl><tr><th>Returns<tr><td><dl>A new iterator containing a slice of
|
|
the original.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l366">code »</a><code class="type"><THIS, VALUE></code> <span class="member"><a name="goog.iter.some">goog.iter.some</a> <span class="args">( iterable, f, opt_obj )</span> ⇒ <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Goes through the values in the iterator. Calls f for each of these, and if
|
|
any of them returns true, this returns true (without checking the rest). If
|
|
all return false this will return false.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>iterable: <code class="type">(<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>|<a href="namespace_goog_iter.html#goog.iter.Iterable">goog.iter.Iterable</a>)</code><dd>The iterator
|
|
object.<dt>f: <code class="type">function(this: THIS, VALUE, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined">undefined</a>, <a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code><dd>The function to call for every value. This function takes 3 arguments
|
|
(the value, undefined, and the iterator) and should return a boolean.<dt>opt_obj: <code class="type">THIS=</code><dd>The object to be used as the value of 'this' within
|
|
<code >f</code>.</dl><tr><th>Returns<tr><td><dl>true if any value passes the test.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l1026">code »</a><code class="type"><THIS, RESULT></code> <span class="member"><a name="goog.iter.starMap">goog.iter.starMap</a> <span class="args">( iterable, f, opt_obj )</span> ⇒ <code class="type">!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<RESULT></code></span></div><p>Gives an iterator that gives the result of calling the given function
|
|
<code>f</code> with the arguments taken from the next element from
|
|
<code>iterable</code> (the elements are expected to also be iterables).
|
|
|
|
Similar to goog.iter#map but allows the function to accept multiple
|
|
arguments from the iterable.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>iterable: <code class="type">!<a href="namespace_goog_iter.html#goog.iter.Iterable">goog.iter.Iterable</a></code><dd>The iterable of
|
|
iterables to iterate over.<dt>f: <code class="type">function(this: THIS, *): RESULT</code><dd>The function to call for every
|
|
element. This function takes N+2 arguments, where N represents the
|
|
number of items from the next element of the iterable. The two
|
|
additional arguments passed to the function are undefined and the
|
|
iterator itself. The function should return a new value.<dt>opt_obj: <code class="type">THIS=</code><dd>The object to be used as the value of 'this' within
|
|
<code >f</code>.</dl><tr><th>Returns<tr><td><dl>A new iterator that returns the
|
|
results of applying the function to each element in the original
|
|
iterator.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l516">code »</a><code class="type"><THIS, VALUE></code> <span class="member"><a name="goog.iter.takeWhile">goog.iter.takeWhile</a> <span class="args">( iterable, f, opt_obj )</span> ⇒ <code class="type">!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE></code></span></div><p>Builds a new iterator that iterates over the original, but only as long as a
|
|
supplied function returns true.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>iterable: <code class="type">(<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>|<a href="namespace_goog_iter.html#goog.iter.Iterable">goog.iter.Iterable</a>)</code><dd>The iterator
|
|
object.<dt>f: <code class="type">function(this: THIS, VALUE, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined">undefined</a>, <a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code><dd>The function to call for every value. This function takes 3 arguments
|
|
(the value, undefined, and the iterator) and should return a boolean.<dt>opt_obj: <code class="type">THIS=</code><dd>This is used as the 'this' object in f when called.</dl><tr><th>Returns<tr><td><dl>A new iterator that keeps elements in
|
|
the original iterator as long as the function is true.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l1049">code »</a><code class="type"><VALUE></code> <span class="member"><a name="goog.iter.tee">goog.iter.tee</a> <span class="args">( iterable, opt_num )</span> ⇒ <code class="type">!<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.<<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>></code></span></div><p>Returns an array of iterators each of which can iterate over the values in
|
|
<code >iterable</code> without advancing the others.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>iterable: <code class="type">(!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>|!<a href="namespace_goog_iter.html#goog.iter.Iterable">goog.iter.Iterable</a>)</code><dd>The
|
|
iterable to tee.<dt>opt_num: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>=</code><dd>The number of iterators to create. Default is 2.</dl><tr><th>Returns<tr><td><dl>An array of iterators.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l545">code »</a><code class="type"><VALUE></code> <span class="member"><a name="goog.iter.toArray">goog.iter.toArray</a> <span class="args">( iterable )</span> ⇒ <code class="type">!<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.<VALUE></code></span></div><p>Converts the iterator to an array</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>iterable: <code class="type">(<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>|<a href="namespace_goog_iter.html#goog.iter.Iterable">goog.iter.Iterable</a>)</code><dd>The iterator
|
|
to convert to an array.</dl><tr><th>Returns<tr><td><dl>An array of the elements the iterator iterates over.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l104">code »</a><code class="type"><VALUE></code> <span class="member"><a name="goog.iter.toIterator">goog.iter.toIterator</a> <span class="args">( iterable )</span> ⇒ <code class="type">!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE></code></span></div><p>Returns an iterator that knows how to iterate over the values in the object.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>iterable: <code class="type">(<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>|<a href="namespace_goog_iter.html#goog.iter.Iterable">goog.iter.Iterable</a>)</code><dd>If the
|
|
object is an iterator it will be returned as is. If the object has an
|
|
<code >__iterator__</code> method that will be called to get the value
|
|
iterator. If the object is an array-like object we create an iterator
|
|
for that.</dl><tr><th>Returns<tr><td><dl>An iterator that knows how to iterate
|
|
over the values in <code >iterable</code>.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l801">code »</a><code class="type"><VALUE></code> <span class="member"><a name="goog.iter.zip">goog.iter.zip</a> <span class="args">( var_args )</span> ⇒ <code class="type">!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a></code></span></div><p>Creates an iterator that returns arrays containing the ith elements from the
|
|
provided iterables. The returned arrays will be the same size as the number
|
|
of iterables given in <code >var_args</code>. Once the shortest iterable is
|
|
exhausted, subsequent calls to <code >next()</code> will throw
|
|
<code >goog.iter.StopIteration</code>.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>var_args: <code class="type">...(!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>|!<a href="namespace_goog_iter.html#goog.iter.Iterable">goog.iter.Iterable</a>)</code><dd>Any
|
|
number of iterable objects.</dl><tr><th>Returns<tr><td><dl>A new iterator that returns
|
|
arrays of elements from the provided iterables.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l833">code »</a><code class="type"><VALUE></code> <span class="member"><a name="goog.iter.zipLongest">goog.iter.zipLongest</a> <span class="args">( fillValue, var_args )</span> ⇒ <code class="type">!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a></code></span></div><p>Creates an iterator that returns arrays containing the ith elements from the
|
|
provided iterables. The returned arrays will be the same size as the number
|
|
of iterables given in <code >var_args</code>. Shorter iterables will be extended
|
|
with <code >fillValue</code>. Once the longest iterable is exhausted, subsequent
|
|
calls to <code >next()</code> will throw <code >goog.iter.StopIteration</code>.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>fillValue: <code class="type">VALUE</code><dd>The object or value used to fill shorter iterables.<dt>var_args: <code class="type">...(!<a href="class_goog_iter_Iterator.html">goog.iter.Iterator</a>.<VALUE>|!<a href="namespace_goog_iter.html#goog.iter.Iterable">goog.iter.Iterable</a>)</code><dd>Any
|
|
number of iterable objects.</dl><tr><th>Returns<tr><td><dl>A new iterator that returns
|
|
arrays of elements from the provided iterables.</dl></table></div></details></div></div></section><section id="static-properties"><h2>Global Properties</h2><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/iter/iter.js.src.html#l44">code »</a><span class="member"><a name="goog.iter.StopIteration">goog.iter.StopIteration</a> : <code class="type"><a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Error">Error</a></code></span></div><p>Singleton Error object that is used to terminate iterations.</summary></details></div></div></section></main><nav id="topnav"><div><div id="menubutton"><label for="sidenav-toggle">Menu</label></div><form id="searchbox"><div><input type="search" placeholder="Search" tabindex="1"></div></form></div></nav><nav id="sidenav"><input type="checkbox" id="sidenav-types-ctrl" /><input type="checkbox" id="sidenav-files-ctrl" /><input type="checkbox" id="sidenav-modules-ctrl" /><a id="sidenav-overview"><div><h4>Overview</h4></div></a><div id="sidenav-types"><label for="sidenav-types-ctrl"><h4>Types</h4></label><i>No data</i></div><div id="sidenav-modules"><label for="sidenav-modules-ctrl"><h4>Modules</h4></label><i>No data</i></div><div id="sidenav-files"><label for="sidenav-files-ctrl"><h4>Files</h4></label><i>No data</i></div><a href="license.html"><div><h4>License</h4></div></a></nav><div id="push-footer"></div></div><footer><a href="https://github.com/jleyba/js-dossier">Generated by dossier</a></footer><script src="types.js"></script><script src="dossier.js"></script> |