@@ -20,42 +20,43 @@ import scala.collection.{AbstractIterator, AnyStepper, IterableFactoryDefaults,
20
20
import scala .util .hashing .MurmurHash3
21
21
22
22
/** The `Range` class represents integer values in range
23
- * ''[start;end)'' with non-zero step value `step`.
24
- * It's a special case of an indexed sequence.
25
- * For example:
26
- *
27
- * {{{
28
- * val r1 = 0 until 10
29
- * val r2 = r1.start until r1.end by r1.step + 1
30
- * println(r2.length) // = 5
31
- * }}}
32
- *
33
- * Ranges that contain more than `Int.MaxValue` elements can be created, but
34
- * these overfull ranges have only limited capabilities. Any method that
35
- * could require a collection of over `Int.MaxValue` length to be created, or
36
- * could be asked to index beyond `Int.MaxValue` elements will throw an
37
- * exception. Overfull ranges can safely be reduced in size by changing
38
- * the step size (e.g. `by 3`) or taking/dropping elements. `contains`,
39
- * `equals`, and access to the ends of the range (`head`, `last`, `tail`,
40
- * `init`) are also permitted on overfull ranges.
41
- *
42
- * @param start the start of this range.
43
- * @param end the end of the range. For exclusive ranges, e.g.
44
- * `Range(0,3)` or `(0 until 3)`, this is one
45
- * step past the last one in the range. For inclusive
46
- * ranges, e.g. `Range.inclusive(0,3)` or `(0 to 3)`,
47
- * it may be in the range if it is not skipped by the step size.
48
- * To find the last element inside a non-empty range,
49
- * use `last` instead.
50
- * @param step the step for the range.
51
- *
52
- * @define coll range
53
- * @define mayNotTerminateInf
54
- * @define willNotTerminateInf
55
- * @define doesNotUseBuilders
56
- * '''Note:''' this method does not use builders to construct a new range,
57
- * and its complexity is O(1).
58
- */
23
+ * ''[start;end)'' with non-zero step value `step`.
24
+ * It's a special case of an indexed sequence.
25
+ * For example:
26
+ *
27
+ * {{{
28
+ * val r1 = 0 until 10
29
+ * val r2 = r1.start until r1.end by r1.step + 1
30
+ * println(r2.length) // = 5
31
+ * }}}
32
+ *
33
+ * Ranges that contain more than `Int.MaxValue` elements can be created, but
34
+ * these overfull ranges have only limited capabilities. Any method that
35
+ * could require a collection of over `Int.MaxValue` length to be created, or
36
+ * could be asked to index beyond `Int.MaxValue` elements will throw an
37
+ * exception. Overfull ranges can safely be reduced in size by changing
38
+ * the step size (e.g. `by 3`) or taking/dropping elements. `contains`,
39
+ * `equals`, and access to the ends of the range (`head`, `last`, `tail`,
40
+ * `init`) are also permitted on overfull ranges.
41
+ *
42
+ * @param start the start of this range.
43
+ * @param end the end of the range. For exclusive ranges, e.g.
44
+ * `Range(0,3)` or `(0 until 3)`, this is one
45
+ * step past the last one in the range. For inclusive
46
+ * ranges, e.g. `Range.inclusive(0,3)` or `(0 to 3)`,
47
+ * it may be in the range if it is not skipped by the step size.
48
+ * To find the last element inside a non-empty range,
49
+ * use `last` instead.
50
+ * @param step the step for the range.
51
+ *
52
+ * @define coll range
53
+ * @define ccoll indexed sequence
54
+ * @define mayNotTerminateInf
55
+ * @define willNotTerminateInf
56
+ * @define doesNotUseBuilders
57
+ * '''Note:''' this method does not use builders to construct a new range,
58
+ * and its complexity is O(1).
59
+ */
59
60
@ SerialVersionUID (3L )
60
61
sealed abstract class Range (
61
62
val start : Int ,
@@ -522,11 +523,7 @@ sealed abstract class Range(
522
523
}
523
524
}
524
525
525
- /**
526
- * Companion object for ranges.
527
- * @define Coll `Range`
528
- * @define coll range
529
- */
526
+ /** Companion object for ranges. */
530
527
object Range {
531
528
532
529
/** Counts the number of range elements.
0 commit comments