scala
object Iterator

[source: `scala/Iterator.scala`]

`` `object` Iterator
  `extends` AnyRef

  The `Iterator` object provides various functions for creating specialized iterators.

Author
  Martin Odersky
  Matthias Zenger
Version
  1.2, 10/02/2007

Value Summary
`val` | empty : Iterator[Nothing]

Method Summary
`def` | from (start : Int) : Iterator[Int] Create an iterator with elements `en+1 = en + 1` where `e0 = start`.
`def` | from (start : Int, step : (Int) => Int) : Iterator[Int] Create an iterator with elements `en+1 = step(en)` where `e0 = start`.
`def` | from (start : Int, step : Int) : Iterator[Int] Create an iterator with elements `en+1 = en + step` where `e0 = start`.
`def` | fromArray [a](xs : Array[a]) : Iterator[a]
`def` | fromArray [a](xs : Array[a], start : Int, length : Int) : Iterator[a]
`def` | fromCaseClass (n : Product) : Iterator[Any]
`def` | fromProduct (n : Product) : Iterator[Any]
`def` | fromString (str : String) : Iterator[Char]
`def` | fromValues [a](xs : a*) : Iterator[a]
`def` | range (start : Int, end : Int) : Range Create an iterator with elements `en+1 = en + 1` where `e0 = start` and `ei < end`.
`def` | range (start : Int, end : Int, step : (Int) => Int) : Iterator[Int] Create an iterator with elements `en+1 = step(en)` where `e0 = start` and `ei < end`.
`def` | range (start : Int, end : Int, step : Int) : Range Create an iterator with elements `en+1 = en + step` where `e0 = start` and `ei < end`.
`def` | single [a](x : a) : Iterator[a]

Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized

Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf

Value Details

`` `val` empty : Iterator[Nothing]

Method Details

`` `def` single[a](x : a) : Iterator[a]

Parameters
  `x -` the element
Returns
  the iterator with one single element

`` `def` fromValues[a](xs : a*) : Iterator[a]

`` `def` fromArray[a](xs : Array[a]) : Iterator[a]

Parameters
  `xs -` the array of elements
Returns
  the iterator on `xs`.

`` `def` fromArray[a](xs : Array[a], start : Int, length : Int) : Iterator[a]

Parameters
  `xs -` the array of elements
  `start -` ...
  `length -` ...
Returns
  ...

`` `def` fromString(str : String) : Iterator[Char]

Parameters
  `str -` the given string
Returns
  the iterator on `str`

`` `def` fromProduct(n : Product) : Iterator[Any]

Parameters
  `n -` the product arity
Returns
  the iterator on `Product<n>`.

@deprecated
`` `def` fromCaseClass(n : Product) : Iterator[Any]

Deprecated
  use `fromProduct` instead.

`` `def` range(start : Int, end : Int) : Range

  Create an iterator with elements `en+1 = en + 1` where `e0 = start` and `ei < end`.

Parameters
  `start -` the start value of the iterator
  `end -` the end value of the iterator
Returns
  the iterator with values in range `[start;end)`.

`` `def` range(start : Int, end : Int, step : Int) : Range

  Create an iterator with elements `en+1 = en + step` where `e0 = start` and `ei < end`.

Parameters
  `start -` the start value of the iterator
  `end -` the end value of the iterator
  `step -` the increment value of the iterator (must be positive or negative)
Returns
  the iterator with values in range `[start;end)`.

`` `def` range(start : Int, end : Int, step : (Int) => Int) : Iterator[Int]

  Create an iterator with elements `en+1 = step(en)` where `e0 = start` and `ei < end`.

Parameters
  `start -` the start value of the iterator
  `end -` the end value of the iterator
  `step -` the increment function of the iterator
Returns
  the iterator with values in range `[start;end)`.

`` `def` from(start : Int) : Iterator[Int]

  Create an iterator with elements `en+1 = en + 1` where `e0 = start`.

Parameters
  `start -` the start value of the iterator
Returns
  the iterator starting at value `start`.

`` `def` from(start : Int, step : Int) : Iterator[Int]

  Create an iterator with elements `en+1 = en + step` where `e0 = start`.

Parameters
  `start -` the start value of the iterator
  `step -` the increment value of the iterator
Returns
  the iterator starting at value `start`.

`` `def` from(start : Int, step : (Int) => Int) : Iterator[Int]

  Create an iterator with elements `en+1 = step(en)` where `e0 = start`.

Parameters
  `start -` the start value of the iterator
  `step -` the increment function of the iterator
Returns
  the iterator starting at value `start`.