Dropped unnecessary primitive iterable traits.

This commit is contained in:
Evgeny Gerashchenko
2013-01-25 18:56:54 +04:00
parent 72b8c4b3c8
commit a24bf67688
20 changed files with 36 additions and 302 deletions
@@ -1,5 +1,13 @@
package jet
public trait Iterable<out T> {
public fun iterator() : Iterator<T>
}
public trait MutableIterable<out T> : Iterable<T> {
override fun iterator() : MutableIterator<T>
}
public trait Collection<out E> : Iterable<E>, Hashable {
// Query Operations
public fun size() : Int
-41
View File
@@ -1,41 +0,0 @@
package jet
public trait Iterable<out T> {
public fun iterator() : Iterator<T>
}
public trait MutableIterable<out T> : Iterable<T> {
override fun iterator() : MutableIterator<T>
}
public trait ByteIterable : Iterable<Byte> {
public override fun iterator() : ByteIterator
}
public trait ShortIterable : Iterable<Short> {
public override fun iterator() : ShortIterator
}
public trait IntIterable : Iterable<Int> {
public override fun iterator() : IntIterator
}
public trait LongIterable : Iterable<Long> {
public override fun iterator() : LongIterator
}
public trait FloatIterable : Iterable<Float> {
public override fun iterator() : FloatIterator
}
public trait DoubleIterable : Iterable<Double> {
public override fun iterator() : DoubleIterator
}
public trait BooleanIterable : Iterable<Boolean> {
public override fun iterator() : BooleanIterator
}
public trait CharIterable : Iterable<Char> {
public override fun iterator() : CharIterator
}
+7 -7
View File
@@ -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>, IntIterable {
) : Range<Int>, NumberSequence<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>, LongIterable {
) : Range<Long>, NumberSequence<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>, ByteIterable {
): Range<Byte>, NumberSequence<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>, ShortIterable {
) : Range<Short>, NumberSequence<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>, CharIterable {
) : Range<Char>, NumberSequence<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>, FloatIterable {
) : Range<Float>, NumberSequence<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>, DoubleIterable {
) : Range<Double>, NumberSequence<Double> {
public override fun iterator() : DoubleIterator
@@ -71,7 +71,6 @@ public class KotlinBuiltIns {
BUILT_INS_DIR + "/Library.jet",
BUILT_INS_DIR + "/Numbers.jet",
BUILT_INS_DIR + "/Ranges.jet",
BUILT_INS_DIR + "/Iterables.jet",
BUILT_INS_DIR + "/Iterators.jet",
BUILT_INS_DIR + "/Arrays.jet",
BUILT_INS_DIR + "/Enum.jet",
+14 -46
View File
@@ -50,10 +50,6 @@ public final class BooleanArray {
public final fun set(/*0*/ index : jet.Int, /*1*/ value : jet.Boolean) : Unit
}
public trait BooleanIterable : jet.Iterable<jet.Boolean> {
public abstract override /*1*/ fun iterator() : jet.BooleanIterator
}
public abstract class BooleanIterator : jet.Iterator<jet.Boolean> {
public constructor BooleanIterator()
public abstract override /*1*/ /*fake_override*/ fun hasNext() : jet.Boolean
@@ -136,10 +132,6 @@ public final class ByteArray {
public final fun set(/*0*/ index : jet.Int, /*1*/ value : jet.Byte) : Unit
}
public trait ByteIterable : jet.Iterable<jet.Byte> {
public abstract override /*1*/ fun iterator() : jet.ByteIterator
}
public abstract class ByteIterator : jet.Iterator<jet.Byte> {
public constructor ByteIterator()
public abstract override /*1*/ /*fake_override*/ fun hasNext() : jet.Boolean
@@ -147,13 +139,13 @@ 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>, jet.ByteIterable {
public final class ByteRange : jet.Range<jet.Byte>, jet.NumberSequence<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
public open override /*2*/ val start : jet.Byte
public open override /*1*/ fun contains(/*0*/ elem : jet.Byte) : jet.Boolean
public open override /*2*/ fun iterator() : jet.ByteIterator
public open override /*1*/ fun iterator() : jet.ByteIterator
public class object <class-object-for-ByteRange> {
private constructor <class-object-for-ByteRange>()
@@ -234,10 +226,6 @@ public final class CharArray {
public final fun set(/*0*/ index : jet.Int, /*1*/ value : jet.Char) : Unit
}
public trait CharIterable : jet.Iterable<jet.Char> {
public abstract override /*1*/ fun iterator() : jet.CharIterator
}
public abstract class CharIterator : jet.Iterator<jet.Char> {
public constructor CharIterator()
public abstract override /*1*/ /*fake_override*/ fun hasNext() : jet.Boolean
@@ -245,13 +233,13 @@ 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>, jet.CharIterable {
public final class CharRange : jet.Range<jet.Char>, jet.NumberSequence<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
public open override /*2*/ val start : jet.Char
public open override /*1*/ fun contains(/*0*/ elem : jet.Char) : jet.Boolean
public open override /*2*/ fun iterator() : jet.CharIterator
public open override /*1*/ fun iterator() : jet.CharIterator
public class object <class-object-for-CharRange> {
private constructor <class-object-for-CharRange>()
@@ -363,10 +351,6 @@ public final class DoubleArray {
public final fun set(/*0*/ index : jet.Int, /*1*/ value : jet.Double) : Unit
}
public trait DoubleIterable : jet.Iterable<jet.Double> {
public abstract override /*1*/ fun iterator() : jet.DoubleIterator
}
public abstract class DoubleIterator : jet.Iterator<jet.Double> {
public constructor DoubleIterator()
public abstract override /*1*/ /*fake_override*/ fun hasNext() : jet.Boolean
@@ -374,13 +358,13 @@ 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>, jet.DoubleIterable {
public final class DoubleRange : jet.Range<jet.Double>, jet.NumberSequence<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
public open override /*2*/ val start : jet.Double
public open override /*1*/ fun contains(/*0*/ elem : jet.Double) : jet.Boolean
public open override /*2*/ fun iterator() : jet.DoubleIterator
public open override /*1*/ fun iterator() : jet.DoubleIterator
public class object <class-object-for-DoubleRange> {
private constructor <class-object-for-DoubleRange>()
@@ -592,10 +576,6 @@ public final class FloatArray {
public final fun set(/*0*/ index : jet.Int, /*1*/ value : jet.Float) : Unit
}
public trait FloatIterable : jet.Iterable<jet.Float> {
public abstract override /*1*/ fun iterator() : jet.FloatIterator
}
public abstract class FloatIterator : jet.Iterator<jet.Float> {
public constructor FloatIterator()
public abstract override /*1*/ /*fake_override*/ fun hasNext() : jet.Boolean
@@ -603,13 +583,13 @@ 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>, jet.FloatIterable {
public final class FloatRange : jet.Range<jet.Float>, jet.NumberSequence<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
public open override /*2*/ val start : jet.Float
public open override /*1*/ fun contains(/*0*/ elem : jet.Float) : jet.Boolean
public open override /*2*/ fun iterator() : jet.FloatIterator
public open override /*1*/ fun iterator() : jet.FloatIterator
public class object <class-object-for-FloatRange> {
private constructor <class-object-for-FloatRange>()
@@ -827,10 +807,6 @@ public final class IntArray {
public final fun set(/*0*/ index : jet.Int, /*1*/ value : jet.Int) : Unit
}
public trait IntIterable : jet.Iterable<jet.Int> {
public abstract override /*1*/ fun iterator() : jet.IntIterator
}
public abstract class IntIterator : jet.Iterator<jet.Int> {
public constructor IntIterator()
public abstract override /*1*/ /*fake_override*/ fun hasNext() : jet.Boolean
@@ -838,13 +814,13 @@ 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>, jet.IntIterable {
public final class IntRange : jet.Range<jet.Int>, jet.NumberSequence<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
public open override /*2*/ val start : jet.Int
public open override /*1*/ fun contains(/*0*/ elem : jet.Int) : jet.Boolean
public open override /*2*/ fun iterator() : jet.IntIterator
public open override /*1*/ fun iterator() : jet.IntIterator
public class object <class-object-for-IntRange> {
private constructor <class-object-for-IntRange>()
@@ -978,10 +954,6 @@ public final class LongArray {
public final fun set(/*0*/ index : jet.Int, /*1*/ value : jet.Long) : Unit
}
public trait LongIterable : jet.Iterable<jet.Long> {
public abstract override /*1*/ fun iterator() : jet.LongIterator
}
public abstract class LongIterator : jet.Iterator<jet.Long> {
public constructor LongIterator()
public abstract override /*1*/ /*fake_override*/ fun hasNext() : jet.Boolean
@@ -989,13 +961,13 @@ 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>, jet.LongIterable {
public final class LongRange : jet.Range<jet.Long>, jet.NumberSequence<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
public open override /*2*/ val start : jet.Long
public open override /*1*/ fun contains(/*0*/ elem : jet.Long) : jet.Boolean
public open override /*2*/ fun iterator() : jet.LongIterator
public open override /*1*/ fun iterator() : jet.LongIterator
public class object <class-object-for-LongRange> {
private constructor <class-object-for-LongRange>()
@@ -1255,10 +1227,6 @@ public final class ShortArray {
public final fun set(/*0*/ index : jet.Int, /*1*/ value : jet.Short) : Unit
}
public trait ShortIterable : jet.Iterable<jet.Short> {
public abstract override /*1*/ fun iterator() : jet.ShortIterator
}
public abstract class ShortIterator : jet.Iterator<jet.Short> {
public constructor ShortIterator()
public abstract override /*1*/ /*fake_override*/ fun hasNext() : jet.Boolean
@@ -1266,13 +1234,13 @@ 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>, jet.ShortIterable {
public final class ShortRange : jet.Range<jet.Short>, jet.NumberSequence<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
public open override /*2*/ val start : jet.Short
public open override /*1*/ fun contains(/*0*/ elem : jet.Short) : jet.Boolean
public open override /*2*/ fun iterator() : jet.ShortIterator
public open override /*1*/ fun iterator() : jet.ShortIterator
public class object <class-object-for-ShortRange> {
private constructor <class-object-for-ShortRange>()
-25
View File
@@ -1,25 +0,0 @@
/*
* Copyright 2010-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package jet;
import org.jetbrains.jet.rt.annotation.AssertInvisibleInResolver;
@AssertInvisibleInResolver
public interface BooleanIterable extends Iterable<Boolean> {
@Override
BooleanIterator iterator();
}
-25
View File
@@ -1,25 +0,0 @@
/*
* Copyright 2010-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package jet;
import org.jetbrains.jet.rt.annotation.AssertInvisibleInResolver;
@AssertInvisibleInResolver
public interface ByteIterable extends Iterable<Byte> {
@Override
ByteIterator iterator();
}
+1 -1
View File
@@ -19,7 +19,7 @@ package jet;
import org.jetbrains.jet.rt.annotation.AssertInvisibleInResolver;
@AssertInvisibleInResolver
public final class ByteRange implements Range<Byte>, NumberSequence<Byte>, ByteIterable {
public final class ByteRange implements Range<Byte>, NumberSequence<Byte> {
public static final ByteRange EMPTY = new ByteRange((byte) 1, (byte) 0);
private final byte start;
-25
View File
@@ -1,25 +0,0 @@
/*
* Copyright 2010-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package jet;
import org.jetbrains.jet.rt.annotation.AssertInvisibleInResolver;
@AssertInvisibleInResolver
public interface CharIterable extends Iterable<Character> {
@Override
CharIterator iterator();
}
+1 -1
View File
@@ -19,7 +19,7 @@ package jet;
import org.jetbrains.jet.rt.annotation.AssertInvisibleInResolver;
@AssertInvisibleInResolver
public final class CharRange implements Range<Character>, NumberSequence<Character>, CharIterable {
public final class CharRange implements Range<Character>, NumberSequence<Character> {
public static final CharRange EMPTY = new CharRange((char) 1, (char) 0);
private final char start;
-25
View File
@@ -1,25 +0,0 @@
/*
* Copyright 2010-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package jet;
import org.jetbrains.jet.rt.annotation.AssertInvisibleInResolver;
@AssertInvisibleInResolver
public interface DoubleIterable extends Iterable<Double> {
@Override
DoubleIterator iterator();
}
+1 -1
View File
@@ -19,7 +19,7 @@ package jet;
import org.jetbrains.jet.rt.annotation.AssertInvisibleInResolver;
@AssertInvisibleInResolver
public final class DoubleRange implements Range<Double>, NumberSequence<Double>, DoubleIterable {
public final class DoubleRange implements Range<Double>, NumberSequence<Double> {
public static final DoubleRange EMPTY = new DoubleRange(1, 0);
private final double start;
-25
View File
@@ -1,25 +0,0 @@
/*
* Copyright 2010-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package jet;
import org.jetbrains.jet.rt.annotation.AssertInvisibleInResolver;
@AssertInvisibleInResolver
public interface FloatIterable extends Iterable<Float> {
@Override
FloatIterator iterator();
}
+1 -1
View File
@@ -19,7 +19,7 @@ package jet;
import org.jetbrains.jet.rt.annotation.AssertInvisibleInResolver;
@AssertInvisibleInResolver
public final class FloatRange implements Range<Float>, NumberSequence<Float>, FloatIterable {
public final class FloatRange implements Range<Float>, NumberSequence<Float> {
public static final FloatRange EMPTY = new FloatRange(1, 0);
private final float start;
-25
View File
@@ -1,25 +0,0 @@
/*
* Copyright 2010-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package jet;
import org.jetbrains.jet.rt.annotation.AssertInvisibleInResolver;
@AssertInvisibleInResolver
public interface IntIterable extends Iterable<Integer> {
@Override
IntIterator iterator();
}
+1 -1
View File
@@ -19,7 +19,7 @@ package jet;
import org.jetbrains.jet.rt.annotation.AssertInvisibleInResolver;
@AssertInvisibleInResolver
public final class IntRange implements Range<Integer>, NumberSequence<Integer>, IntIterable {
public final class IntRange implements Range<Integer>, NumberSequence<Integer> {
public static final IntRange EMPTY = new IntRange(1, 0);
private final int start;
-25
View File
@@ -1,25 +0,0 @@
/*
* Copyright 2010-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package jet;
import org.jetbrains.jet.rt.annotation.AssertInvisibleInResolver;
@AssertInvisibleInResolver
public interface LongIterable extends Iterable<Long> {
@Override
LongIterator iterator();
}
+1 -1
View File
@@ -19,7 +19,7 @@ package jet;
import org.jetbrains.jet.rt.annotation.AssertInvisibleInResolver;
@AssertInvisibleInResolver
public final class LongRange implements Range<Long>, NumberSequence<Long>, LongIterable {
public final class LongRange implements Range<Long>, NumberSequence<Long> {
public static final LongRange EMPTY = new LongRange(1, 0);
private final long start;
-25
View File
@@ -1,25 +0,0 @@
/*
* Copyright 2010-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package jet;
import org.jetbrains.jet.rt.annotation.AssertInvisibleInResolver;
@AssertInvisibleInResolver
public interface ShortIterable extends Iterable<Short> {
@Override
ShortIterator iterator();
}
+1 -1
View File
@@ -19,7 +19,7 @@ package jet;
import org.jetbrains.jet.rt.annotation.AssertInvisibleInResolver;
@AssertInvisibleInResolver
public final class ShortRange implements Range<Short>, NumberSequence<Short>, ShortIterable {
public final class ShortRange implements Range<Short>, NumberSequence<Short> {
public static final ShortRange EMPTY = new ShortRange((short) 1, (short) 0);
private final short start;