|
Scala Library Documentation
|
|
scala/Range.scala]
class
Range(val start : Int, val end : Int, val step : Int)
extends BufferedIterator[Int]
The Range class represents integer values in range
[start;end) with non-zero step value step.
For example:
val r1 = Iterator.range(0, 10)
val r2 = Iterator.range(r1.start, r1.end, r1.step + 1)
println(r2.length) // = 5
| Method Summary | |
def
|
contains (x : Int) : Boolean |
def
|
hasNext
: Boolean
Does this iterator provide another element?
|
def
|
head
: Int
Checks what the next available element is.
|
def
|
length : Int |
def
|
next
: Int
Returns the next element.
|
| Methods inherited from BufferedIterator | |
| buffered |
| Methods inherited from Iterator | |
| take, drop, map, append, ++, flatMap, filter, takeWhile, dropWhile, zip, zipWithIndex, foreach, forall, exists, contains, find, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, counted, duplicate, copyToArray, copyToBuffer, toList, mkString, mkString, addString |
| Methods inherited from AnyRef | |
| getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
| Methods inherited from Any | |
| ==, !=, isInstanceOf, asInstanceOf |
| Method Details |
def
hasNext : Boolean
def
next : Int
def
head : Int
def
length : Int
|
Scala Library Documentation
|
|