trait Iterator[+A] extends IterableOnce[A]

A core Iterator class

Self Type
Iterator[A]
Linear Supertypes
IterableOnce[A], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Iterator
  2. IterableOnce
  3. AnyRef
  4. Any
Implicitly
  1. by iterableOnceExtensionMethods
  2. by toOldIterator
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. class GroupedIterator[B >: A] extends Iterator[Seq[B]]

    A flexible iterator for transforming an Iterator[A] into an Iterator[Seq[A]], with configurable sequence size, step, and strategy for dealing with elements which don't fit evenly.

    A flexible iterator for transforming an Iterator[A] into an Iterator[Seq[A]], with configurable sequence size, step, and strategy for dealing with elements which don't fit evenly.

    Typical uses can be achieved via methods grouped and sliding.

Abstract Value Members

  1. abstract def hasNext: Boolean
  2. abstract def next(): A
    Annotations
    @throws( ... )

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def ++[B >: A](xs: ⇒ IterableOnce[B]): Iterator[B]
    Annotations
    @inline()
  4. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  5. def addString(b: StringBuilder, start: String, sep: String, end: String): StringBuilder

    Appends all elements of this iterator to a string builder using start, end, and separator strings.

    Appends all elements of this iterator to a string builder using start, end, and separator strings. The written text begins with the string start and ends with the string end. Inside, the string representations (w.r.t. the method toString) of all elements of this iterator are separated by the string sep.

    Example:

    scala> val a = List(1,2,3,4)
    a: List[Int] = List(1, 2, 3, 4)
    
    scala> val b = new StringBuilder()
    b: StringBuilder =
    
    scala> a.addString(b , "List(" , ", " , ")")
    res5: StringBuilder = List(1, 2, 3, 4)
    b

    the string builder to which elements are appended.

    start

    the starting string.

    sep

    the separator string.

    end

    the ending string.

    returns

    the string builder b to which elements were appended.

  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def buffered: BufferedIterator[A]

    Creates a buffered iterator from this iterator.

    Creates a buffered iterator from this iterator.

    returns

    a buffered iterator producing the same values as this iterator.

    Note

    Reuse: After calling this method, one should discard the iterator it was called on, and use only the iterator that was returned. Using the old iterator is undefined, subject to change, and may result in changes to the new iterator as well.

    See also

    scala.collection.BufferedIterator

  8. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  9. def collect[B](pf: PartialFunction[A, B]): Iterator[B]

    Creates an iterator by transforming values produced by this iterator with a partial function, dropping those values for which the partial function is not defined.

    Creates an iterator by transforming values produced by this iterator with a partial function, dropping those values for which the partial function is not defined.

    pf

    the partial function which filters and maps the iterator.

    returns

    a new iterator which yields each value x produced by this iterator for which pf is defined the image pf(x).

    Note

    Reuse: After calling this method, one should discard the iterator it was called on, and use only the iterator that was returned. Using the old iterator is undefined, subject to change, and may result in changes to the new iterator as well.

  10. def collectFirst[B](pf: PartialFunction[A, B]): Option[B]

    Finds the first element of the iterator for which the given partial function is defined, and applies the partial function to it.

    Finds the first element of the iterator for which the given partial function is defined, and applies the partial function to it.

    Note: may not terminate for infinite iterators.

    Note: might return different results for different runs, unless the underlying collection type is ordered.

    pf

    the partial function

    returns

    an option value containing pf applied to the first value for which it is defined, or None if none exists.

    Example:
    1. Seq("a", 1, 5L).iterator().collectFirst({ case x: Int => x*10 }) = Some(10)

  11. def concat[B >: A](xs: ⇒ IterableOnce[B]): Iterator[B]
  12. def contains(elem: Any): Boolean

    Tests whether this iterator contains a given value as an element.

    Tests whether this iterator contains a given value as an element.

    Note: may not terminate for infinite iterators.

    elem

    the element to test.

    returns

    true if this iterator produces some value that is is equal (as determined by ==) to elem, false otherwise.

    Note

    Reuse: After calling this method, one should discard the iterator it was called on. Using it is undefined and subject to change.

  13. def count(p: (A) ⇒ Boolean): Int

    Counts the number of elements in the iterator which satisfy a predicate.

    Counts the number of elements in the iterator which satisfy a predicate.

    p

    the predicate used to test elements.

    returns

    the number of elements satisfying the predicate p.

  14. def distinct: Iterator[A]

    Builds a new iterator from this one without any duplicated elements on it.

    Builds a new iterator from this one without any duplicated elements on it.

    returns

    iterator with distinct elements

    Note

    Reuse: After calling this method, one should discard the iterator it was called on. Using it is undefined and subject to change.

  15. def distinctBy[B](f: (A) ⇒ B): Iterator[A]

    Builds a new iterator from this one without any duplicated elements as determined by == after applying the transforming function f.

    Builds a new iterator from this one without any duplicated elements as determined by == after applying the transforming function f.

    B

    the type of the elements after being transformed by f

    f

    The transforming function whose result is used to determine the uniqueness of each element

    returns

    iterator with distinct elements

    Note

    Reuse: After calling this method, one should discard the iterator it was called on. Using it is undefined and subject to change.

  16. def drop(n: Int): Iterator[A]
  17. def dropWhile(p: (A) ⇒ Boolean): Iterator[A]

    Skips longest sequence of elements of this iterator which satisfy given predicate p, and returns an iterator of the remaining elements.

    Skips longest sequence of elements of this iterator which satisfy given predicate p, and returns an iterator of the remaining elements.

    p

    the predicate used to skip elements.

    returns

    an iterator consisting of the remaining elements

    Note

    Reuse: After calling this method, one should discard the iterator it was called on, and use only the iterator that was returned. Using the old iterator is undefined, subject to change, and may result in changes to the new iterator as well.

  18. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  20. def exists(p: (A) ⇒ Boolean): Boolean

    Tests whether a predicate holds for some of the values produced by this iterator.

    Tests whether a predicate holds for some of the values produced by this iterator.

    Note: may not terminate for infinite iterators.

    p

    the predicate used to test elements.

    returns

    true if the given predicate p holds for some of the values produced by this iterator, otherwise false.

    Note

    Reuse: After calling this method, one should discard the iterator it was called on. Using it is undefined and subject to change.

  21. def filter(p: (A) ⇒ Boolean): Iterator[A]

    Selects all elements of this iterator which satisfy a predicate.

    Selects all elements of this iterator which satisfy a predicate.

    p

    the predicate used to test elements.

    returns

    a new iterator consisting of all elements of this iterator that satisfy the given predicate p. The order of the elements is preserved.

  22. def filterNot(p: (A) ⇒ Boolean): Iterator[A]

    Creates an iterator over all the elements of this iterator which do not satisfy a predicate p.

    Creates an iterator over all the elements of this iterator which do not satisfy a predicate p.

    p

    the predicate used to test values.

    returns

    an iterator which produces those values of this iterator which do not satisfy the predicate p.

    Note

    Reuse: After calling this method, one should discard the iterator it was called on, and use only the iterator that was returned. Using the old iterator is undefined, subject to change, and may result in changes to the new iterator as well.

  23. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  24. def find(p: (A) ⇒ Boolean): Option[A]

    Finds the first value produced by the iterator satisfying a predicate, if any.

    Finds the first value produced by the iterator satisfying a predicate, if any.

    Note: may not terminate for infinite iterators.

    p

    the predicate used to test values.

    returns

    an option value containing the first value produced by the iterator that satisfies predicate p, or None if none exists.

    Note

    Reuse: After calling this method, one should discard the iterator it was called on. Using it is undefined and subject to change.

  25. def flatMap[B](f: (A) ⇒ IterableOnce[B]): Iterator[B]
  26. def flatten[B](implicit ev: (A) ⇒ IterableOnce[B]): Iterator[B]
  27. def foldLeft[B](z: B)(op: (B, A) ⇒ B): B
  28. def foldRight[B](z: B)(op: (A, B) ⇒ B): B
  29. def forall(p: (A) ⇒ Boolean): Boolean

    Tests whether a predicate holds for all values produced by this iterator.

    Tests whether a predicate holds for all values produced by this iterator.

    Note: may not terminate for infinite iterators.

    p

    the predicate used to test elements.

    returns

    true if the given predicate p holds for all values produced by this iterator, otherwise false.

    Note

    Reuse: After calling this method, one should discard the iterator it was called on. Using it is undefined and subject to change.

  30. def foreach[U](f: (A) ⇒ U): Unit
  31. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  32. def grouped[B >: A](size: Int): GroupedIterator[B]

    Returns an iterator which groups this iterator into fixed size blocks.

    Returns an iterator which groups this iterator into fixed size blocks. Example usages:

    // Returns List(List(1, 2, 3), List(4, 5, 6), List(7)))
    (1 to 7).iterator grouped 3 toList
    // Returns List(List(1, 2, 3), List(4, 5, 6))
    (1 to 7).iterator grouped 3 withPartial false toList
    // Returns List(List(1, 2, 3), List(4, 5, 6), List(7, 20, 25)
    // Illustrating that withPadding's argument is by-name.
    val it2 = Iterator.iterate(20)(_ + 5)
    (1 to 7).iterator grouped 3 withPadding it2.next toList
    Note

    Reuse: After calling this method, one should discard the iterator it was called on, and use only the iterator that was returned. Using the old iterator is undefined, subject to change, and may result in changes to the new iterator as well.

  33. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  34. def indexOf[B >: A](elem: B, from: Int): Int

    Returns the index of the first occurrence of the specified object in this iterable object after or at some start index.

    Returns the index of the first occurrence of the specified object in this iterable object after or at some start index.

    Note: may not terminate for infinite iterators.

    elem

    element to search for.

    from

    the start index

    returns

    the index >= from of the first occurrence of elem in the values produced by this iterator, or -1 if such an element does not exist until the end of the iterator is reached.

    Note

    Reuse: After calling this method, one should discard the iterator it was called on. Using it is undefined and subject to change.

  35. def indexOf[B >: A](elem: B): Int

    Returns the index of the first occurrence of the specified object in this iterable object.

    Returns the index of the first occurrence of the specified object in this iterable object.

    Note: may not terminate for infinite iterators.

    elem

    element to search for.

    returns

    the index of the first occurrence of elem in the values produced by this iterator, or -1 if such an element does not exist until the end of the iterator is reached.

    Note

    Reuse: After calling this method, one should discard the iterator it was called on. Using it is undefined and subject to change.

  36. def indexWhere(p: (A) ⇒ Boolean, from: Int = 0): Int
  37. def isEmpty: Boolean

    Tests whether this iterator is empty.

    Tests whether this iterator is empty.

    returns

    true if hasNext is false, false otherwise.

    Note

    Reuse: The iterator remains valid for further use whatever result is returned.

  38. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  39. val it: Iterator[A]
    Implicit
    This member is added by an implicit conversion from Iterator[A] to toOldIterator[A] performed by method toOldIterator in strawman.collection.
    Definition Classes
    toOldIterator
  40. def iterator(): Iterator[A]

    Iterator can be used only once

    Iterator can be used only once

    Definition Classes
    IteratorIterableOnce
  41. def knownSize: Int

    returns

    the remaining number of elements, if it can be computed in O(1) time, otherwise -1

    Definition Classes
    IteratorIterableOnce
  42. def length: Int
  43. def map[B](f: (A) ⇒ B): Iterator[B]
  44. def max: A

    [use case] Finds the largest element.

    [use case]

    Finds the largest element.

    returns

    the largest element of this iterator.

    Full Signature

    def max[B >: A](implicit ord: Ordering[B]): A

  45. def maxBy[B](f: (A) ⇒ B): A

    [use case] Finds the first element which yields the largest value measured by function f.

    [use case]

    Finds the first element which yields the largest value measured by function f.

    B

    The result type of the function f.

    f

    The measuring function.

    returns

    the first element of this iterator with the largest value measured by function f.

    Full Signature

    def maxBy[B](f: (A) ⇒ B)(implicit cmp: Ordering[B]): A

  46. def min: A

    [use case] Finds the smallest element.

    [use case]

    Finds the smallest element.

    returns

    the smallest element of this iterator

    Full Signature

    def min[B >: A](implicit ord: Ordering[B]): A

  47. def minBy[B](f: (A) ⇒ B): A

    [use case] Finds the first element which yields the smallest value measured by function f.

    [use case]

    Finds the first element which yields the smallest value measured by function f.

    B

    The result type of the function f.

    f

    The measuring function.

    returns

    the first element of this iterator with the smallest value measured by function f.

    Full Signature

    def minBy[B](f: (A) ⇒ B)(implicit cmp: Ordering[B]): A

  48. def mkString: String
  49. def mkString(sep: String): String
  50. def mkString(start: String, sep: String, end: String): String
  51. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  52. def nextOption(): Option[A]

    Wraps the value of next() in an option.

    Wraps the value of next() in an option.

    returns

    Some(next) if a next element exists, None otherwise.

  53. final def nonEmpty: Boolean

    Tests whether this iterator is not empty, same as hasNext.

    Tests whether this iterator is not empty, same as hasNext.

    returns

    true if hasNext is true, false otherwise.

    Annotations
    @inline()
    Note

    Reuse: The iterator remains valid for further use whatever result is returned.

  54. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  55. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  56. def patch[B >: A](from: Int, patchElems: Iterator[B], replaced: Int): Iterator[B]

    Returns this iterator with patched values.

    Returns this iterator with patched values. Patching at negative indices is the same as patching starting at 0. Patching at indices at or larger than the length of the original iterator appends the patch to the end. If more values are replaced than actually exist, the excess is ignored.

    from

    The start index from which to patch

    patchElems

    The iterator of patch values

    replaced

    The number of values in the original iterator that are replaced by the patch.

    Note

    Reuse: After calling this method, one should discard the iterator it was called on, as well as the one passed as a parameter, and use only the iterator that was returned. Using the old iterators is undefined, subject to change, and may result in changes to the new iterator as well.

  57. def product: A

    [use case] Multiplies up the elements of this collection.

    [use case]

    Multiplies up the elements of this collection.

    returns

    the product of all elements in this iterator of numbers of type Int. Instead of Int, any other type T with an implicit Numeric[T] implementation can be used as element type of the iterator and as result type of product. Examples of such types are: Long, Float, Double, BigInt.

    Full Signature

    def product[B >: A](implicit num: Numeric[B]): B

  58. def reduce[B >: A](op: (B, B) ⇒ B): B

    Reduces the elements of this iterator using the specified associative binary operator.

    Reduces the elements of this iterator using the specified associative binary operator.

    The order in which operations are performed on elements is unspecified and may be nondeterministic.

    B

    A type parameter for the binary operator, a supertype of A.

    op

    A binary operator that must be associative.

    returns

    The result of applying reduce operator op between all the elements if the iterator is nonempty.

    Exceptions thrown

    UnsupportedOperationException if this iterator is empty.

  59. def reduceLeft[B >: A](op: (B, A) ⇒ B): B

    Applies a binary operator to all elements of this iterator, going left to right.

    Applies a binary operator to all elements of this iterator, going left to right.

    Note: will not terminate for infinite iterators.

    Note: might return different results for different runs, unless the underlying collection type is ordered or the operator is associative and commutative.

    B

    the result type of the binary operator.

    op

    the binary operator.

    returns

    the result of inserting op between consecutive elements of this iterator, going left to right:

    op( op( ... op(x_1, x_2) ..., x_{n-1}), x_n)

    where x1, ..., xn are the elements of this iterator.

    Exceptions thrown

    UnsupportedOperationException if this iterator is empty.

  60. def reduceLeftOption[B >: A](op: (B, A) ⇒ B): Option[B]

    Optionally applies a binary operator to all elements of this iterator, going left to right.

    Optionally applies a binary operator to all elements of this iterator, going left to right.

    Note: will not terminate for infinite iterators.

    Note: might return different results for different runs, unless the underlying collection type is ordered or the operator is associative and commutative.

    B

    the result type of the binary operator.

    op

    the binary operator.

    returns

    an option value containing the result of reduceLeft(op) if this iterator is nonempty, None otherwise.

  61. def reduceOption[B >: A](op: (B, B) ⇒ B): Option[B]

    Reduces the elements of this iterator, if any, using the specified associative binary operator.

    Reduces the elements of this iterator, if any, using the specified associative binary operator.

    The order in which operations are performed on elements is unspecified and may be nondeterministic.

    B

    A type parameter for the binary operator, a supertype of A.

    op

    A binary operator that must be associative.

    returns

    An option value containing result of applying reduce operator op between all the elements if the collection is nonempty, and None otherwise.

  62. def reduceRight[B >: A](op: (A, B) ⇒ B): B

    Applies a binary operator to all elements of this iterator, going right to left.

    Applies a binary operator to all elements of this iterator, going right to left.

    Note: will not terminate for infinite iterators.

    Note: might return different results for different runs, unless the underlying collection type is ordered or the operator is associative and commutative.

    B

    the result type of the binary operator.

    op

    the binary operator.

    returns

    the result of inserting op between consecutive elements of this iterator, going right to left:

    op(x_1, op(x_2, ..., op(x_{n-1}, x_n)...))

    where x1, ..., xn are the elements of this iterator.

    Exceptions thrown

    UnsupportedOperationException if this iterator is empty.

  63. def reduceRightOption[B >: A](op: (A, B) ⇒ B): Option[B]

    Optionally applies a binary operator to all elements of this iterator, going right to left.

    Optionally applies a binary operator to all elements of this iterator, going right to left.

    Note: will not terminate for infinite iterators.

    Note: might return different results for different runs, unless the underlying collection type is ordered or the operator is associative and commutative.

    B

    the result type of the binary operator.

    op

    the binary operator.

    returns

    an option value containing the result of reduceRight(op) if this iterator is nonempty, None otherwise.

  64. def reversed: Iterable[A]
    Attributes
    protected[this]
  65. def sameElements[B >: A](that: IterableOnce[B]): Boolean
  66. def scanLeft[B](z: B)(op: (B, A) ⇒ B): Iterator[B]

    Produces a collection containing cumulative results of applying the operator going left to right.

    Produces a collection containing cumulative results of applying the operator going left to right.

    Note: will not terminate for infinite iterators.

    Note: might return different results for different runs, unless the underlying collection type is ordered.

    B

    the type of the elements in the resulting collection

    z

    the initial value

    op

    the binary operator applied to the intermediate result and the element

    returns

    iterator with intermediate results

    Note

    Reuse: After calling this method, one should discard the iterator it was called on, and use only the iterator that was returned. Using the old iterator is undefined, subject to change, and may result in changes to the new iterator as well.

  67. final def size: Int
  68. def slice(from: Int, until: Int): Iterator[A]

    Creates an iterator returning an interval of the values produced by this iterator.

    Creates an iterator returning an interval of the values produced by this iterator.

    from

    the index of the first element in this iterator which forms part of the slice. If negative, the slice starts at zero.

    until

    the index of the first element following the slice. If negative, the slice is empty.

    returns

    an iterator which advances this iterator past the first from elements using drop, and then takes until - from elements, using take.

    Note

    Reuse: After calling this method, one should discard the iterator it was called on, and use only the iterator that was returned. Using the old iterator is undefined, subject to change, and may result in changes to the new iterator as well.

  69. def sliceIterator(from: Int, until: Int): Iterator[A]

    Creates an optionally bounded slice, unbounded if until is negative.

    Creates an optionally bounded slice, unbounded if until is negative.

    Attributes
    protected
  70. def sliding[B >: A](size: Int, step: Int = 1): GroupedIterator[B]

    Returns an iterator which presents a "sliding window" view of this iterator.

    Returns an iterator which presents a "sliding window" view of this iterator. The first argument is the window size, and the second argument step is how far to advance the window on each iteration. The step defaults to 1.

    The default GroupedIterator can be configured to either pad a partial result to size size or suppress the partial result entirely.

    Example usages:

    // Returns List(List(1, 2, 3), List(2, 3, 4), List(3, 4, 5))
    (1 to 5).iterator.sliding(3).toList
    // Returns List(List(1, 2, 3, 4), List(4, 5))
    (1 to 5).iterator.sliding(4, 3).toList
    // Returns List(List(1, 2, 3, 4))
    (1 to 5).iterator.sliding(4, 3).withPartial(false).toList
    // Returns List(List(1, 2, 3, 4), List(4, 5, 20, 25))
    // Illustrating that withPadding's argument is by-name.
    val it2 = Iterator.iterate(20)(_ + 5)
    (1 to 5).iterator.sliding(4, 3).withPadding(it2.next).toList
    returns

    An iterator producing Seq[B]s of size size, except the last element (which may be the only element) will be truncated if there are fewer than size elements remaining to be grouped. This behavior can be configured.

    Note

    Reuse: After calling this method, one should discard the iterator it was called on, and use only the iterator that was returned. Using the old iterator is undefined, subject to change, and may result in changes to the new iterator as well.

  71. def sum: A

    [use case] Sums up the elements of this collection.

    [use case]

    Sums up the elements of this collection.

    returns

    the sum of all elements in this iterator of numbers of type Int. Instead of Int, any other type T with an implicit Numeric[T] implementation can be used as element type of the iterator and as result type of sum. Examples of such types are: Long, Float, Double, BigInt.

    Full Signature

    def sum[B >: A](implicit num: Numeric[B]): B

  72. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  73. def take(n: Int): Iterator[A]
  74. def takeWhile(p: (A) ⇒ Boolean): Iterator[A]

    Takes longest prefix of values produced by this iterator that satisfy a predicate.

    Takes longest prefix of values produced by this iterator that satisfy a predicate.

    p

    The predicate used to test elements.

    returns

    An iterator returning the values produced by this iterator, until this iterator produces a value that does not satisfy the predicate p.

    Note

    Reuse: After calling this method, one should discard the iterator it was called on, and use only the iterator that was returned. Using the old iterator is undefined, subject to change, and may result in changes to the new iterator as well.

  75. def to[C](factory: Factory[A, C]): C

    Converts this Iterator into another collection.

    Converts this Iterator into another collection.

    C

    The collection type to build.

    factory

    Collection factory to use. The factory may or may not eagerly consume this iterator.

    returns

    a new collection containing all elements of this Iterator.

  76. def toClassic: scala.Iterator[A]
    Implicit
    This member is added by an implicit conversion from Iterator[A] to toOldIterator[A] performed by method toOldIterator in strawman.collection.
    Definition Classes
    toOldIterator
  77. def toString(): String
    Definition Classes
    AnyRef → Any
  78. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  79. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  80. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  81. def withFilter(p: (A) ⇒ Boolean): Iterator[A]

    Creates an iterator over all the elements of this iterator that satisfy the predicate p.

    Creates an iterator over all the elements of this iterator that satisfy the predicate p. The order of the elements is preserved.

    Note: withFilter is the same as filter on iterators. It exists so that for-expressions with filters work over iterators.

    p

    the predicate used to test values.

    returns

    an iterator which produces those values of this iterator which satisfy the predicate p.

    Note

    Reuse: After calling this method, one should discard the iterator it was called on, and use only the iterator that was returned. Using the old iterator is undefined, subject to change, and may result in changes to the new iterator as well.

  82. def zip[B](that: IterableOnce[B]): Iterator[(A, B)]
  83. def zipAll[A1 >: A, B](that: IterableOnce[B], thisElem: A1, thatElem: B): Iterator[(A1, B)]
  84. def zipWithIndex: Iterator[(A, Int)]

    Creates an iterator that pairs each element produced by this iterator with its index, counting from 0.

    Creates an iterator that pairs each element produced by this iterator with its index, counting from 0.

    returns

    a new iterator containing pairs consisting of corresponding elements of this iterator and their indices.

    Note

    Reuse: After calling this method, one should discard the iterator it was called on, and use only the iterator that was returned. Using the old iterator is undefined, subject to change, and may result in changes to the new iterator as well.

Deprecated Value Members

  1. def /:[B](z: B)(op: (B, A) ⇒ B): B
    Implicit
    This member is added by an implicit conversion from Iterator[A] to IterableOnceExtensionMethods[A] performed by method iterableOnceExtensionMethods in strawman.collection.IterableOnce.
    Definition Classes
    IterableOnceExtensionMethods
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.13.0) Use .iterator().foldLeft instead of /: on IterableOnce

  2. def :\[B](z: B)(op: (A, B) ⇒ B): B
    Implicit
    This member is added by an implicit conversion from Iterator[A] to IterableOnceExtensionMethods[A] performed by method iterableOnceExtensionMethods in strawman.collection.IterableOnce.
    Definition Classes
    IterableOnceExtensionMethods
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.13.0) Use .iterator().foldRight instead of :\ on IterableOnce

  3. def find(p: (A) ⇒ Boolean): Option[A]
    Implicit
    This member is added by an implicit conversion from Iterator[A] to IterableOnceExtensionMethods[A] performed by method iterableOnceExtensionMethods in strawman.collection.IterableOnce.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (iterator: IterableOnceExtensionMethods[A]).find(p)
    Definition Classes
    IterableOnceExtensionMethods
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use .iterator().find instead of .find on IterableOnce

  4. def flatMap[B](f: (A) ⇒ IterableOnce[B]): IterableOnce[B]
    Implicit
    This member is added by an implicit conversion from Iterator[A] to IterableOnceExtensionMethods[A] performed by method iterableOnceExtensionMethods in strawman.collection.IterableOnce.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (iterator: IterableOnceExtensionMethods[A]).flatMap(f)
    Definition Classes
    IterableOnceExtensionMethods
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use .iterator().flatMap instead of .flatMap on IterableOnce or consider requiring an Iterable

  5. def foldLeft[B](z: B)(op: (B, A) ⇒ B): B
    Implicit
    This member is added by an implicit conversion from Iterator[A] to IterableOnceExtensionMethods[A] performed by method iterableOnceExtensionMethods in strawman.collection.IterableOnce.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (iterator: IterableOnceExtensionMethods[A]).foldLeft(z)(op)
    Definition Classes
    IterableOnceExtensionMethods
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.13.0) Use .iterator().foldLeft instead of .foldLeft on IterableOnce

  6. def foldRight[B](z: B)(op: (A, B) ⇒ B): B
    Implicit
    This member is added by an implicit conversion from Iterator[A] to IterableOnceExtensionMethods[A] performed by method iterableOnceExtensionMethods in strawman.collection.IterableOnce.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (iterator: IterableOnceExtensionMethods[A]).foldRight(z)(op)
    Definition Classes
    IterableOnceExtensionMethods
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.13.0) Use .iterator().foldRight instead of .foldLeft on IterableOnce

  7. def foreach[U](f: (A) ⇒ U): Unit
    Implicit
    This member is added by an implicit conversion from Iterator[A] to IterableOnceExtensionMethods[A] performed by method iterableOnceExtensionMethods in strawman.collection.IterableOnce.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (iterator: IterableOnceExtensionMethods[A]).foreach(f)
    Definition Classes
    IterableOnceExtensionMethods
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.13.0) Use .iterator().foreach(...) instead of .foreach(...) on IterableOnce

  8. def isEmpty: Boolean
    Implicit
    This member is added by an implicit conversion from Iterator[A] to IterableOnceExtensionMethods[A] performed by method iterableOnceExtensionMethods in strawman.collection.IterableOnce.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (iterator: IterableOnceExtensionMethods[A]).isEmpty
    Definition Classes
    IterableOnceExtensionMethods
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use .iterator().isEmpty instead of .isEmpty on IterableOnce

  9. def map[B](f: (A) ⇒ B): IterableOnce[B]
    Implicit
    This member is added by an implicit conversion from Iterator[A] to IterableOnceExtensionMethods[A] performed by method iterableOnceExtensionMethods in strawman.collection.IterableOnce.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (iterator: IterableOnceExtensionMethods[A]).map(f)
    Definition Classes
    IterableOnceExtensionMethods
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use .iterator().map instead of .map on IterableOnce or consider requiring an Iterable

  10. def mkString: String
    Implicit
    This member is added by an implicit conversion from Iterator[A] to IterableOnceExtensionMethods[A] performed by method iterableOnceExtensionMethods in strawman.collection.IterableOnce.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (iterator: IterableOnceExtensionMethods[A]).mkString
    Definition Classes
    IterableOnceExtensionMethods
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use .iterator().mkString instead of .mkString on IterableOnce

  11. def mkString(sep: String): String
    Implicit
    This member is added by an implicit conversion from Iterator[A] to IterableOnceExtensionMethods[A] performed by method iterableOnceExtensionMethods in strawman.collection.IterableOnce.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (iterator: IterableOnceExtensionMethods[A]).mkString(sep)
    Definition Classes
    IterableOnceExtensionMethods
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use .iterator().mkString instead of .mkString on IterableOnce

  12. def mkString(start: String, sep: String, end: String): String
    Implicit
    This member is added by an implicit conversion from Iterator[A] to IterableOnceExtensionMethods[A] performed by method iterableOnceExtensionMethods in strawman.collection.IterableOnce.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (iterator: IterableOnceExtensionMethods[A]).mkString(start, sep, end)
    Definition Classes
    IterableOnceExtensionMethods
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use .iterator().mkString instead of .mkString on IterableOnce

  13. def toArray[B >: A](implicit arg0: ClassTag[B]): Array[B]
    Implicit
    This member is added by an implicit conversion from Iterator[A] to IterableOnceExtensionMethods[A] performed by method iterableOnceExtensionMethods in strawman.collection.IterableOnce.
    Definition Classes
    IterableOnceExtensionMethods
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use ArrayBuffer.from(it).toArray

  14. def toBuffer[B >: A]: Buffer[B]
    Implicit
    This member is added by an implicit conversion from Iterator[A] to IterableOnceExtensionMethods[A] performed by method iterableOnceExtensionMethods in strawman.collection.IterableOnce.
    Definition Classes
    IterableOnceExtensionMethods
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use ArrayBuffer.from(it) instead of it.toBuffer

  15. def toIterator: Iterator[A]
    Implicit
    This member is added by an implicit conversion from Iterator[A] to IterableOnceExtensionMethods[A] performed by method iterableOnceExtensionMethods in strawman.collection.IterableOnce.
    Definition Classes
    IterableOnceExtensionMethods
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.13.0) toIterator has been renamed to iterator()

  16. def toList: List[A]
    Implicit
    This member is added by an implicit conversion from Iterator[A] to IterableOnceExtensionMethods[A] performed by method iterableOnceExtensionMethods in strawman.collection.IterableOnce.
    Definition Classes
    IterableOnceExtensionMethods
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use List.from(it) instead of it.toList

  17. def toMap[K, V](implicit ev: <:<[A, (K, V)]): immutable.Map[K, V]
    Implicit
    This member is added by an implicit conversion from Iterator[A] to IterableOnceExtensionMethods[A] performed by method iterableOnceExtensionMethods in strawman.collection.IterableOnce.
    Definition Classes
    IterableOnceExtensionMethods
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use Map.from(it) instead of it.toVector on IterableOnce

  18. def toSeq: immutable.Seq[A]
    Implicit
    This member is added by an implicit conversion from Iterator[A] to IterableOnceExtensionMethods[A] performed by method iterableOnceExtensionMethods in strawman.collection.IterableOnce.
    Definition Classes
    IterableOnceExtensionMethods
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.13.0) Use Seq.from(it) instead of it.toSeq

  19. def toSet[B >: A]: immutable.Set[B]
    Implicit
    This member is added by an implicit conversion from Iterator[A] to IterableOnceExtensionMethods[A] performed by method iterableOnceExtensionMethods in strawman.collection.IterableOnce.
    Definition Classes
    IterableOnceExtensionMethods
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.13.0) Use Set.from(it) instead of it.toSet

  20. def toStream: LazyList[A]
    Implicit
    This member is added by an implicit conversion from Iterator[A] to IterableOnceExtensionMethods[A] performed by method iterableOnceExtensionMethods in strawman.collection.IterableOnce.
    Definition Classes
    IterableOnceExtensionMethods
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.13.0) Use LazyList.from(it) instead of it.toStream

  21. def toVector: Vector[A]
    Implicit
    This member is added by an implicit conversion from Iterator[A] to IterableOnceExtensionMethods[A] performed by method iterableOnceExtensionMethods in strawman.collection.IterableOnce.
    Definition Classes
    IterableOnceExtensionMethods
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.13.0) Use Vector.from(it) instead of it.toVector on IterableOnce

Inherited from IterableOnce[A]

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion iterableOnceExtensionMethods from Iterator[A] to IterableOnceExtensionMethods[A]

Inherited by implicit conversion toOldIterator from Iterator[A] to toOldIterator[A]

Ungrouped