Renamed NumberSequence to Progression.
This commit is contained in:
@@ -157,19 +157,19 @@ public class IntrinsicMethods {
|
||||
}
|
||||
|
||||
for (PrimitiveType type : PrimitiveType.NUMBER_TYPES) {
|
||||
registerRangeOrSequenceProperty(type.getRangeClassName(), Name.identifier("start"));
|
||||
registerRangeOrSequenceProperty(type.getRangeClassName(), Name.identifier("end"));
|
||||
registerRangeOrProgressionProperty(type.getRangeClassName(), Name.identifier("start"));
|
||||
registerRangeOrProgressionProperty(type.getRangeClassName(), Name.identifier("end"));
|
||||
|
||||
registerRangeOrSequenceProperty(type.getSequenceClassName(), Name.identifier("start"));
|
||||
registerRangeOrSequenceProperty(type.getSequenceClassName(), Name.identifier("end"));
|
||||
registerRangeOrSequenceProperty(type.getSequenceClassName(), Name.identifier("increment"));
|
||||
registerRangeOrProgressionProperty(type.getProgressionClassName(), Name.identifier("start"));
|
||||
registerRangeOrProgressionProperty(type.getProgressionClassName(), Name.identifier("end"));
|
||||
registerRangeOrProgressionProperty(type.getProgressionClassName(), Name.identifier("increment"));
|
||||
}
|
||||
|
||||
declareArrayMethods();
|
||||
}
|
||||
|
||||
private void registerRangeOrSequenceProperty(@NotNull FqName ownerClass, @NotNull Name propertyName) {
|
||||
intrinsicsMap.registerIntrinsic(ownerClass, propertyName, -1, new PropertyOfSequenceOrRange(ownerClass, propertyName));
|
||||
private void registerRangeOrProgressionProperty(@NotNull FqName ownerClass, @NotNull Name propertyName) {
|
||||
intrinsicsMap.registerIntrinsic(ownerClass, propertyName, -1, new PropertyOfProgressionOrRange(ownerClass, propertyName));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
+2
-2
@@ -33,11 +33,11 @@ import org.jetbrains.jet.lang.resolve.name.Name;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class PropertyOfSequenceOrRange implements IntrinsicMethod {
|
||||
public class PropertyOfProgressionOrRange implements IntrinsicMethod {
|
||||
private final FqName ownerClass;
|
||||
private final Name propertyName;
|
||||
|
||||
public PropertyOfSequenceOrRange(@NotNull FqName ownerClass, @NotNull Name propertyName) {
|
||||
public PropertyOfProgressionOrRange(@NotNull FqName ownerClass, @NotNull Name propertyName) {
|
||||
this.ownerClass = ownerClass;
|
||||
this.propertyName = propertyName;
|
||||
}
|
||||
@@ -9,7 +9,7 @@ public trait Range<in T: Comparable<T>> {
|
||||
public class IntRange(
|
||||
public override val start: Int,
|
||||
public override val end : Int
|
||||
) : Range<Int>, NumberSequence<Int> {
|
||||
) : Range<Int>, Progression<Int> {
|
||||
|
||||
public override fun iterator() : IntIterator
|
||||
|
||||
@@ -25,7 +25,7 @@ public class IntRange(
|
||||
public class LongRange(
|
||||
public override val start: Long,
|
||||
public override val end: Long
|
||||
) : Range<Long>, NumberSequence<Long> {
|
||||
) : Range<Long>, Progression<Long> {
|
||||
|
||||
public override fun iterator(): LongIterator
|
||||
|
||||
@@ -41,7 +41,7 @@ public class LongRange(
|
||||
public class ByteRange(
|
||||
public override val start: Byte,
|
||||
public override val end : Byte
|
||||
): Range<Byte>, NumberSequence<Byte> {
|
||||
): Range<Byte>, Progression<Byte> {
|
||||
|
||||
public override fun iterator(): ByteIterator
|
||||
|
||||
@@ -57,7 +57,7 @@ public class ByteRange(
|
||||
public class ShortRange(
|
||||
public override val start: Short,
|
||||
public override val end: Short
|
||||
) : Range<Short>, NumberSequence<Short> {
|
||||
) : Range<Short>, Progression<Short> {
|
||||
|
||||
public override fun iterator(): ShortIterator
|
||||
|
||||
@@ -73,7 +73,7 @@ public class ShortRange(
|
||||
public class CharRange(
|
||||
public override val start: Char,
|
||||
public override val end: Char
|
||||
) : Range<Char>, NumberSequence<Char> {
|
||||
) : Range<Char>, Progression<Char> {
|
||||
|
||||
public override fun iterator(): CharIterator
|
||||
|
||||
@@ -89,7 +89,7 @@ public class CharRange(
|
||||
public class FloatRange(
|
||||
public override val start: Float,
|
||||
public override val end: Float
|
||||
) : Range<Float>, NumberSequence<Float> {
|
||||
) : Range<Float>, Progression<Float> {
|
||||
|
||||
public override fun iterator(): FloatIterator
|
||||
|
||||
@@ -105,7 +105,7 @@ public class FloatRange(
|
||||
public class DoubleRange(
|
||||
public override val start: Double,
|
||||
public override val end: Double
|
||||
) : Range<Double>, NumberSequence<Double> {
|
||||
) : Range<Double>, Progression<Double> {
|
||||
|
||||
public override fun iterator() : DoubleIterator
|
||||
|
||||
@@ -119,71 +119,71 @@ public class DoubleRange(
|
||||
}
|
||||
|
||||
|
||||
public trait NumberSequence<N: Any>: Iterable<N> {
|
||||
public trait Progression<N: Any>: Iterable<N> {
|
||||
public val start: N
|
||||
public val end: N
|
||||
public val increment: Number
|
||||
}
|
||||
|
||||
public class IntSequence(
|
||||
public class IntProgression(
|
||||
public override val start: Int,
|
||||
public override val end: Int,
|
||||
public override val increment: Int
|
||||
): NumberSequence<Int> {
|
||||
): Progression<Int> {
|
||||
|
||||
override fun iterator(): IntIterator
|
||||
}
|
||||
|
||||
public class LongSequence(
|
||||
public class LongProgression(
|
||||
public override val start: Long,
|
||||
public override val end: Long,
|
||||
public override val increment: Long
|
||||
): NumberSequence<Long> {
|
||||
): Progression<Long> {
|
||||
|
||||
override fun iterator(): LongIterator
|
||||
}
|
||||
|
||||
public class ByteSequence(
|
||||
public class ByteProgression(
|
||||
public override val start: Byte,
|
||||
public override val end: Byte,
|
||||
public override val increment: Int
|
||||
): NumberSequence<Byte> {
|
||||
): Progression<Byte> {
|
||||
|
||||
override fun iterator(): ByteIterator
|
||||
}
|
||||
|
||||
public class ShortSequence(
|
||||
public class ShortProgression(
|
||||
public override val start: Short,
|
||||
public override val end: Short,
|
||||
public override val increment: Int
|
||||
): NumberSequence<Short> {
|
||||
): Progression<Short> {
|
||||
|
||||
override fun iterator(): ShortIterator
|
||||
}
|
||||
|
||||
public class CharacterSequence(
|
||||
public class CharProgression(
|
||||
public override val start: Char,
|
||||
public override val end: Char,
|
||||
public override val increment: Int
|
||||
): NumberSequence<Char> {
|
||||
): Progression<Char> {
|
||||
|
||||
override fun iterator(): CharIterator
|
||||
}
|
||||
|
||||
public class FloatSequence(
|
||||
public class FloatProgression(
|
||||
public override val start: Float,
|
||||
public override val end: Float,
|
||||
public override val increment: Float
|
||||
): NumberSequence<Float> {
|
||||
): Progression<Float> {
|
||||
|
||||
override fun iterator(): FloatIterator
|
||||
}
|
||||
|
||||
public class DoubleSequence(
|
||||
public class DoubleProgression(
|
||||
public override val start: Double,
|
||||
public override val end: Double,
|
||||
public override val increment: Double
|
||||
): NumberSequence<Double> {
|
||||
): Progression<Double> {
|
||||
|
||||
override fun iterator(): DoubleIterator
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public enum PrimitiveType {
|
||||
private final FqName className;
|
||||
private final FqName arrayClassName;
|
||||
private final FqName rangeClassName;
|
||||
private final FqName sequenceClassName;
|
||||
private final FqName progressionClassName;
|
||||
|
||||
private PrimitiveType(String typeName) {
|
||||
this.typeName = Name.identifier(typeName);
|
||||
@@ -51,8 +51,7 @@ public enum PrimitiveType {
|
||||
this.className = builtInsPackageFqName.child(this.typeName);
|
||||
this.arrayClassName = builtInsPackageFqName.child(this.arrayTypeName);
|
||||
this.rangeClassName = builtInsPackageFqName.child(this.rangeTypeName);
|
||||
this.sequenceClassName = builtInsPackageFqName.child(
|
||||
Name.identifier((typeName == "Char") ? "CharacterSequence" : typeName + "Sequence"));
|
||||
this.progressionClassName = builtInsPackageFqName.child(Name.identifier(typeName + "Progression"));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -86,7 +85,7 @@ public enum PrimitiveType {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public FqName getSequenceClassName() {
|
||||
return sequenceClassName;
|
||||
public FqName getProgressionClassName() {
|
||||
return progressionClassName;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,7 +131,15 @@ public abstract class ByteIterator : jet.Iterator<jet.Byte> {
|
||||
public abstract fun nextByte() : jet.Byte
|
||||
}
|
||||
|
||||
public final class ByteRange : jet.Range<jet.Byte>, jet.NumberSequence<jet.Byte> {
|
||||
public final class ByteProgression : jet.Progression<jet.Byte> {
|
||||
public constructor ByteProgression(/*0*/ start : jet.Byte, /*1*/ end : jet.Byte, /*2*/ increment : jet.Int)
|
||||
public open override /*1*/ val end : jet.Byte
|
||||
public open override /*1*/ val increment : jet.Int
|
||||
public open override /*1*/ val start : jet.Byte
|
||||
public open override /*1*/ fun iterator() : jet.ByteIterator
|
||||
}
|
||||
|
||||
public final class ByteRange : jet.Range<jet.Byte>, jet.Progression<jet.Byte> {
|
||||
public constructor ByteRange(/*0*/ start : jet.Byte, /*1*/ end : jet.Byte)
|
||||
public open override /*2*/ val end : jet.Byte
|
||||
public open override /*1*/ val increment : jet.Int
|
||||
@@ -145,14 +153,6 @@ public final class ByteRange : jet.Range<jet.Byte>, jet.NumberSequence<jet.Byte>
|
||||
}
|
||||
}
|
||||
|
||||
public final class ByteSequence : jet.NumberSequence<jet.Byte> {
|
||||
public constructor ByteSequence(/*0*/ start : jet.Byte, /*1*/ end : jet.Byte, /*2*/ increment : jet.Int)
|
||||
public open override /*1*/ val end : jet.Byte
|
||||
public open override /*1*/ val increment : jet.Int
|
||||
public open override /*1*/ val start : jet.Byte
|
||||
public open override /*1*/ fun iterator() : jet.ByteIterator
|
||||
}
|
||||
|
||||
public final class Char : jet.Number, jet.Comparable<jet.Char> {
|
||||
public constructor Char()
|
||||
public final fun compareTo(/*0*/ other : jet.Byte) : jet.Int
|
||||
@@ -225,7 +225,15 @@ public abstract class CharIterator : jet.Iterator<jet.Char> {
|
||||
public abstract fun nextChar() : jet.Char
|
||||
}
|
||||
|
||||
public final class CharRange : jet.Range<jet.Char>, jet.NumberSequence<jet.Char> {
|
||||
public final class CharProgression : jet.Progression<jet.Char> {
|
||||
public constructor CharProgression(/*0*/ start : jet.Char, /*1*/ end : jet.Char, /*2*/ increment : jet.Int)
|
||||
public open override /*1*/ val end : jet.Char
|
||||
public open override /*1*/ val increment : jet.Int
|
||||
public open override /*1*/ val start : jet.Char
|
||||
public open override /*1*/ fun iterator() : jet.CharIterator
|
||||
}
|
||||
|
||||
public final class CharRange : jet.Range<jet.Char>, jet.Progression<jet.Char> {
|
||||
public constructor CharRange(/*0*/ start : jet.Char, /*1*/ end : jet.Char)
|
||||
public open override /*2*/ val end : jet.Char
|
||||
public open override /*1*/ val increment : jet.Int
|
||||
@@ -245,14 +253,6 @@ public trait CharSequence {
|
||||
public abstract fun toString() : jet.String
|
||||
}
|
||||
|
||||
public final class CharacterSequence : jet.NumberSequence<jet.Char> {
|
||||
public constructor CharacterSequence(/*0*/ start : jet.Char, /*1*/ end : jet.Char, /*2*/ increment : jet.Int)
|
||||
public open override /*1*/ val end : jet.Char
|
||||
public open override /*1*/ val increment : jet.Int
|
||||
public open override /*1*/ val start : jet.Char
|
||||
public open override /*1*/ fun iterator() : jet.CharIterator
|
||||
}
|
||||
|
||||
public trait Collection</*0*/ out E> : jet.Iterable<E>, jet.Hashable {
|
||||
public abstract fun contains(/*0*/ o : jet.Any?) : jet.Boolean
|
||||
public abstract fun containsAll(/*0*/ c : jet.Collection<jet.Any?>) : jet.Boolean
|
||||
@@ -350,7 +350,15 @@ public abstract class DoubleIterator : jet.Iterator<jet.Double> {
|
||||
public abstract fun nextDouble() : jet.Double
|
||||
}
|
||||
|
||||
public final class DoubleRange : jet.Range<jet.Double>, jet.NumberSequence<jet.Double> {
|
||||
public final class DoubleProgression : jet.Progression<jet.Double> {
|
||||
public constructor DoubleProgression(/*0*/ start : jet.Double, /*1*/ end : jet.Double, /*2*/ increment : jet.Double)
|
||||
public open override /*1*/ val end : jet.Double
|
||||
public open override /*1*/ val increment : jet.Double
|
||||
public open override /*1*/ val start : jet.Double
|
||||
public open override /*1*/ fun iterator() : jet.DoubleIterator
|
||||
}
|
||||
|
||||
public final class DoubleRange : jet.Range<jet.Double>, jet.Progression<jet.Double> {
|
||||
public constructor DoubleRange(/*0*/ start : jet.Double, /*1*/ end : jet.Double)
|
||||
public open override /*2*/ val end : jet.Double
|
||||
public open override /*1*/ val increment : jet.Double
|
||||
@@ -364,14 +372,6 @@ public final class DoubleRange : jet.Range<jet.Double>, jet.NumberSequence<jet.D
|
||||
}
|
||||
}
|
||||
|
||||
public final class DoubleSequence : jet.NumberSequence<jet.Double> {
|
||||
public constructor DoubleSequence(/*0*/ start : jet.Double, /*1*/ end : jet.Double, /*2*/ increment : jet.Double)
|
||||
public open override /*1*/ val end : jet.Double
|
||||
public open override /*1*/ val increment : jet.Double
|
||||
public open override /*1*/ val start : jet.Double
|
||||
public open override /*1*/ fun iterator() : jet.DoubleIterator
|
||||
}
|
||||
|
||||
public abstract class Enum</*0*/ E : jet.Enum<E>> {
|
||||
public constructor Enum</*0*/ E : jet.Enum<E>>(/*0*/ name : jet.String, /*1*/ ordinal : jet.Int)
|
||||
public final fun name() : jet.String
|
||||
@@ -575,7 +575,15 @@ public abstract class FloatIterator : jet.Iterator<jet.Float> {
|
||||
public abstract fun nextFloat() : jet.Float
|
||||
}
|
||||
|
||||
public final class FloatRange : jet.Range<jet.Float>, jet.NumberSequence<jet.Float> {
|
||||
public final class FloatProgression : jet.Progression<jet.Float> {
|
||||
public constructor FloatProgression(/*0*/ start : jet.Float, /*1*/ end : jet.Float, /*2*/ increment : jet.Float)
|
||||
public open override /*1*/ val end : jet.Float
|
||||
public open override /*1*/ val increment : jet.Float
|
||||
public open override /*1*/ val start : jet.Float
|
||||
public open override /*1*/ fun iterator() : jet.FloatIterator
|
||||
}
|
||||
|
||||
public final class FloatRange : jet.Range<jet.Float>, jet.Progression<jet.Float> {
|
||||
public constructor FloatRange(/*0*/ start : jet.Float, /*1*/ end : jet.Float)
|
||||
public open override /*2*/ val end : jet.Float
|
||||
public open override /*1*/ val increment : jet.Float
|
||||
@@ -589,14 +597,6 @@ public final class FloatRange : jet.Range<jet.Float>, jet.NumberSequence<jet.Flo
|
||||
}
|
||||
}
|
||||
|
||||
public final class FloatSequence : jet.NumberSequence<jet.Float> {
|
||||
public constructor FloatSequence(/*0*/ start : jet.Float, /*1*/ end : jet.Float, /*2*/ increment : jet.Float)
|
||||
public open override /*1*/ val end : jet.Float
|
||||
public open override /*1*/ val increment : jet.Float
|
||||
public open override /*1*/ val start : jet.Float
|
||||
public open override /*1*/ fun iterator() : jet.FloatIterator
|
||||
}
|
||||
|
||||
public abstract class Function0</*0*/ out R> {
|
||||
public constructor Function0</*0*/ out R>()
|
||||
public abstract fun invoke() : R
|
||||
@@ -806,7 +806,15 @@ public abstract class IntIterator : jet.Iterator<jet.Int> {
|
||||
public abstract fun nextInt() : jet.Int
|
||||
}
|
||||
|
||||
public final class IntRange : jet.Range<jet.Int>, jet.NumberSequence<jet.Int> {
|
||||
public final class IntProgression : jet.Progression<jet.Int> {
|
||||
public constructor IntProgression(/*0*/ start : jet.Int, /*1*/ end : jet.Int, /*2*/ increment : jet.Int)
|
||||
public open override /*1*/ val end : jet.Int
|
||||
public open override /*1*/ val increment : jet.Int
|
||||
public open override /*1*/ val start : jet.Int
|
||||
public open override /*1*/ fun iterator() : jet.IntIterator
|
||||
}
|
||||
|
||||
public final class IntRange : jet.Range<jet.Int>, jet.Progression<jet.Int> {
|
||||
public constructor IntRange(/*0*/ start : jet.Int, /*1*/ end : jet.Int)
|
||||
public open override /*2*/ val end : jet.Int
|
||||
public open override /*1*/ val increment : jet.Int
|
||||
@@ -820,14 +828,6 @@ public final class IntRange : jet.Range<jet.Int>, jet.NumberSequence<jet.Int> {
|
||||
}
|
||||
}
|
||||
|
||||
public final class IntSequence : jet.NumberSequence<jet.Int> {
|
||||
public constructor IntSequence(/*0*/ start : jet.Int, /*1*/ end : jet.Int, /*2*/ increment : jet.Int)
|
||||
public open override /*1*/ val end : jet.Int
|
||||
public open override /*1*/ val increment : jet.Int
|
||||
public open override /*1*/ val start : jet.Int
|
||||
public open override /*1*/ fun iterator() : jet.IntIterator
|
||||
}
|
||||
|
||||
public trait Iterable</*0*/ out T> {
|
||||
public abstract fun iterator() : jet.Iterator<T>
|
||||
}
|
||||
@@ -953,7 +953,15 @@ public abstract class LongIterator : jet.Iterator<jet.Long> {
|
||||
public abstract fun nextLong() : jet.Long
|
||||
}
|
||||
|
||||
public final class LongRange : jet.Range<jet.Long>, jet.NumberSequence<jet.Long> {
|
||||
public final class LongProgression : jet.Progression<jet.Long> {
|
||||
public constructor LongProgression(/*0*/ start : jet.Long, /*1*/ end : jet.Long, /*2*/ increment : jet.Long)
|
||||
public open override /*1*/ val end : jet.Long
|
||||
public open override /*1*/ val increment : jet.Long
|
||||
public open override /*1*/ val start : jet.Long
|
||||
public open override /*1*/ fun iterator() : jet.LongIterator
|
||||
}
|
||||
|
||||
public final class LongRange : jet.Range<jet.Long>, jet.Progression<jet.Long> {
|
||||
public constructor LongRange(/*0*/ start : jet.Long, /*1*/ end : jet.Long)
|
||||
public open override /*2*/ val end : jet.Long
|
||||
public open override /*1*/ val increment : jet.Long
|
||||
@@ -967,14 +975,6 @@ public final class LongRange : jet.Range<jet.Long>, jet.NumberSequence<jet.Long>
|
||||
}
|
||||
}
|
||||
|
||||
public final class LongSequence : jet.NumberSequence<jet.Long> {
|
||||
public constructor LongSequence(/*0*/ start : jet.Long, /*1*/ end : jet.Long, /*2*/ increment : jet.Long)
|
||||
public open override /*1*/ val end : jet.Long
|
||||
public open override /*1*/ val increment : jet.Long
|
||||
public open override /*1*/ val start : jet.Long
|
||||
public open override /*1*/ fun iterator() : jet.LongIterator
|
||||
}
|
||||
|
||||
public trait Map</*0*/ K, /*1*/ out V> {
|
||||
public abstract fun containsKey(/*0*/ key : jet.Any?) : jet.Boolean
|
||||
public abstract fun containsValue(/*0*/ value : jet.Any?) : jet.Boolean
|
||||
@@ -1119,7 +1119,7 @@ public abstract class Number : jet.Hashable {
|
||||
public abstract fun toShort() : jet.Short
|
||||
}
|
||||
|
||||
public trait NumberSequence</*0*/ N : jet.Any> : jet.Iterable<N> {
|
||||
public trait Progression</*0*/ N : jet.Any> : jet.Iterable<N> {
|
||||
public abstract val end : N
|
||||
public abstract val increment : jet.Number
|
||||
public abstract val start : N
|
||||
@@ -1226,7 +1226,15 @@ public abstract class ShortIterator : jet.Iterator<jet.Short> {
|
||||
public abstract fun nextShort() : jet.Short
|
||||
}
|
||||
|
||||
public final class ShortRange : jet.Range<jet.Short>, jet.NumberSequence<jet.Short> {
|
||||
public final class ShortProgression : jet.Progression<jet.Short> {
|
||||
public constructor ShortProgression(/*0*/ start : jet.Short, /*1*/ end : jet.Short, /*2*/ increment : jet.Int)
|
||||
public open override /*1*/ val end : jet.Short
|
||||
public open override /*1*/ val increment : jet.Int
|
||||
public open override /*1*/ val start : jet.Short
|
||||
public open override /*1*/ fun iterator() : jet.ShortIterator
|
||||
}
|
||||
|
||||
public final class ShortRange : jet.Range<jet.Short>, jet.Progression<jet.Short> {
|
||||
public constructor ShortRange(/*0*/ start : jet.Short, /*1*/ end : jet.Short)
|
||||
public open override /*2*/ val end : jet.Short
|
||||
public open override /*1*/ val increment : jet.Int
|
||||
@@ -1240,14 +1248,6 @@ public final class ShortRange : jet.Range<jet.Short>, jet.NumberSequence<jet.Sho
|
||||
}
|
||||
}
|
||||
|
||||
public final class ShortSequence : jet.NumberSequence<jet.Short> {
|
||||
public constructor ShortSequence(/*0*/ start : jet.Short, /*1*/ end : jet.Short, /*2*/ increment : jet.Int)
|
||||
public open override /*1*/ val end : jet.Short
|
||||
public open override /*1*/ val increment : jet.Int
|
||||
public open override /*1*/ val start : jet.Short
|
||||
public open override /*1*/ fun iterator() : jet.ShortIterator
|
||||
}
|
||||
|
||||
public final class String : jet.Comparable<jet.String>, jet.CharSequence {
|
||||
public constructor String()
|
||||
public open override /*1*/ val length : jet.Int
|
||||
|
||||
@@ -103,7 +103,7 @@ public final class StandardClasses {
|
||||
standardClasses.declare().forFQ("jet.IntRange").kotlinClass("NumberRange")
|
||||
.methods("iterator", "contains").properties("start", "end", "increment");
|
||||
|
||||
standardClasses.declare().forFQ("jet.IntSequence").kotlinClass("NumberSequence")
|
||||
standardClasses.declare().forFQ("jet.IntProgression").kotlinClass("NumberProgression")
|
||||
.methods("iterator", "contains").properties("start", "end", "increment");
|
||||
|
||||
standardClasses.declare().forFQ("jet.Any.toString").kotlinFunction("toString");
|
||||
|
||||
@@ -68,7 +68,7 @@ var kotlin = {set:function (receiver, key, value) {
|
||||
};
|
||||
|
||||
Kotlin.intDownto = function (from, to) {
|
||||
return Kotlin.$new(Kotlin.NumberSequence)(from, to, -1);
|
||||
return Kotlin.$new(Kotlin.Progression)(from, to, -1);
|
||||
};
|
||||
|
||||
Kotlin.modules = {};
|
||||
@@ -394,7 +394,7 @@ var kotlin = {set:function (receiver, key, value) {
|
||||
}
|
||||
});
|
||||
|
||||
Kotlin.NumberSequence = Kotlin.$createClass({
|
||||
Kotlin.Progression = Kotlin.$createClass({
|
||||
initialize: function (start, end, increment) {
|
||||
this.$start = start;
|
||||
this.$end = end;
|
||||
|
||||
@@ -6,198 +6,198 @@ package kotlin
|
||||
//
|
||||
|
||||
|
||||
public inline fun Byte.downTo(to: Byte): ByteSequence {
|
||||
return ByteSequence(this, to, -1)
|
||||
public inline fun Byte.downTo(to: Byte): ByteProgression {
|
||||
return ByteProgression(this, to, -1)
|
||||
}
|
||||
|
||||
public inline fun Byte.downTo(to: Char): CharacterSequence {
|
||||
return CharacterSequence(this.toChar(), to, -1)
|
||||
public inline fun Byte.downTo(to: Char): CharProgression {
|
||||
return CharProgression(this.toChar(), to, -1)
|
||||
}
|
||||
|
||||
public inline fun Byte.downTo(to: Short): ShortSequence {
|
||||
return ShortSequence(this.toShort(), to, -1)
|
||||
public inline fun Byte.downTo(to: Short): ShortProgression {
|
||||
return ShortProgression(this.toShort(), to, -1)
|
||||
}
|
||||
|
||||
public inline fun Byte.downTo(to: Int): IntSequence {
|
||||
return IntSequence(this.toInt(), to, -1)
|
||||
public inline fun Byte.downTo(to: Int): IntProgression {
|
||||
return IntProgression(this.toInt(), to, -1)
|
||||
}
|
||||
|
||||
public inline fun Byte.downTo(to: Long): LongSequence {
|
||||
return LongSequence(this.toLong(), to, -1.toLong())
|
||||
public inline fun Byte.downTo(to: Long): LongProgression {
|
||||
return LongProgression(this.toLong(), to, -1.toLong())
|
||||
}
|
||||
|
||||
public inline fun Byte.downTo(to: Float): FloatSequence {
|
||||
return FloatSequence(this.toFloat(), to, -1.toFloat())
|
||||
public inline fun Byte.downTo(to: Float): FloatProgression {
|
||||
return FloatProgression(this.toFloat(), to, -1.toFloat())
|
||||
}
|
||||
|
||||
public inline fun Byte.downTo(to: Double): DoubleSequence {
|
||||
return DoubleSequence(this.toDouble(), to, -1.0)
|
||||
public inline fun Byte.downTo(to: Double): DoubleProgression {
|
||||
return DoubleProgression(this.toDouble(), to, -1.0)
|
||||
}
|
||||
|
||||
public inline fun Char.downTo(to: Byte): CharacterSequence {
|
||||
return CharacterSequence(this, to.toChar(), -1)
|
||||
public inline fun Char.downTo(to: Byte): CharProgression {
|
||||
return CharProgression(this, to.toChar(), -1)
|
||||
}
|
||||
|
||||
public inline fun Char.downTo(to: Char): CharacterSequence {
|
||||
return CharacterSequence(this, to, -1)
|
||||
public inline fun Char.downTo(to: Char): CharProgression {
|
||||
return CharProgression(this, to, -1)
|
||||
}
|
||||
|
||||
public inline fun Char.downTo(to: Short): ShortSequence {
|
||||
return ShortSequence(this.toShort(), to, -1)
|
||||
public inline fun Char.downTo(to: Short): ShortProgression {
|
||||
return ShortProgression(this.toShort(), to, -1)
|
||||
}
|
||||
|
||||
public inline fun Char.downTo(to: Int): IntSequence {
|
||||
return IntSequence(this.toInt(), to, -1)
|
||||
public inline fun Char.downTo(to: Int): IntProgression {
|
||||
return IntProgression(this.toInt(), to, -1)
|
||||
}
|
||||
|
||||
public inline fun Char.downTo(to: Long): LongSequence {
|
||||
return LongSequence(this.toLong(), to, -1.toLong())
|
||||
public inline fun Char.downTo(to: Long): LongProgression {
|
||||
return LongProgression(this.toLong(), to, -1.toLong())
|
||||
}
|
||||
|
||||
public inline fun Char.downTo(to: Float): FloatSequence {
|
||||
return FloatSequence(this.toFloat(), to, -1.toFloat())
|
||||
public inline fun Char.downTo(to: Float): FloatProgression {
|
||||
return FloatProgression(this.toFloat(), to, -1.toFloat())
|
||||
}
|
||||
|
||||
public inline fun Char.downTo(to: Double): DoubleSequence {
|
||||
return DoubleSequence(this.toDouble(), to, -1.0)
|
||||
public inline fun Char.downTo(to: Double): DoubleProgression {
|
||||
return DoubleProgression(this.toDouble(), to, -1.0)
|
||||
}
|
||||
|
||||
public inline fun Short.downTo(to: Byte): ShortSequence {
|
||||
return ShortSequence(this, to.toShort(), -1)
|
||||
public inline fun Short.downTo(to: Byte): ShortProgression {
|
||||
return ShortProgression(this, to.toShort(), -1)
|
||||
}
|
||||
|
||||
public inline fun Short.downTo(to: Char): ShortSequence {
|
||||
return ShortSequence(this, to.toShort(), -1)
|
||||
public inline fun Short.downTo(to: Char): ShortProgression {
|
||||
return ShortProgression(this, to.toShort(), -1)
|
||||
}
|
||||
|
||||
public inline fun Short.downTo(to: Short): ShortSequence {
|
||||
return ShortSequence(this, to, -1)
|
||||
public inline fun Short.downTo(to: Short): ShortProgression {
|
||||
return ShortProgression(this, to, -1)
|
||||
}
|
||||
|
||||
public inline fun Short.downTo(to: Int): IntSequence {
|
||||
return IntSequence(this.toInt(), to, -1)
|
||||
public inline fun Short.downTo(to: Int): IntProgression {
|
||||
return IntProgression(this.toInt(), to, -1)
|
||||
}
|
||||
|
||||
public inline fun Short.downTo(to: Long): LongSequence {
|
||||
return LongSequence(this.toLong(), to, -1.toLong())
|
||||
public inline fun Short.downTo(to: Long): LongProgression {
|
||||
return LongProgression(this.toLong(), to, -1.toLong())
|
||||
}
|
||||
|
||||
public inline fun Short.downTo(to: Float): FloatSequence {
|
||||
return FloatSequence(this.toFloat(), to, -1.toFloat())
|
||||
public inline fun Short.downTo(to: Float): FloatProgression {
|
||||
return FloatProgression(this.toFloat(), to, -1.toFloat())
|
||||
}
|
||||
|
||||
public inline fun Short.downTo(to: Double): DoubleSequence {
|
||||
return DoubleSequence(this.toDouble(), to, -1.0)
|
||||
public inline fun Short.downTo(to: Double): DoubleProgression {
|
||||
return DoubleProgression(this.toDouble(), to, -1.0)
|
||||
}
|
||||
|
||||
public inline fun Int.downTo(to: Byte): IntSequence {
|
||||
return IntSequence(this, to.toInt(), -1)
|
||||
public inline fun Int.downTo(to: Byte): IntProgression {
|
||||
return IntProgression(this, to.toInt(), -1)
|
||||
}
|
||||
|
||||
public inline fun Int.downTo(to: Char): IntSequence {
|
||||
return IntSequence(this, to.toInt(), -1)
|
||||
public inline fun Int.downTo(to: Char): IntProgression {
|
||||
return IntProgression(this, to.toInt(), -1)
|
||||
}
|
||||
|
||||
public inline fun Int.downTo(to: Short): IntSequence {
|
||||
return IntSequence(this, to.toInt(), -1)
|
||||
public inline fun Int.downTo(to: Short): IntProgression {
|
||||
return IntProgression(this, to.toInt(), -1)
|
||||
}
|
||||
|
||||
public inline fun Int.downTo(to: Int): IntSequence {
|
||||
return IntSequence(this, to, -1)
|
||||
public inline fun Int.downTo(to: Int): IntProgression {
|
||||
return IntProgression(this, to, -1)
|
||||
}
|
||||
|
||||
public inline fun Int.downTo(to: Long): LongSequence {
|
||||
return LongSequence(this.toLong(), to, -1.toLong())
|
||||
public inline fun Int.downTo(to: Long): LongProgression {
|
||||
return LongProgression(this.toLong(), to, -1.toLong())
|
||||
}
|
||||
|
||||
public inline fun Int.downTo(to: Float): FloatSequence {
|
||||
return FloatSequence(this.toFloat(), to, -1.toFloat())
|
||||
public inline fun Int.downTo(to: Float): FloatProgression {
|
||||
return FloatProgression(this.toFloat(), to, -1.toFloat())
|
||||
}
|
||||
|
||||
public inline fun Int.downTo(to: Double): DoubleSequence {
|
||||
return DoubleSequence(this.toDouble(), to, -1.0)
|
||||
public inline fun Int.downTo(to: Double): DoubleProgression {
|
||||
return DoubleProgression(this.toDouble(), to, -1.0)
|
||||
}
|
||||
|
||||
public inline fun Long.downTo(to: Byte): LongSequence {
|
||||
return LongSequence(this, to.toLong(), -1.toLong())
|
||||
public inline fun Long.downTo(to: Byte): LongProgression {
|
||||
return LongProgression(this, to.toLong(), -1.toLong())
|
||||
}
|
||||
|
||||
public inline fun Long.downTo(to: Char): LongSequence {
|
||||
return LongSequence(this, to.toLong(), -1.toLong())
|
||||
public inline fun Long.downTo(to: Char): LongProgression {
|
||||
return LongProgression(this, to.toLong(), -1.toLong())
|
||||
}
|
||||
|
||||
public inline fun Long.downTo(to: Short): LongSequence {
|
||||
return LongSequence(this, to.toLong(), -1.toLong())
|
||||
public inline fun Long.downTo(to: Short): LongProgression {
|
||||
return LongProgression(this, to.toLong(), -1.toLong())
|
||||
}
|
||||
|
||||
public inline fun Long.downTo(to: Int): LongSequence {
|
||||
return LongSequence(this, to.toLong(), -1.toLong())
|
||||
public inline fun Long.downTo(to: Int): LongProgression {
|
||||
return LongProgression(this, to.toLong(), -1.toLong())
|
||||
}
|
||||
|
||||
public inline fun Long.downTo(to: Long): LongSequence {
|
||||
return LongSequence(this, to, -1.toLong())
|
||||
public inline fun Long.downTo(to: Long): LongProgression {
|
||||
return LongProgression(this, to, -1.toLong())
|
||||
}
|
||||
|
||||
public inline fun Long.downTo(to: Float): FloatSequence {
|
||||
return FloatSequence(this.toFloat(), to, -1.toFloat())
|
||||
public inline fun Long.downTo(to: Float): FloatProgression {
|
||||
return FloatProgression(this.toFloat(), to, -1.toFloat())
|
||||
}
|
||||
|
||||
public inline fun Long.downTo(to: Double): DoubleSequence {
|
||||
return DoubleSequence(this.toDouble(), to, -1.0)
|
||||
public inline fun Long.downTo(to: Double): DoubleProgression {
|
||||
return DoubleProgression(this.toDouble(), to, -1.0)
|
||||
}
|
||||
|
||||
public inline fun Float.downTo(to: Byte): FloatSequence {
|
||||
return FloatSequence(this, to.toFloat(), -1.toFloat())
|
||||
public inline fun Float.downTo(to: Byte): FloatProgression {
|
||||
return FloatProgression(this, to.toFloat(), -1.toFloat())
|
||||
}
|
||||
|
||||
public inline fun Float.downTo(to: Char): FloatSequence {
|
||||
return FloatSequence(this, to.toFloat(), -1.toFloat())
|
||||
public inline fun Float.downTo(to: Char): FloatProgression {
|
||||
return FloatProgression(this, to.toFloat(), -1.toFloat())
|
||||
}
|
||||
|
||||
public inline fun Float.downTo(to: Short): FloatSequence {
|
||||
return FloatSequence(this, to.toFloat(), -1.toFloat())
|
||||
public inline fun Float.downTo(to: Short): FloatProgression {
|
||||
return FloatProgression(this, to.toFloat(), -1.toFloat())
|
||||
}
|
||||
|
||||
public inline fun Float.downTo(to: Int): FloatSequence {
|
||||
return FloatSequence(this, to.toFloat(), -1.toFloat())
|
||||
public inline fun Float.downTo(to: Int): FloatProgression {
|
||||
return FloatProgression(this, to.toFloat(), -1.toFloat())
|
||||
}
|
||||
|
||||
public inline fun Float.downTo(to: Long): FloatSequence {
|
||||
return FloatSequence(this, to.toFloat(), -1.toFloat())
|
||||
public inline fun Float.downTo(to: Long): FloatProgression {
|
||||
return FloatProgression(this, to.toFloat(), -1.toFloat())
|
||||
}
|
||||
|
||||
public inline fun Float.downTo(to: Float): FloatSequence {
|
||||
return FloatSequence(this, to, -1.toFloat())
|
||||
public inline fun Float.downTo(to: Float): FloatProgression {
|
||||
return FloatProgression(this, to, -1.toFloat())
|
||||
}
|
||||
|
||||
public inline fun Float.downTo(to: Double): DoubleSequence {
|
||||
return DoubleSequence(this.toDouble(), to, -1.0)
|
||||
public inline fun Float.downTo(to: Double): DoubleProgression {
|
||||
return DoubleProgression(this.toDouble(), to, -1.0)
|
||||
}
|
||||
|
||||
public inline fun Double.downTo(to: Byte): DoubleSequence {
|
||||
return DoubleSequence(this, to.toDouble(), -1.0)
|
||||
public inline fun Double.downTo(to: Byte): DoubleProgression {
|
||||
return DoubleProgression(this, to.toDouble(), -1.0)
|
||||
}
|
||||
|
||||
public inline fun Double.downTo(to: Char): DoubleSequence {
|
||||
return DoubleSequence(this, to.toDouble(), -1.0)
|
||||
public inline fun Double.downTo(to: Char): DoubleProgression {
|
||||
return DoubleProgression(this, to.toDouble(), -1.0)
|
||||
}
|
||||
|
||||
public inline fun Double.downTo(to: Short): DoubleSequence {
|
||||
return DoubleSequence(this, to.toDouble(), -1.0)
|
||||
public inline fun Double.downTo(to: Short): DoubleProgression {
|
||||
return DoubleProgression(this, to.toDouble(), -1.0)
|
||||
}
|
||||
|
||||
public inline fun Double.downTo(to: Int): DoubleSequence {
|
||||
return DoubleSequence(this, to.toDouble(), -1.0)
|
||||
public inline fun Double.downTo(to: Int): DoubleProgression {
|
||||
return DoubleProgression(this, to.toDouble(), -1.0)
|
||||
}
|
||||
|
||||
public inline fun Double.downTo(to: Long): DoubleSequence {
|
||||
return DoubleSequence(this, to.toDouble(), -1.0)
|
||||
public inline fun Double.downTo(to: Long): DoubleProgression {
|
||||
return DoubleProgression(this, to.toDouble(), -1.0)
|
||||
}
|
||||
|
||||
public inline fun Double.downTo(to: Float): DoubleSequence {
|
||||
return DoubleSequence(this, to.toDouble(), -1.0)
|
||||
public inline fun Double.downTo(to: Float): DoubleProgression {
|
||||
return DoubleProgression(this, to.toDouble(), -1.0)
|
||||
}
|
||||
|
||||
public inline fun Double.downTo(to: Double): DoubleSequence {
|
||||
return DoubleSequence(this, to, -1.0)
|
||||
public inline fun Double.downTo(to: Double): DoubleProgression {
|
||||
return DoubleProgression(this, to, -1.0)
|
||||
}
|
||||
|
||||
@@ -19,133 +19,133 @@ public fun <T: Comparable<T>> T.rangeTo(that: T): ComparableRange<T> {
|
||||
|
||||
|
||||
|
||||
public fun CharacterSequence.reversed(): CharacterSequence {
|
||||
return CharacterSequence(end, start, -increment)
|
||||
public fun CharProgression.reversed(): CharProgression {
|
||||
return CharProgression(end, start, -increment)
|
||||
}
|
||||
|
||||
public fun ByteSequence.reversed(): ByteSequence {
|
||||
return ByteSequence(end, start, -increment)
|
||||
public fun ByteProgression.reversed(): ByteProgression {
|
||||
return ByteProgression(end, start, -increment)
|
||||
}
|
||||
|
||||
public fun ShortSequence.reversed(): ShortSequence {
|
||||
return ShortSequence(end, start, -increment)
|
||||
public fun ShortProgression.reversed(): ShortProgression {
|
||||
return ShortProgression(end, start, -increment)
|
||||
}
|
||||
|
||||
public fun IntSequence.reversed(): IntSequence {
|
||||
return IntSequence(end, start, -increment)
|
||||
public fun IntProgression.reversed(): IntProgression {
|
||||
return IntProgression(end, start, -increment)
|
||||
}
|
||||
|
||||
public fun FloatSequence.reversed(): FloatSequence {
|
||||
return FloatSequence(end, start, -increment)
|
||||
public fun FloatProgression.reversed(): FloatProgression {
|
||||
return FloatProgression(end, start, -increment)
|
||||
}
|
||||
|
||||
public fun LongSequence.reversed(): LongSequence {
|
||||
return LongSequence(end, start, -increment)
|
||||
public fun LongProgression.reversed(): LongProgression {
|
||||
return LongProgression(end, start, -increment)
|
||||
}
|
||||
|
||||
public fun DoubleSequence.reversed(): DoubleSequence {
|
||||
return DoubleSequence(end, start, -increment)
|
||||
public fun DoubleProgression.reversed(): DoubleProgression {
|
||||
return DoubleProgression(end, start, -increment)
|
||||
}
|
||||
|
||||
|
||||
public fun CharRange.reversed(): CharacterSequence {
|
||||
return CharacterSequence(end, start, -1)
|
||||
public fun CharRange.reversed(): CharProgression {
|
||||
return CharProgression(end, start, -1)
|
||||
}
|
||||
|
||||
public fun ByteRange.reversed(): ByteSequence {
|
||||
return ByteSequence(end, start, -1)
|
||||
public fun ByteRange.reversed(): ByteProgression {
|
||||
return ByteProgression(end, start, -1)
|
||||
}
|
||||
|
||||
public fun ShortRange.reversed(): ShortSequence {
|
||||
return ShortSequence(end, start, -1)
|
||||
public fun ShortRange.reversed(): ShortProgression {
|
||||
return ShortProgression(end, start, -1)
|
||||
}
|
||||
|
||||
public fun IntRange.reversed(): IntSequence {
|
||||
return IntSequence(end, start, -1)
|
||||
public fun IntRange.reversed(): IntProgression {
|
||||
return IntProgression(end, start, -1)
|
||||
}
|
||||
|
||||
public fun FloatRange.reversed(): FloatSequence {
|
||||
return FloatSequence(end, start, -1.0.toFloat())
|
||||
public fun FloatRange.reversed(): FloatProgression {
|
||||
return FloatProgression(end, start, -1.0.toFloat())
|
||||
}
|
||||
|
||||
public fun LongRange.reversed(): LongSequence {
|
||||
return LongSequence(end, start, -1.toLong())
|
||||
public fun LongRange.reversed(): LongProgression {
|
||||
return LongProgression(end, start, -1.toLong())
|
||||
}
|
||||
|
||||
public fun DoubleRange.reversed(): DoubleSequence {
|
||||
return DoubleSequence(end, start, -1.0)
|
||||
public fun DoubleRange.reversed(): DoubleProgression {
|
||||
return DoubleProgression(end, start, -1.0)
|
||||
}
|
||||
|
||||
|
||||
public fun IntSequence.step(step: Int): IntSequence {
|
||||
public fun IntProgression.step(step: Int): IntProgression {
|
||||
checkStepIsPositive(step > 0, step)
|
||||
return IntSequence(start, end, if (increment > 0) step else -step)
|
||||
return IntProgression(start, end, if (increment > 0) step else -step)
|
||||
}
|
||||
|
||||
public fun CharacterSequence.step(step: Int): CharacterSequence {
|
||||
public fun CharProgression.step(step: Int): CharProgression {
|
||||
checkStepIsPositive(step > 0, step)
|
||||
return CharacterSequence(start, end, if (increment > 0) step else -step)
|
||||
return CharProgression(start, end, if (increment > 0) step else -step)
|
||||
}
|
||||
|
||||
public fun ByteSequence.step(step: Int): ByteSequence {
|
||||
public fun ByteProgression.step(step: Int): ByteProgression {
|
||||
checkStepIsPositive(step > 0, step)
|
||||
return ByteSequence(start, end, if (increment > 0) step else -step)
|
||||
return ByteProgression(start, end, if (increment > 0) step else -step)
|
||||
}
|
||||
|
||||
public fun ShortSequence.step(step: Int): ShortSequence {
|
||||
public fun ShortProgression.step(step: Int): ShortProgression {
|
||||
checkStepIsPositive(step > 0, step)
|
||||
return ShortSequence(start, end, if (increment > 0) step else -step)
|
||||
return ShortProgression(start, end, if (increment > 0) step else -step)
|
||||
}
|
||||
|
||||
public fun LongSequence.step(step: Long): LongSequence {
|
||||
public fun LongProgression.step(step: Long): LongProgression {
|
||||
checkStepIsPositive(step > 0, step)
|
||||
return LongSequence(start, end, if (increment > 0) step else -step)
|
||||
return LongProgression(start, end, if (increment > 0) step else -step)
|
||||
}
|
||||
|
||||
public fun FloatSequence.step(step: Float): FloatSequence {
|
||||
public fun FloatProgression.step(step: Float): FloatProgression {
|
||||
checkStepIsPositive(step > 0, step)
|
||||
return FloatSequence(start, end, if (increment > 0) step else -step)
|
||||
return FloatProgression(start, end, if (increment > 0) step else -step)
|
||||
}
|
||||
|
||||
public fun DoubleSequence.step(step: Double): DoubleSequence {
|
||||
public fun DoubleProgression.step(step: Double): DoubleProgression {
|
||||
checkStepIsPositive(step > 0, step)
|
||||
return DoubleSequence(start, end, if (increment > 0) step else -step)
|
||||
return DoubleProgression(start, end, if (increment > 0) step else -step)
|
||||
}
|
||||
|
||||
|
||||
public fun IntRange.step(step: Int): IntSequence {
|
||||
public fun IntRange.step(step: Int): IntProgression {
|
||||
checkStepIsPositive(step > 0, step)
|
||||
return IntSequence(start, end, step)
|
||||
return IntProgression(start, end, step)
|
||||
}
|
||||
|
||||
public fun CharRange.step(step: Int): CharacterSequence {
|
||||
public fun CharRange.step(step: Int): CharProgression {
|
||||
checkStepIsPositive(step > 0, step)
|
||||
return CharacterSequence(start, end, step)
|
||||
return CharProgression(start, end, step)
|
||||
}
|
||||
|
||||
public fun ByteRange.step(step: Int): ByteSequence {
|
||||
public fun ByteRange.step(step: Int): ByteProgression {
|
||||
checkStepIsPositive(step > 0, step)
|
||||
return ByteSequence(start, end, step)
|
||||
return ByteProgression(start, end, step)
|
||||
}
|
||||
|
||||
public fun ShortRange.step(step: Int): ShortSequence {
|
||||
public fun ShortRange.step(step: Int): ShortProgression {
|
||||
checkStepIsPositive(step > 0, step)
|
||||
return ShortSequence(start, end, step)
|
||||
return ShortProgression(start, end, step)
|
||||
}
|
||||
|
||||
public fun LongRange.step(step: Long): LongSequence {
|
||||
public fun LongRange.step(step: Long): LongProgression {
|
||||
checkStepIsPositive(step > 0, step)
|
||||
return LongSequence(start, end, step)
|
||||
return LongProgression(start, end, step)
|
||||
}
|
||||
|
||||
public fun FloatRange.step(step: Float): FloatSequence {
|
||||
public fun FloatRange.step(step: Float): FloatProgression {
|
||||
checkStepIsPositive(step > 0, step)
|
||||
return FloatSequence(start, end, step)
|
||||
return FloatProgression(start, end, step)
|
||||
}
|
||||
|
||||
public fun DoubleRange.step(step: Double): DoubleSequence {
|
||||
public fun DoubleRange.step(step: Double): DoubleProgression {
|
||||
checkStepIsPositive(step > 0, step)
|
||||
return DoubleSequence(start, end, step)
|
||||
return DoubleProgression(start, end, step)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import org.junit.Test as test
|
||||
|
||||
public class RangeIterationTest {
|
||||
private fun <N> doTest(
|
||||
sequence: NumberSequence<N>,
|
||||
sequence: Progression<N>,
|
||||
expectedStart: N,
|
||||
expectedEnd: N,
|
||||
expectedIncrement: Number,
|
||||
|
||||
@@ -143,15 +143,15 @@ public class RangeTest {
|
||||
assertFalse("trail" in range)
|
||||
}
|
||||
|
||||
test fun illegalSequenceCreation() {
|
||||
// create sequence explicitly with increment = 0
|
||||
failsWith(javaClass<IllegalArgumentException>()) { IntSequence(0, 5, 0) }
|
||||
failsWith(javaClass<IllegalArgumentException>()) { ByteSequence(0, 5, 0) }
|
||||
failsWith(javaClass<IllegalArgumentException>()) { ShortSequence(0, 5, 0) }
|
||||
failsWith(javaClass<IllegalArgumentException>()) { LongSequence(0, 5, 0) }
|
||||
failsWith(javaClass<IllegalArgumentException>()) { CharacterSequence('a', 'z', 0) }
|
||||
failsWith(javaClass<IllegalArgumentException>()) { DoubleSequence(0.0, 5.0, 0.0) }
|
||||
failsWith(javaClass<IllegalArgumentException>()) { FloatSequence(0.0.toFloat(), 5.0.toFloat(), 0.0.toFloat()) }
|
||||
test fun illegalProgressionCreation() {
|
||||
// create Progression explicitly with increment = 0
|
||||
failsWith(javaClass<IllegalArgumentException>()) { IntProgression(0, 5, 0) }
|
||||
failsWith(javaClass<IllegalArgumentException>()) { ByteProgression(0, 5, 0) }
|
||||
failsWith(javaClass<IllegalArgumentException>()) { ShortProgression(0, 5, 0) }
|
||||
failsWith(javaClass<IllegalArgumentException>()) { LongProgression(0, 5, 0) }
|
||||
failsWith(javaClass<IllegalArgumentException>()) { CharProgression('a', 'z', 0) }
|
||||
failsWith(javaClass<IllegalArgumentException>()) { DoubleProgression(0.0, 5.0, 0.0) }
|
||||
failsWith(javaClass<IllegalArgumentException>()) { FloatProgression(0.0.toFloat(), 5.0.toFloat(), 0.0.toFloat()) }
|
||||
|
||||
failsWith(javaClass<IllegalArgumentException>()) { 0..5 step 0 }
|
||||
failsWith(javaClass<IllegalArgumentException>()) { 0.toByte()..5.toByte() step 0 }
|
||||
|
||||
@@ -20,7 +20,7 @@ private fun generateDownTos(outputFile: File, header: String) {
|
||||
|
||||
fun generateDownTo(writer: PrintWriter, fromType: String, toType: String) {
|
||||
val elementType = getMaxType(fromType, toType)
|
||||
val rangeType = if (elementType == "Char") "CharacterSequence" else elementType + "Sequence"
|
||||
val progressionType = elementType + "Progression"
|
||||
|
||||
val fromExpr = if (elementType == fromType) "this" else "this.to$elementType()"
|
||||
val toExpr = if (elementType == toType) "to" else "to.to$elementType()"
|
||||
@@ -32,8 +32,8 @@ private fun generateDownTos(outputFile: File, header: String) {
|
||||
}
|
||||
|
||||
writer.println("""
|
||||
public inline fun $fromType.downTo(to: $toType): $rangeType {
|
||||
return $rangeType($fromExpr, $toExpr, $incrementExpr)
|
||||
public inline fun $fromType.downTo(to: $toType): $progressionType {
|
||||
return $progressionType($fromExpr, $toExpr, $incrementExpr)
|
||||
}""")
|
||||
}
|
||||
|
||||
|
||||
@@ -19,12 +19,12 @@ package jet;
|
||||
import org.jetbrains.jet.rt.annotation.AssertInvisibleInResolver;
|
||||
|
||||
@AssertInvisibleInResolver
|
||||
public class ByteSequence implements NumberSequence<Byte> {
|
||||
public class ByteProgression implements Progression<Byte> {
|
||||
private final byte start;
|
||||
private final byte end;
|
||||
private final int increment;
|
||||
|
||||
public ByteSequence(byte start, byte end, int increment) {
|
||||
public ByteProgression(byte start, byte end, int increment) {
|
||||
if (increment == 0) {
|
||||
throw new IllegalArgumentException("Increment must be non-zero: " + increment);
|
||||
}
|
||||
@@ -50,7 +50,7 @@ public class ByteSequence implements NumberSequence<Byte> {
|
||||
|
||||
@Override
|
||||
public ByteIterator iterator() {
|
||||
return new ByteSequenceIterator(start, end, increment);
|
||||
return new ByteProgressionIterator(start, end, increment);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -68,7 +68,7 @@ public class ByteSequence implements NumberSequence<Byte> {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
ByteSequence bytes = (ByteSequence) o;
|
||||
ByteProgression bytes = (ByteProgression) o;
|
||||
|
||||
if (end != bytes.end) return false;
|
||||
if (increment != bytes.increment) return false;
|
||||
+2
-2
@@ -16,12 +16,12 @@
|
||||
|
||||
package jet;
|
||||
|
||||
class ByteSequenceIterator extends ByteIterator {
|
||||
class ByteProgressionIterator extends ByteIterator {
|
||||
private byte next;
|
||||
private final byte end;
|
||||
private final int increment;
|
||||
|
||||
public ByteSequenceIterator(byte start, byte end, int increment) {
|
||||
public ByteProgressionIterator(byte start, byte end, int increment) {
|
||||
this.next = start;
|
||||
this.end = end;
|
||||
this.increment = increment;
|
||||
@@ -19,7 +19,7 @@ package jet;
|
||||
import org.jetbrains.jet.rt.annotation.AssertInvisibleInResolver;
|
||||
|
||||
@AssertInvisibleInResolver
|
||||
public final class ByteRange implements Range<Byte>, NumberSequence<Byte> {
|
||||
public final class ByteRange implements Range<Byte>, Progression<Byte> {
|
||||
public static final ByteRange EMPTY = new ByteRange((byte) 1, (byte) 0);
|
||||
|
||||
private final byte start;
|
||||
@@ -56,7 +56,7 @@ public final class ByteRange implements Range<Byte>, NumberSequence<Byte> {
|
||||
|
||||
@Override
|
||||
public ByteIterator iterator() {
|
||||
return new ByteSequenceIterator(start, end, 1);
|
||||
return new ByteProgressionIterator(start, end, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,12 +19,12 @@ package jet;
|
||||
import org.jetbrains.jet.rt.annotation.AssertInvisibleInResolver;
|
||||
|
||||
@AssertInvisibleInResolver
|
||||
public class CharacterSequence implements NumberSequence<Character> {
|
||||
public class CharProgression implements Progression<Character> {
|
||||
private final char start;
|
||||
private final char end;
|
||||
private final int increment;
|
||||
|
||||
public CharacterSequence(char start, char end, int increment) {
|
||||
public CharProgression(char start, char end, int increment) {
|
||||
if (increment == 0) {
|
||||
throw new IllegalArgumentException("Increment must be non-zero: " + increment);
|
||||
}
|
||||
@@ -50,7 +50,7 @@ public class CharacterSequence implements NumberSequence<Character> {
|
||||
|
||||
@Override
|
||||
public CharIterator iterator() {
|
||||
return new CharacterSequenceIterator(start, end, increment);
|
||||
return new CharProgressionIterator(start, end, increment);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -68,7 +68,7 @@ public class CharacterSequence implements NumberSequence<Character> {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
CharacterSequence that = (CharacterSequence) o;
|
||||
CharProgression that = (CharProgression) o;
|
||||
|
||||
if (end != that.end) return false;
|
||||
if (increment != that.increment) return false;
|
||||
+2
-2
@@ -16,12 +16,12 @@
|
||||
|
||||
package jet;
|
||||
|
||||
class CharacterSequenceIterator extends CharIterator {
|
||||
class CharProgressionIterator extends CharIterator {
|
||||
private char next;
|
||||
private final char end;
|
||||
private final int increment;
|
||||
|
||||
public CharacterSequenceIterator(char start, char end, int increment) {
|
||||
public CharProgressionIterator(char start, char end, int increment) {
|
||||
this.next = start;
|
||||
this.end = end;
|
||||
this.increment = increment;
|
||||
@@ -19,7 +19,7 @@ package jet;
|
||||
import org.jetbrains.jet.rt.annotation.AssertInvisibleInResolver;
|
||||
|
||||
@AssertInvisibleInResolver
|
||||
public final class CharRange implements Range<Character>, NumberSequence<Character> {
|
||||
public final class CharRange implements Range<Character>, Progression<Character> {
|
||||
public static final CharRange EMPTY = new CharRange((char) 1, (char) 0);
|
||||
|
||||
private final char start;
|
||||
@@ -56,7 +56,7 @@ public final class CharRange implements Range<Character>, NumberSequence<Charact
|
||||
|
||||
@Override
|
||||
public CharIterator iterator() {
|
||||
return new CharacterSequenceIterator(start, end, 1);
|
||||
return new CharProgressionIterator(start, end, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,12 +19,12 @@ package jet;
|
||||
import org.jetbrains.jet.rt.annotation.AssertInvisibleInResolver;
|
||||
|
||||
@AssertInvisibleInResolver
|
||||
public class DoubleSequence implements NumberSequence<Double> {
|
||||
public class DoubleProgression implements Progression<Double> {
|
||||
private final double start;
|
||||
private final double end;
|
||||
private final double increment;
|
||||
|
||||
public DoubleSequence(double start, double end, double increment) {
|
||||
public DoubleProgression(double start, double end, double increment) {
|
||||
if (increment == 0.0 || increment == -0.0) {
|
||||
throw new IllegalArgumentException("Increment must be non-zero: " + increment);
|
||||
}
|
||||
@@ -50,7 +50,7 @@ public class DoubleSequence implements NumberSequence<Double> {
|
||||
|
||||
@Override
|
||||
public DoubleIterator iterator() {
|
||||
return new DoubleSequenceIterator(start, end, increment);
|
||||
return new DoubleProgressionIterator(start, end, increment);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -68,7 +68,7 @@ public class DoubleSequence implements NumberSequence<Double> {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
DoubleSequence doubles = (DoubleSequence) o;
|
||||
DoubleProgression doubles = (DoubleProgression) o;
|
||||
|
||||
if (Double.compare(doubles.end, end) != 0) return false;
|
||||
if (Double.compare(doubles.increment, increment) != 0) return false;
|
||||
+2
-2
@@ -16,12 +16,12 @@
|
||||
|
||||
package jet;
|
||||
|
||||
class DoubleSequenceIterator extends DoubleIterator {
|
||||
class DoubleProgressionIterator extends DoubleIterator {
|
||||
private double next;
|
||||
private final double end;
|
||||
private final double increment;
|
||||
|
||||
public DoubleSequenceIterator(double start, double end, double increment) {
|
||||
public DoubleProgressionIterator(double start, double end, double increment) {
|
||||
this.next = start;
|
||||
this.end = end;
|
||||
this.increment = increment;
|
||||
@@ -19,7 +19,7 @@ package jet;
|
||||
import org.jetbrains.jet.rt.annotation.AssertInvisibleInResolver;
|
||||
|
||||
@AssertInvisibleInResolver
|
||||
public final class DoubleRange implements Range<Double>, NumberSequence<Double> {
|
||||
public final class DoubleRange implements Range<Double>, Progression<Double> {
|
||||
public static final DoubleRange EMPTY = new DoubleRange(1, 0);
|
||||
|
||||
private final double start;
|
||||
@@ -56,7 +56,7 @@ public final class DoubleRange implements Range<Double>, NumberSequence<Double>
|
||||
|
||||
@Override
|
||||
public DoubleIterator iterator() {
|
||||
return new DoubleSequenceIterator(start, end, 1.0);
|
||||
return new DoubleProgressionIterator(start, end, 1.0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,12 +19,12 @@ package jet;
|
||||
import org.jetbrains.jet.rt.annotation.AssertInvisibleInResolver;
|
||||
|
||||
@AssertInvisibleInResolver
|
||||
public class FloatSequence implements NumberSequence<Float> {
|
||||
public class FloatProgression implements Progression<Float> {
|
||||
private final float start;
|
||||
private final float end;
|
||||
private final float increment;
|
||||
|
||||
public FloatSequence(float start, float end, float increment) {
|
||||
public FloatProgression(float start, float end, float increment) {
|
||||
if (increment == 0.0f || increment == -0.0f) {
|
||||
throw new IllegalArgumentException("Increment must be non-zero: " + increment);
|
||||
}
|
||||
@@ -50,7 +50,7 @@ public class FloatSequence implements NumberSequence<Float> {
|
||||
|
||||
@Override
|
||||
public FloatIterator iterator() {
|
||||
return new FloatSequenceIterator(start, end, increment);
|
||||
return new FloatProgressionIterator(start, end, increment);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -68,7 +68,7 @@ public class FloatSequence implements NumberSequence<Float> {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
FloatSequence floats = (FloatSequence) o;
|
||||
FloatProgression floats = (FloatProgression) o;
|
||||
|
||||
if (Float.compare(floats.end, end) != 0) return false;
|
||||
if (Float.compare(floats.increment, increment) != 0) return false;
|
||||
+2
-2
@@ -16,12 +16,12 @@
|
||||
|
||||
package jet;
|
||||
|
||||
class FloatSequenceIterator extends FloatIterator {
|
||||
class FloatProgressionIterator extends FloatIterator {
|
||||
private float next;
|
||||
private final float end;
|
||||
private final float increment;
|
||||
|
||||
public FloatSequenceIterator(float start, float end, float increment) {
|
||||
public FloatProgressionIterator(float start, float end, float increment) {
|
||||
this.next = start;
|
||||
this.end = end;
|
||||
this.increment = increment;
|
||||
@@ -19,7 +19,7 @@ package jet;
|
||||
import org.jetbrains.jet.rt.annotation.AssertInvisibleInResolver;
|
||||
|
||||
@AssertInvisibleInResolver
|
||||
public final class FloatRange implements Range<Float>, NumberSequence<Float> {
|
||||
public final class FloatRange implements Range<Float>, Progression<Float> {
|
||||
public static final FloatRange EMPTY = new FloatRange(1, 0);
|
||||
|
||||
private final float start;
|
||||
@@ -56,7 +56,7 @@ public final class FloatRange implements Range<Float>, NumberSequence<Float> {
|
||||
|
||||
@Override
|
||||
public FloatIterator iterator() {
|
||||
return new FloatSequenceIterator(start, end, 1);
|
||||
return new FloatProgressionIterator(start, end, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,12 +19,12 @@ package jet;
|
||||
import org.jetbrains.jet.rt.annotation.AssertInvisibleInResolver;
|
||||
|
||||
@AssertInvisibleInResolver
|
||||
public class IntSequence implements NumberSequence<Integer> {
|
||||
public class IntProgression implements Progression<Integer> {
|
||||
private final int start;
|
||||
private final int end;
|
||||
private final int increment;
|
||||
|
||||
public IntSequence(int start, int end, int increment) {
|
||||
public IntProgression(int start, int end, int increment) {
|
||||
if (increment == 0) {
|
||||
throw new IllegalArgumentException("Increment must be non-zero: " + increment);
|
||||
}
|
||||
@@ -50,7 +50,7 @@ public class IntSequence implements NumberSequence<Integer> {
|
||||
|
||||
@Override
|
||||
public IntIterator iterator() {
|
||||
return new IntSequenceIterator(start, end, increment);
|
||||
return new IntProgressionIterator(start, end, increment);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -68,7 +68,7 @@ public class IntSequence implements NumberSequence<Integer> {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
IntSequence sequence = (IntSequence) o;
|
||||
IntProgression sequence = (IntProgression) o;
|
||||
|
||||
if (end != sequence.end) return false;
|
||||
if (increment != sequence.increment) return false;
|
||||
+2
-2
@@ -16,12 +16,12 @@
|
||||
|
||||
package jet;
|
||||
|
||||
class IntSequenceIterator extends IntIterator {
|
||||
class IntProgressionIterator extends IntIterator {
|
||||
private int next;
|
||||
private final int end;
|
||||
private final int increment;
|
||||
|
||||
public IntSequenceIterator(int start, int end, int increment) {
|
||||
public IntProgressionIterator(int start, int end, int increment) {
|
||||
this.next = start;
|
||||
this.end = end;
|
||||
this.increment = increment;
|
||||
@@ -19,7 +19,7 @@ package jet;
|
||||
import org.jetbrains.jet.rt.annotation.AssertInvisibleInResolver;
|
||||
|
||||
@AssertInvisibleInResolver
|
||||
public final class IntRange implements Range<Integer>, NumberSequence<Integer> {
|
||||
public final class IntRange implements Range<Integer>, Progression<Integer> {
|
||||
public static final IntRange EMPTY = new IntRange(1, 0);
|
||||
|
||||
private final int start;
|
||||
@@ -56,7 +56,7 @@ public final class IntRange implements Range<Integer>, NumberSequence<Integer> {
|
||||
|
||||
@Override
|
||||
public IntIterator iterator() {
|
||||
return new IntSequenceIterator(start, end, 1);
|
||||
return new IntProgressionIterator(start, end, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,12 +19,12 @@ package jet;
|
||||
import org.jetbrains.jet.rt.annotation.AssertInvisibleInResolver;
|
||||
|
||||
@AssertInvisibleInResolver
|
||||
public class LongSequence implements NumberSequence<Long> {
|
||||
public class LongProgression implements Progression<Long> {
|
||||
private final long start;
|
||||
private final long end;
|
||||
private final long increment;
|
||||
|
||||
public LongSequence(long start, long end, long increment) {
|
||||
public LongProgression(long start, long end, long increment) {
|
||||
if (increment == 0) {
|
||||
throw new IllegalArgumentException("Increment must be non-zero: " + increment);
|
||||
}
|
||||
@@ -50,7 +50,7 @@ public class LongSequence implements NumberSequence<Long> {
|
||||
|
||||
@Override
|
||||
public LongIterator iterator() {
|
||||
return new LongSequenceIterator(start, end, increment);
|
||||
return new LongProgressionIterator(start, end, increment);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -68,7 +68,7 @@ public class LongSequence implements NumberSequence<Long> {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
LongSequence longs = (LongSequence) o;
|
||||
LongProgression longs = (LongProgression) o;
|
||||
|
||||
if (end != longs.end) return false;
|
||||
if (increment != longs.increment) return false;
|
||||
+2
-2
@@ -16,12 +16,12 @@
|
||||
|
||||
package jet;
|
||||
|
||||
class LongSequenceIterator extends LongIterator {
|
||||
class LongProgressionIterator extends LongIterator {
|
||||
private long next;
|
||||
private final long end;
|
||||
private final long increment;
|
||||
|
||||
public LongSequenceIterator(long start, long end, long increment) {
|
||||
public LongProgressionIterator(long start, long end, long increment) {
|
||||
this.next = start;
|
||||
this.end = end;
|
||||
this.increment = increment;
|
||||
@@ -19,7 +19,7 @@ package jet;
|
||||
import org.jetbrains.jet.rt.annotation.AssertInvisibleInResolver;
|
||||
|
||||
@AssertInvisibleInResolver
|
||||
public final class LongRange implements Range<Long>, NumberSequence<Long> {
|
||||
public final class LongRange implements Range<Long>, Progression<Long> {
|
||||
public static final LongRange EMPTY = new LongRange(1, 0);
|
||||
|
||||
private final long start;
|
||||
@@ -56,7 +56,7 @@ public final class LongRange implements Range<Long>, NumberSequence<Long> {
|
||||
|
||||
@Override
|
||||
public LongIterator iterator() {
|
||||
return new LongSequenceIterator(start, end, 1);
|
||||
return new LongProgressionIterator(start, end, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,7 +19,7 @@ package jet;
|
||||
import org.jetbrains.jet.rt.annotation.AssertInvisibleInResolver;
|
||||
|
||||
@AssertInvisibleInResolver
|
||||
public interface NumberSequence<N> extends Iterable<N> {
|
||||
public interface Progression<N> extends Iterable<N> {
|
||||
N getStart();
|
||||
N getEnd();
|
||||
Number getIncrement();
|
||||
@@ -19,12 +19,12 @@ package jet;
|
||||
import org.jetbrains.jet.rt.annotation.AssertInvisibleInResolver;
|
||||
|
||||
@AssertInvisibleInResolver
|
||||
public class ShortSequence implements NumberSequence<Short> {
|
||||
public class ShortProgression implements Progression<Short> {
|
||||
private final short start;
|
||||
private final short end;
|
||||
private final int increment;
|
||||
|
||||
public ShortSequence(short start, short end, int increment) {
|
||||
public ShortProgression(short start, short end, int increment) {
|
||||
if (increment == 0) {
|
||||
throw new IllegalArgumentException("Increment must be non-zero: " + increment);
|
||||
}
|
||||
@@ -50,7 +50,7 @@ public class ShortSequence implements NumberSequence<Short> {
|
||||
|
||||
@Override
|
||||
public ShortIterator iterator() {
|
||||
return new ShortSequenceIterator(start, end, increment);
|
||||
return new ShortProgressionIterator(start, end, increment);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -68,7 +68,7 @@ public class ShortSequence implements NumberSequence<Short> {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
ShortSequence shorts = (ShortSequence) o;
|
||||
ShortProgression shorts = (ShortProgression) o;
|
||||
|
||||
if (end != shorts.end) return false;
|
||||
if (increment != shorts.increment) return false;
|
||||
+2
-2
@@ -16,12 +16,12 @@
|
||||
|
||||
package jet;
|
||||
|
||||
class ShortSequenceIterator extends ShortIterator {
|
||||
class ShortProgressionIterator extends ShortIterator {
|
||||
private short next;
|
||||
private final short end;
|
||||
private final int increment;
|
||||
|
||||
public ShortSequenceIterator(short start, short end, int increment) {
|
||||
public ShortProgressionIterator(short start, short end, int increment) {
|
||||
this.next = start;
|
||||
this.end = end;
|
||||
this.increment = increment;
|
||||
@@ -19,7 +19,7 @@ package jet;
|
||||
import org.jetbrains.jet.rt.annotation.AssertInvisibleInResolver;
|
||||
|
||||
@AssertInvisibleInResolver
|
||||
public final class ShortRange implements Range<Short>, NumberSequence<Short> {
|
||||
public final class ShortRange implements Range<Short>, Progression<Short> {
|
||||
public static final ShortRange EMPTY = new ShortRange((short) 1, (short) 0);
|
||||
|
||||
private final short start;
|
||||
@@ -56,7 +56,7 @@ public final class ShortRange implements Range<Short>, NumberSequence<Short> {
|
||||
|
||||
@Override
|
||||
public ShortIterator iterator() {
|
||||
return new ShortSequenceIterator(start, end, 1);
|
||||
return new ShortProgressionIterator(start, end, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user