Deprecate Double, Float and Comparable range implementations.

This commit is contained in:
Ilya Gorbunov
2015-10-13 20:38:15 +03:00
parent aeb4abe39d
commit 69dc6701cc
15 changed files with 279 additions and 94 deletions
@@ -139,6 +139,7 @@ class LongProgressionIterator(start: Long, end: Long, val increment: Long) : Lon
* An iterator over a progression of values of type `Float`.
* @property increment the number by which the value is incremented on each step.
*/
@Deprecated("This range implementation has unclear semantics and will be removed soon.", level = DeprecationLevel.ERROR)
class FloatProgressionIterator(start: Float, val end: Float, val increment: Float) : FloatIterator() {
private var next = start
@@ -155,6 +156,7 @@ class FloatProgressionIterator(start: Float, val end: Float, val increment: Floa
* An iterator over a progression of values of type `Double`.
* @property increment the number by which the value is incremented on each step.
*/
@Deprecated("This range implementation has unclear semantics and will be removed soon.", level = DeprecationLevel.ERROR)
class DoubleProgressionIterator(start: Double, val end: Double, val increment: Double) : DoubleIterator() {
private var next = start
+4
View File
@@ -153,6 +153,8 @@ public class LongProgression(
override fun toString(): String = if (increment > 0) "$start..$end step $increment" else "$start downTo $end step ${-increment}"
}
@Deprecated("This range implementation has unclear semantics and will be removed soon.", level = DeprecationLevel.ERROR)
@Suppress("DEPRECATION_ERROR")
/**
* A progression of values of type `Float`.
*/
@@ -181,6 +183,8 @@ public class FloatProgression(
override fun toString(): String = if (increment > 0) "$start..$end step $increment" else "$start downTo $end step ${-increment}"
}
@Deprecated("This range implementation has unclear semantics and will be removed soon.", level = DeprecationLevel.ERROR)
@Suppress("DEPRECATION_ERROR")
/**
* A progression of values of type `Double`.
*/
+4
View File
@@ -158,6 +158,8 @@ public class LongRange(override val start: Long, override val end: Long) : Range
}
}
@Deprecated("This range implementation has unclear semantics and will be removed soon.", level = DeprecationLevel.ERROR)
@Suppress("DEPRECATION_ERROR")
/**
* A range of values of type `Float`.
*/
@@ -186,6 +188,8 @@ public class FloatRange(override val start: Float, override val end: Float) : Ra
}
}
@Deprecated("This range implementation has unclear semantics and will be removed soon.", level = DeprecationLevel.ERROR)
@Suppress("DEPRECATION_ERROR")
/**
* A range of values of type `Double`.
*/