Remove duplicated sources of built-ins

BuiltInsSerializer now serializes built-ins found in two source roots:
core/builtins/native and core/builtins/src

Add return types to some declarations in core/builtins/src, because now that
BuiltInsSerializer processes them, it launches lazy resolution which can't
always deduce the return type
This commit is contained in:
Alexander Udalov
2014-01-16 23:19:43 +04:00
parent 3b4c341046
commit 61ad9fba4a
232 changed files with 156 additions and 648 deletions
+3
View File
@@ -0,0 +1,3 @@
package jet
public open class Any() {}
+84
View File
@@ -0,0 +1,84 @@
package jet
public fun arrayOfNulls<T>(size : Int) : Array<T?>
public class Array<reified T>(public val size : Int, init : (Int) -> T) {
public fun get(index : Int) : T
public fun set(index : Int, value : T) : Unit
public fun iterator() : Iterator<T>
public val indices : IntRange
}
public class ByteArray(public val size : Int) {
public fun get(index : Int) : Byte
public fun set(index : Int, value : Byte) : Unit
public fun iterator() : ByteIterator
public val indices : IntRange
}
public class ShortArray(public val size : Int) {
public fun get(index : Int) : Short
public fun set(index : Int, value : Short) : Unit
public fun iterator() : ShortIterator
public val indices : IntRange
}
public class IntArray(public val size : Int) {
public fun get(index : Int) : Int
public fun set(index : Int, value : Int) : Unit
public fun iterator() : IntIterator
public val indices : IntRange
}
public class LongArray(public val size : Int) {
public fun get(index : Int) : Long
public fun set(index : Int, value : Long) : Unit
public fun iterator() : LongIterator
public val indices : IntRange
}
public class FloatArray(public val size : Int) {
public fun get(index : Int) : Float
public fun set(index : Int, value : Float) : Unit
public fun iterator() : FloatIterator
public val indices : IntRange
}
public class DoubleArray(public val size : Int) {
public fun get(index : Int) : Double
public fun set(index : Int, value : Double) : Unit
public fun iterator() : DoubleIterator
public val indices : IntRange
}
public class CharArray(public val size : Int) {
public fun get(index : Int) : Char
public fun set(index : Int, value : Char) : Unit
public fun iterator() : CharIterator
public val indices : IntRange
}
public class BooleanArray(public val size : Int) {
public fun get(index : Int) : Boolean
public fun set(index : Int, value : Boolean) : Unit
public fun iterator() : BooleanIterator
public val indices : IntRange
}
+69
View File
@@ -0,0 +1,69 @@
package jet
public class Char private () : Hashable, Comparable<Char> {
public fun compareTo(other : Double) : Int
public fun compareTo(other : Float) : Int
public fun compareTo(other : Long) : Int
public fun compareTo(other : Int) : Int
public fun compareTo(other : Short) : Int
public override fun compareTo(other : Char) : Int
public fun compareTo(other : Byte) : Int
public fun plus(other : Double) : Double
public fun plus(other : Float) : Float
public fun plus(other : Long) : Long
public fun plus(other : Int) : Int
public fun plus(other : Short) : Int
public fun plus(other : Byte) : Int
// public fun plus(other : Char) : Int
public fun minus(other : Double) : Double
public fun minus(other : Float) : Float
public fun minus(other : Long) : Long
public fun minus(other : Int) : Int
public fun minus(other : Short) : Int
public fun minus(other : Byte) : Int
public fun minus(other : Char) : Int
public fun times(other : Double) : Double
public fun times(other : Float) : Float
public fun times(other : Long) : Long
public fun times(other : Int) : Int
public fun times(other : Short) : Int
public fun times(other : Byte) : Int
// public fun times(other : Char) : Int
public fun div(other : Double) : Double
public fun div(other : Float) : Float
public fun div(other : Long) : Long
public fun div(other : Int) : Int
public fun div(other : Short) : Int
public fun div(other : Byte) : Int
// public fun div(other : Char) : Int
public fun mod(other : Double) : Double
public fun mod(other : Float) : Float
public fun mod(other : Long) : Long
public fun mod(other : Int) : Int
public fun mod(other : Short) : Int
public fun mod(other : Byte) : Int
// public fun mod(other : Char) : Int
public fun rangeTo(other : Char) : CharRange
public fun inc() : Char
public fun dec() : Char
public fun plus() : Int
public fun minus() : Int
public fun toDouble() : Double
public fun toFloat() : Float
public fun toLong() : Long
public fun toInt() : Int
public fun toChar() : Char
public fun toShort() : Short
public fun toByte() : Byte
public override fun hashCode() : Int
public override fun equals(other : Any?) : Boolean
}
+149
View File
@@ -0,0 +1,149 @@
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
public fun isEmpty() : Boolean
public fun contains(o : Any?) : Boolean
override fun iterator() : Iterator<E>
// Bulk Operations
public fun containsAll(c : Collection<Any?>) : Boolean
}
public trait MutableCollection<E> : Collection<E>, MutableIterable<E> {
// Query Operations
override fun iterator() : MutableIterator<E>
// Modification Operations
public fun add(e : E) : Boolean
public fun remove(o : Any?) : Boolean
// Bulk Modification Operations
public fun addAll(c : Collection<E>) : Boolean
public fun removeAll(c : Collection<Any?>) : Boolean
public fun retainAll(c : Collection<Any?>) : Boolean
public fun clear()
}
public trait List<out E> : Collection<E> {
// Query Operations
override fun size() : Int
override fun isEmpty() : Boolean
override fun contains(o : Any?) : Boolean
override fun iterator() : Iterator<E>
// Bulk Operations
override fun containsAll(c : Collection<Any?>) : Boolean
// Positional Access Operations
public fun get(index : Int) : E
// Search Operations
public fun indexOf(o : Any?) : Int
public fun lastIndexOf(o : Any?) : Int
// List Iterators
public fun listIterator() : ListIterator<E>
public fun listIterator(index : Int) : ListIterator<E>
// View
public fun subList(fromIndex : Int, toIndex : Int) : List<E>
}
public trait MutableList<E> : List<E>, MutableCollection<E> {
// Modification Operations
override fun add(e: E) : Boolean
override fun remove(o : Any?) : Boolean
// Bulk Modification Operations
override fun addAll(c : Collection<E>) : Boolean
public fun addAll(index : Int, c : Collection<E>) : Boolean
override fun removeAll(c : Collection<Any?>) : Boolean
override fun retainAll(c : Collection<Any?>) : Boolean
override fun clear()
// Positional Access Operations
public fun set(index : Int, element : E) : E
public fun add(index : Int, element : E)
public fun remove(index : Int) : E
// List Iterators
override fun listIterator() : MutableListIterator<E>
override fun listIterator(index : Int) : MutableListIterator<E>
// View
override fun subList(fromIndex : Int, toIndex : Int) : MutableList<E>
}
public trait Set<out E> : Collection<E> {
// Query Operations
override fun size() : Int
override fun isEmpty() : Boolean
override fun contains(o : Any?) : Boolean
override fun iterator() : Iterator<E>
// Bulk Operations
override fun containsAll(c : Collection<Any?>) : Boolean
}
public trait MutableSet<E> : Set<E>, MutableCollection<E> {
// Query Operations
override fun iterator() : MutableIterator<E>
// Modification Operations
override fun add(e: E) : Boolean
override fun remove(o : Any?) : Boolean
// Bulk Modification Operations
override fun addAll(c : Collection<E>) : Boolean
override fun removeAll(c : Collection<Any?>) : Boolean
override fun retainAll(c : Collection<Any?>) : Boolean
override fun clear()
}
public trait Map<K, out V> {
// Query Operations
public fun size() : Int
public fun isEmpty() : Boolean
public fun containsKey(key : Any?) : Boolean
public fun containsValue(value : Any?) : Boolean
public fun get(key : Any?) : V?
// Views
public fun keySet() : Set<K>
public fun values() : Collection<V>
public fun entrySet() : Set<Map.Entry<K, V>>
public trait Entry<out K, out V> : Hashable {
public fun getKey() : K
public fun getValue() : V
}
}
public trait MutableMap<K, V> : Map<K, V> {
// Modification Operations
public fun put(key : K, value : V) : V?
public fun remove(key : Any?) : V?
// Bulk Modification Operations
public fun putAll(m : Map<out K, V>)
public fun clear()
// Views
override fun keySet() : MutableSet<K>
override fun values() : MutableCollection<V>
override fun entrySet() : MutableSet<MutableMap.MutableEntry<K, V>>
public trait MutableEntry<K,V> : Map.Entry<K, V>, Hashable {
public fun setValue(value : V) : V
}
}
+6
View File
@@ -0,0 +1,6 @@
package jet
public abstract class Enum<E: Enum<E>>(name: String, ordinal: Int) {
public final fun name() : String
public final fun ordinal() : Int
}
+34
View File
@@ -0,0 +1,34 @@
package jet
public trait Iterator<out T> {
public fun next(): T
public fun hasNext(): Boolean
}
public trait MutableIterator<out T> : Iterator<T> {
public fun remove(): Unit
}
public fun <T> Iterator<T>.iterator(): Iterator<T>
public trait ListIterator<out T> : Iterator<T> {
// Query Operations
override fun next(): T
override fun hasNext(): Boolean
public fun hasPrevious(): Boolean
public fun previous(): T
public fun nextIndex(): Int
public fun previousIndex(): Int
}
public trait MutableListIterator<T> : ListIterator<T>, MutableIterator<T> {
// Query Operations
override fun next(): T
override fun hasNext(): Boolean
// Modification Operations
override fun remove(): Unit
public fun set(e: T): Unit
public fun add(e: T): Unit
}
+65
View File
@@ -0,0 +1,65 @@
package jet
public trait Annotation
public annotation class volatile
public fun <R> synchronized(lock: Any, block : () -> R) : R
public fun Any?.identityEquals(other : Any?) : Boolean // = this === other
// Can't write a body due to a bootstrapping problem (see JET-74)
public fun Any?.equals(other : Any?) : Boolean// = this === other
// Returns "null" for null
public fun Any?.toString() : String// = this === other
public fun String?.plus(other: Any?) : String
public trait Comparable<in T> {
public fun compareTo(other : T) : Int
}
public trait Hashable {
public fun hashCode() : Int
public fun equals(other : Any?) : Boolean
}
public class Boolean private () : Comparable<Boolean> {
public fun not() : Boolean
public fun and(other : Boolean) : Boolean
public fun or(other : Boolean) : Boolean
public fun xor(other : Boolean) : Boolean
public override fun compareTo(other : Boolean) : Int
public fun equals(other : Any?) : Boolean
}
public trait CharSequence {
public fun get(index : Int) : Char
public val length : Int
public fun toString() : String
}
public class String() : Comparable<String>, CharSequence {
public fun plus(other : Any?) : String
public fun equals(other : Any?) : Boolean
public override fun compareTo(that : String) : Int
public override fun get(index : Int) : Char
public override fun toString() : String
public override val length: Int
}
public open class Throwable(message : String? = null, cause: Throwable? = null) {
public fun getMessage() : String?
public fun getCause() : Throwable?
public fun printStackTrace() : Unit
}
+6
View File
@@ -0,0 +1,6 @@
package jet
/**
* Nothing has no instances
*/
public class Nothing private () {}
+477
View File
@@ -0,0 +1,477 @@
package jet
public abstract class Number : Hashable {
public abstract fun toDouble() : Double
public abstract fun toFloat() : Float
public abstract fun toLong() : Long
public abstract fun toInt() : Int
public abstract fun toChar() : Char
public abstract fun toShort() : Short
public abstract fun toByte() : Byte
// fun equals(other : Double) : Boolean
// fun equals(other : Float) : Boolean
// fun equals(other : Long) : Boolean
// fun equals(other : Byte) : Boolean
// fun equals(other : Int) : Boolean
// fun equals(other : Short) : Boolean
// fun equals(other : Char) : Boolean
}
public class Double private () : Number, Comparable<Double> {
public override fun compareTo(other : Double) : Int
public fun compareTo(other : Float) : Int
public fun compareTo(other : Long) : Int
public fun compareTo(other : Int) : Int
public fun compareTo(other : Short) : Int
public fun compareTo(other : Byte) : Int
public fun compareTo(other : Char) : Int
public fun plus(other : Double) : Double
public fun plus(other : Float) : Double
public fun plus(other : Long) : Double
public fun plus(other : Int) : Double
public fun plus(other : Short) : Double
public fun plus(other : Byte) : Double
public fun plus(other : Char) : Double
public fun minus(other : Double) : Double
public fun minus(other : Float) : Double
public fun minus(other : Long) : Double
public fun minus(other : Int) : Double
public fun minus(other : Short) : Double
public fun minus(other : Byte) : Double
public fun minus(other : Char) : Double
public fun times(other : Double) : Double
public fun times(other : Float) : Double
public fun times(other : Long) : Double
public fun times(other : Int) : Double
public fun times(other : Short) : Double
public fun times(other : Byte) : Double
public fun times(other : Char) : Double
public fun div(other : Double) : Double
public fun div(other : Float) : Double
public fun div(other : Long) : Double
public fun div(other : Int) : Double
public fun div(other : Short) : Double
public fun div(other : Byte) : Double
public fun div(other : Char) : Double
public fun mod(other : Double) : Double
public fun mod(other : Float) : Double
public fun mod(other : Long) : Double
public fun mod(other : Int) : Double
public fun mod(other : Short) : Double
public fun mod(other : Byte) : Double
public fun rangeTo(other : Double) : DoubleRange
public fun rangeTo(other : Float) : DoubleRange
public fun rangeTo(other : Long) : DoubleRange
public fun rangeTo(other : Int) : DoubleRange
public fun rangeTo(other : Short) : DoubleRange
public fun rangeTo(other : Byte) : DoubleRange
public fun rangeTo(other : Char) : DoubleRange
public fun inc() : Double
public fun dec() : Double
public fun plus() : Double
public fun minus() : Double
public override fun toDouble() : Double
public override fun toFloat() : Float
public override fun toLong() : Long
public override fun toInt() : Int
public override fun toChar() : Char
public override fun toShort() : Short
public override fun toByte() : Byte
public override fun hashCode() : Int
public override fun equals(other : Any?) : Boolean
}
public class Float private () : Number, Comparable<Float> {
public fun compareTo(other : Double) : Int
public override fun compareTo(other : Float) : Int
public fun compareTo(other : Long) : Int
public fun compareTo(other : Int) : Int
public fun compareTo(other : Short) : Int
public fun compareTo(other : Byte) : Int
public fun compareTo(other : Char) : Int
public fun plus(other : Double) : Double
public fun plus(other : Float) : Float
public fun plus(other : Long) : Float
public fun plus(other : Int) : Float
public fun plus(other : Short) : Float
public fun plus(other : Byte) : Float
public fun plus(other : Char) : Float
public fun minus(other : Double) : Double
public fun minus(other : Float) : Float
public fun minus(other : Long) : Float
public fun minus(other : Int) : Float
public fun minus(other : Short) : Float
public fun minus(other : Byte) : Float
public fun minus(other : Char) : Float
public fun times(other : Double) : Double
public fun times(other : Float) : Float
public fun times(other : Long) : Float
public fun times(other : Int) : Float
public fun times(other : Short) : Float
public fun times(other : Byte) : Float
public fun times(other : Char) : Float
public fun div(other : Double) : Double
public fun div(other : Float) : Float
public fun div(other : Long) : Float
public fun div(other : Int) : Float
public fun div(other : Short) : Float
public fun div(other : Byte) : Float
public fun div(other : Char) : Float
public fun mod(other : Double) : Double
public fun mod(other : Float) : Float
public fun mod(other : Long) : Float
public fun mod(other : Int) : Float
public fun mod(other : Short) : Float
public fun mod(other : Byte) : Float
public fun mod(other : Char) : Float
public fun rangeTo(other : Double) : DoubleRange
public fun rangeTo(other : Float) : FloatRange
public fun rangeTo(other : Long) : DoubleRange
public fun rangeTo(other : Int) : FloatRange
public fun rangeTo(other : Short) : FloatRange
public fun rangeTo(other : Byte) : FloatRange
public fun rangeTo(other : Char) : FloatRange
public fun inc() : Float
public fun dec() : Float
public fun plus() : Float
public fun minus() : Float
public override fun toDouble() : Double
public override fun toFloat() : Float
public override fun toLong() : Long
public override fun toInt() : Int
public override fun toChar() : Char
public override fun toShort() : Short
public override fun toByte() : Byte
public override fun hashCode() : Int
public override fun equals(other : Any?) : Boolean
}
public class Long private () : Number, Comparable<Long> {
public fun compareTo(other : Double) : Int
public fun compareTo(other : Float) : Int
public override fun compareTo(other : Long) : Int
public fun compareTo(other : Int) : Int
public fun compareTo(other : Short) : Int
public fun compareTo(other : Byte) : Int
public fun compareTo(other : Char) : Int
public fun plus(other : Double) : Double
public fun plus(other : Float) : Float
public fun plus(other : Long) : Long
public fun plus(other : Int) : Long
public fun plus(other : Short) : Long
public fun plus(other : Byte) : Long
public fun plus(other : Char) : Long
public fun minus(other : Double) : Double
public fun minus(other : Float) : Float
public fun minus(other : Long) : Long
public fun minus(other : Int) : Long
public fun minus(other : Short) : Long
public fun minus(other : Byte) : Long
public fun minus(other : Char) : Long
public fun times(other : Double) : Double
public fun times(other : Float) : Float
public fun times(other : Long) : Long
public fun times(other : Int) : Long
public fun times(other : Short) : Long
public fun times(other : Byte) : Long
public fun times(other : Char) : Long
public fun div(other : Double) : Double
public fun div(other : Float) : Float
public fun div(other : Long) : Long
public fun div(other : Int) : Long
public fun div(other : Short) : Long
public fun div(other : Byte) : Long
public fun div(other : Char) : Long
public fun mod(other : Double) : Double
public fun mod(other : Float) : Float
public fun mod(other : Long) : Long
public fun mod(other : Int) : Long
public fun mod(other : Short) : Long
public fun mod(other : Byte) : Long
public fun mod(other : Char) : Long
public fun rangeTo(other : Double) : DoubleRange
public fun rangeTo(other : Float) : FloatRange
public fun rangeTo(other : Long) : LongRange
public fun rangeTo(other : Int) : LongRange
public fun rangeTo(other : Short) : LongRange
public fun rangeTo(other : Byte) : LongRange
public fun rangeTo(other : Char) : LongRange
public fun inc() : Long
public fun dec() : Long
public fun plus() : Long
public fun minus() : Long
public fun shl(bits : Int) : Long
public fun shr(bits : Int) : Long
public fun ushr(bits : Int) : Long
public fun and(other : Long) : Long
public fun or(other : Long) : Long
public fun xor(other : Long) : Long
public fun inv() : Long
public override fun toDouble() : Double
public override fun toFloat() : Float
public override fun toLong() : Long
public override fun toInt() : Int
public override fun toChar() : Char
public override fun toShort() : Short
public override fun toByte() : Byte
public override fun hashCode() : Int
public override fun equals(other : Any?) : Boolean
}
public class Int private () : Number, Comparable<Int> {
public fun compareTo(other : Double) : Int
public fun compareTo(other : Float) : Int
public fun compareTo(other : Long) : Int
public override fun compareTo(other : Int) : Int
public fun compareTo(other : Short) : Int
public fun compareTo(other : Byte) : Int
public fun compareTo(other : Char) : Int
public fun plus(other : Double) : Double
public fun plus(other : Float) : Float
public fun plus(other : Long) : Long
public fun plus(other : Int) : Int
public fun plus(other : Short) : Int
public fun plus(other : Byte) : Int
public fun plus(other : Char) : Int
public fun minus(other : Double) : Double
public fun minus(other : Float) : Float
public fun minus(other : Long) : Long
public fun minus(other : Int) : Int
public fun minus(other : Short) : Int
public fun minus(other : Byte) : Int
public fun minus(other : Char) : Int
public fun times(other : Double) : Double
public fun times(other : Float) : Float
public fun times(other : Long) : Long
public fun times(other : Int) : Int
public fun times(other : Short) : Int
public fun times(other : Byte) : Int
public fun times(other : Char) : Int
public fun div(other : Double) : Double
public fun div(other : Float) : Float
public fun div(other : Long) : Long
public fun div(other : Int) : Int
public fun div(other : Short) : Int
public fun div(other : Byte) : Int
public fun div(other : Char) : Int
public fun mod(other : Double) : Double
public fun mod(other : Float) : Float
public fun mod(other : Long) : Long
public fun mod(other : Int) : Int
public fun mod(other : Short) : Int
public fun mod(other : Byte) : Int
public fun mod(other : Char) : Int
public fun rangeTo(other : Double) : DoubleRange
public fun rangeTo(other : Float) : FloatRange
public fun rangeTo(other : Long) : LongRange
public fun rangeTo(other : Int) : IntRange
public fun rangeTo(other : Short) : IntRange
public fun rangeTo(other : Byte) : IntRange
public fun rangeTo(other : Char) : IntRange
public fun inc() : Int
public fun dec() : Int
public fun plus() : Int
public fun minus() : Int
public fun shl(bits : Int) : Int
public fun shr(bits : Int) : Int
public fun ushr(bits : Int) : Int
public fun and(other : Int) : Int
public fun or(other : Int) : Int
public fun xor(other : Int) : Int
public fun inv() : Int
public override fun toDouble() : Double
public override fun toFloat() : Float
public override fun toLong() : Long
public override fun toInt() : Int
public override fun toChar() : Char
public override fun toShort() : Short
public override fun toByte() : Byte
public override fun hashCode() : Int
public override fun equals(other : Any?) : Boolean
}
public class Short private () : Number, Comparable<Short> {
public fun compareTo(other : Double) : Int
public fun compareTo(other : Float) : Int
public fun compareTo(other : Long) : Int
public fun compareTo(other : Int) : Int
public override fun compareTo(other : Short) : Int
public fun compareTo(other : Byte) : Int
public fun compareTo(other : Char) : Int
public fun plus(other : Double) : Double
public fun plus(other : Float) : Float
public fun plus(other : Long) : Long
public fun plus(other : Int) : Int
public fun plus(other : Short) : Int
public fun plus(other : Byte) : Int
public fun plus(other : Char) : Int
public fun minus(other : Double) : Double
public fun minus(other : Float) : Float
public fun minus(other : Long) : Long
public fun minus(other : Int) : Int
public fun minus(other : Short) : Int
public fun minus(other : Byte) : Int
public fun minus(other : Char) : Int
public fun times(other : Double) : Double
public fun times(other : Float) : Float
public fun times(other : Long) : Long
public fun times(other : Int) : Int
public fun times(other : Short) : Int
public fun times(other : Byte) : Int
public fun times(other : Char) : Int
public fun div(other : Double) : Double
public fun div(other : Float) : Float
public fun div(other : Long) : Long
public fun div(other : Int) : Int
public fun div(other : Short) : Int
public fun div(other : Byte) : Int
public fun div(other : Char) : Int
public fun mod(other : Double) : Double
public fun mod(other : Float) : Float
public fun mod(other : Long) : Long
public fun mod(other : Int) : Int
public fun mod(other : Short) : Int
public fun mod(other : Byte) : Int
public fun mod(other : Char) : Int
public fun rangeTo(other : Double) : DoubleRange
public fun rangeTo(other : Float) : FloatRange
public fun rangeTo(other : Long) : LongRange
public fun rangeTo(other : Int) : IntRange
public fun rangeTo(other : Short) : ShortRange
public fun rangeTo(other : Byte) : ShortRange
public fun rangeTo(other : Char) : ShortRange
public fun inc() : Short
public fun dec() : Short
public fun plus() : Int
public fun minus() : Int
public override fun toDouble() : Double
public override fun toFloat() : Float
public override fun toLong() : Long
public override fun toInt() : Int
public override fun toChar() : Char
public override fun toShort() : Short
public override fun toByte() : Byte
public override fun hashCode() : Int
public override fun equals(other : Any?) : Boolean
}
public class Byte private () : Number, Comparable<Byte> {
public fun compareTo(other : Double) : Int
public fun compareTo(other : Float) : Int
public fun compareTo(other : Long) : Int
public fun compareTo(other : Int) : Int
public fun compareTo(other : Short) : Int
public fun compareTo(other : Char) : Int
public override fun compareTo(other : Byte) : Int
public fun plus(other : Double) : Double
public fun plus(other : Float) : Float
public fun plus(other : Long) : Long
public fun plus(other : Int) : Int
public fun plus(other : Short) : Int
public fun plus(other : Byte) : Int
public fun plus(other : Char) : Int
public fun minus(other : Double) : Double
public fun minus(other : Float) : Float
public fun minus(other : Long) : Long
public fun minus(other : Int) : Int
public fun minus(other : Short) : Int
public fun minus(other : Byte) : Int
public fun minus(other : Char) : Int
public fun times(other : Double) : Double
public fun times(other : Float) : Float
public fun times(other : Long) : Long
public fun times(other : Int) : Int
public fun times(other : Short) : Int
public fun times(other : Byte) : Int
public fun times(other : Char) : Int
public fun div(other : Double) : Double
public fun div(other : Float) : Float
public fun div(other : Long) : Long
public fun div(other : Int) : Int
public fun div(other : Short) : Int
public fun div(other : Byte) : Int
public fun div(other : Char) : Int
public fun mod(other : Double) : Double
public fun mod(other : Float) : Float
public fun mod(other : Long) : Long
public fun mod(other : Int) : Int
public fun mod(other : Short) : Int
public fun mod(other : Byte) : Int
public fun mod(other : Char) : Int
public fun rangeTo(other : Double) : DoubleRange
public fun rangeTo(other : Float) : FloatRange
public fun rangeTo(other : Long) : LongRange
public fun rangeTo(other : Int) : IntRange
public fun rangeTo(other : Short) : ShortRange
public fun rangeTo(other : Byte) : ByteRange
public fun rangeTo(other : Char) : CharRange
public fun inc() : Byte
public fun dec() : Byte
public fun plus() : Int
public fun minus() : Int
public override fun toDouble() : Double
public override fun toFloat() : Float
public override fun toLong() : Long
public override fun toInt() : Int
public override fun toChar() : Char
public override fun toShort() : Short
public override fun toByte() : Byte
public override fun hashCode() : Int
public override fun equals(other : Any?) : Boolean
}
+17 -17
View File
@@ -6,10 +6,10 @@ import jet.runtime.ProgressionUtil
class ByteProgressionIterator(start: Byte, end: Byte, val increment: Int) : ByteIterator() {
private var next = start.toInt()
private val finalElement = ProgressionUtil.getProgressionFinalElement(start.toInt(), end.toInt(), increment).toByte()
private var hasNext = if (increment > 0) start <= end else start >= end
private val finalElement: Byte = ProgressionUtil.getProgressionFinalElement(start.toInt(), end.toInt(), increment).toByte()
private var hasNext: Boolean = if (increment > 0) start <= end else start >= end
override fun hasNext() = hasNext
override fun hasNext(): Boolean = hasNext
override fun nextByte(): Byte {
val value = next
@@ -25,10 +25,10 @@ class ByteProgressionIterator(start: Byte, end: Byte, val increment: Int) : Byte
class CharProgressionIterator(start: Char, end: Char, val increment: Int) : CharIterator() {
private var next = start.toInt()
private val finalElement = ProgressionUtil.getProgressionFinalElement(start.toInt(), end.toInt(), increment).toChar()
private var hasNext = if (increment > 0) start <= end else start >= end
private val finalElement: Char = ProgressionUtil.getProgressionFinalElement(start.toInt(), end.toInt(), increment).toChar()
private var hasNext: Boolean = if (increment > 0) start <= end else start >= end
override fun hasNext() = hasNext
override fun hasNext(): Boolean = hasNext
override fun nextChar(): Char {
val value = next
@@ -44,10 +44,10 @@ class CharProgressionIterator(start: Char, end: Char, val increment: Int) : Char
class ShortProgressionIterator(start: Short, end: Short, val increment: Int) : ShortIterator() {
private var next = start.toInt()
private val finalElement = ProgressionUtil.getProgressionFinalElement(start.toInt(), end.toInt(), increment).toShort()
private var hasNext = if (increment > 0) start <= end else start >= end
private val finalElement: Short = ProgressionUtil.getProgressionFinalElement(start.toInt(), end.toInt(), increment).toShort()
private var hasNext: Boolean = if (increment > 0) start <= end else start >= end
override fun hasNext() = hasNext
override fun hasNext(): Boolean = hasNext
override fun nextShort(): Short {
val value = next
@@ -63,10 +63,10 @@ class ShortProgressionIterator(start: Short, end: Short, val increment: Int) : S
class IntProgressionIterator(start: Int, end: Int, val increment: Int) : IntIterator() {
private var next = start
private val finalElement = ProgressionUtil.getProgressionFinalElement(start, end, increment)
private var hasNext = if (increment > 0) start <= end else start >= end
private val finalElement: Int = ProgressionUtil.getProgressionFinalElement(start, end, increment)
private var hasNext: Boolean = if (increment > 0) start <= end else start >= end
override fun hasNext() = hasNext
override fun hasNext(): Boolean = hasNext
override fun nextInt(): Int {
val value = next
@@ -82,10 +82,10 @@ class IntProgressionIterator(start: Int, end: Int, val increment: Int) : IntIter
class LongProgressionIterator(start: Long, end: Long, val increment: Long) : LongIterator() {
private var next = start
private val finalElement = ProgressionUtil.getProgressionFinalElement(start, end, increment)
private var hasNext = if (increment > 0) start <= end else start >= end
private val finalElement: Long = ProgressionUtil.getProgressionFinalElement(start, end, increment)
private var hasNext: Boolean = if (increment > 0) start <= end else start >= end
override fun hasNext() = hasNext
override fun hasNext(): Boolean = hasNext
override fun nextLong(): Long {
val value = next
@@ -102,7 +102,7 @@ class LongProgressionIterator(start: Long, end: Long, val increment: Long) : Lon
class FloatProgressionIterator(start: Float, val end: Float, val increment: Float) : FloatIterator() {
private var next = start
override fun hasNext() = if (increment > 0) next <= end else next >= end
override fun hasNext(): Boolean = if (increment > 0) next <= end else next >= end
override fun nextFloat(): Float {
val value = next
@@ -114,7 +114,7 @@ class FloatProgressionIterator(start: Float, val end: Float, val increment: Floa
class DoubleProgressionIterator(start: Double, val end: Double, val increment: Double) : DoubleIterator() {
private var next = start
override fun hasNext() = if (increment > 0) next <= end else next >= end
override fun hasNext(): Boolean = if (increment > 0) next <= end else next >= end
override fun nextDouble(): Double {
val value = next
+13 -13
View File
@@ -16,9 +16,9 @@ public class ByteProgression(
fun equals(other: Any?): Boolean =
other is ByteProgression && start == other.start && end == other.end && increment == other.increment
fun hashCode() = 31 * (31 * start.toInt() + end) + increment
fun hashCode(): Int = 31 * (31 * start.toInt() + end) + increment
fun toString() = if (increment > 0) "$start..$end step $increment" else "$start downTo $end step ${-increment}"
fun toString(): String = if (increment > 0) "$start..$end step $increment" else "$start downTo $end step ${-increment}"
}
public class CharProgression(
@@ -35,9 +35,9 @@ public class CharProgression(
fun equals(other: Any?): Boolean =
other is CharProgression && start == other.start && end == other.end && increment == other.increment
fun hashCode() = 31 * (31 * start.toInt() + end) + increment
fun hashCode(): Int = 31 * (31 * start.toInt() + end) + increment
fun toString() = if (increment > 0) "$start..$end step $increment" else "$start downTo $end step ${-increment}"
fun toString(): String = if (increment > 0) "$start..$end step $increment" else "$start downTo $end step ${-increment}"
}
public class ShortProgression(
@@ -54,9 +54,9 @@ public class ShortProgression(
fun equals(other: Any?): Boolean =
other is ShortProgression && start == other.start && end == other.end && increment == other.increment
fun hashCode() = 31 * (31 * start.toInt() + end) + increment
fun hashCode(): Int = 31 * (31 * start.toInt() + end) + increment
fun toString() = if (increment > 0) "$start..$end step $increment" else "$start downTo $end step ${-increment}"
fun toString(): String = if (increment > 0) "$start..$end step $increment" else "$start downTo $end step ${-increment}"
}
public class IntProgression(
@@ -73,9 +73,9 @@ public class IntProgression(
fun equals(other: Any?): Boolean =
other is IntProgression && start == other.start && end == other.end && increment == other.increment
fun hashCode() = 31 * (31 * start + end) + increment
fun hashCode(): Int = 31 * (31 * start + end) + increment
fun toString() = if (increment > 0) "$start..$end step $increment" else "$start downTo $end step ${-increment}"
fun toString(): String = if (increment > 0) "$start..$end step $increment" else "$start downTo $end step ${-increment}"
}
public class LongProgression(
@@ -92,9 +92,9 @@ public class LongProgression(
fun equals(other: Any?): Boolean =
other is LongProgression && start == other.start && end == other.end && increment == other.increment
fun hashCode() = (31 * (31 * (start xor (start ushr 32)) + (end xor (end ushr 32))) + (increment xor (increment ushr 32))).toInt()
fun hashCode(): Int = (31 * (31 * (start xor (start ushr 32)) + (end xor (end ushr 32))) + (increment xor (increment ushr 32))).toInt()
fun toString() = if (increment > 0) "$start..$end step $increment" else "$start downTo $end step ${-increment}"
fun toString(): String = if (increment > 0) "$start..$end step $increment" else "$start downTo $end step ${-increment}"
}
public class FloatProgression(
@@ -112,9 +112,9 @@ public class FloatProgression(
fun equals(other: Any?): Boolean =
other is FloatProgression && java.lang.Float.compare(start, other.start) == 0 && java.lang.Float.compare(end, other.end) == 0 && java.lang.Float.compare(increment, other.increment) == 0
fun hashCode() = 31 * (31 * java.lang.Float.floatToIntBits(start) + java.lang.Float.floatToIntBits(end)) + java.lang.Float.floatToIntBits(increment)
fun hashCode(): Int = 31 * (31 * java.lang.Float.floatToIntBits(start) + java.lang.Float.floatToIntBits(end)) + java.lang.Float.floatToIntBits(increment)
fun toString() = if (increment > 0) "$start..$end step $increment" else "$start downTo $end step ${-increment}"
fun toString(): String = if (increment > 0) "$start..$end step $increment" else "$start downTo $end step ${-increment}"
}
public class DoubleProgression(
@@ -141,6 +141,6 @@ public class DoubleProgression(
return (31 * result + (temp xor (temp ushr 32))).toInt()
}
fun toString() = if (increment > 0) "$start..$end step $increment" else "$start downTo $end step ${-increment}"
fun toString(): String = if (increment > 0) "$start..$end step $increment" else "$start downTo $end step ${-increment}"
}
+13 -13
View File
@@ -6,14 +6,14 @@ public class ByteRange(public override val start: Byte, public override val end:
override val increment: Int
get() = 1
override fun contains(item: Byte) = start <= item && item <= end
override fun contains(item: Byte): Boolean = start <= item && item <= end
override fun iterator(): ByteIterator = ByteProgressionIterator(start, end, 1)
fun equals(other: Any?): Boolean =
other is ByteRange && start == other.start && end == other.end
fun hashCode() = 31 * start.toInt() + end
fun hashCode(): Int = 31 * start.toInt() + end
class object {
public val EMPTY: ByteRange = ByteRange(1, 0)
@@ -24,14 +24,14 @@ public class CharRange(public override val start: Char, public override val end:
override val increment: Int
get() = 1
override fun contains(item: Char) = start <= item && item <= end
override fun contains(item: Char): Boolean = start <= item && item <= end
override fun iterator(): CharIterator = CharProgressionIterator(start, end, 1)
fun equals(other: Any?): Boolean =
other is CharRange && start == other.start && end == other.end
fun hashCode() = 31 * start.toInt() + end
fun hashCode(): Int = 31 * start.toInt() + end
class object {
public val EMPTY: CharRange = CharRange(1.toChar(), 0.toChar())
@@ -42,14 +42,14 @@ public class ShortRange(public override val start: Short, public override val en
override val increment: Int
get() = 1
override fun contains(item: Short) = start <= item && item <= end
override fun contains(item: Short): Boolean = start <= item && item <= end
override fun iterator(): ShortIterator = ShortProgressionIterator(start, end, 1)
fun equals(other: Any?): Boolean =
other is ShortRange && start == other.start && end == other.end
fun hashCode() = 31 * start.toInt() + end
fun hashCode(): Int = 31 * start.toInt() + end
class object {
public val EMPTY: ShortRange = ShortRange(1, 0)
@@ -60,14 +60,14 @@ public class IntRange(public override val start: Int, public override val end: I
override val increment: Int
get() = 1
override fun contains(item: Int) = start <= item && item <= end
override fun contains(item: Int): Boolean = start <= item && item <= end
override fun iterator(): IntIterator = IntProgressionIterator(start, end, 1)
fun equals(other: Any?): Boolean =
other is IntRange && start == other.start && end == other.end
fun hashCode() = 31 * start + end
fun hashCode(): Int = 31 * start + end
class object {
public val EMPTY: IntRange = IntRange(1, 0)
@@ -78,14 +78,14 @@ public class LongRange(public override val start: Long, public override val end:
override val increment: Long
get() = 1
override fun contains(item: Long) = start <= item && item <= end
override fun contains(item: Long): Boolean = start <= item && item <= end
override fun iterator(): LongIterator = LongProgressionIterator(start, end, 1)
fun equals(other: Any?): Boolean =
other is LongRange && start == other.start && end == other.end
fun hashCode() = (31 * (start xor (start ushr 32)) + (end xor (end ushr 32))).toInt()
fun hashCode(): Int = (31 * (start xor (start ushr 32)) + (end xor (end ushr 32))).toInt()
class object {
public val EMPTY: LongRange = LongRange(1, 0)
@@ -96,14 +96,14 @@ public class FloatRange(public override val start: Float, public override val en
override val increment: Float
get() = 1.0f
override fun contains(item: Float) = start <= item && item <= end
override fun contains(item: Float): Boolean = start <= item && item <= end
override fun iterator(): FloatIterator = FloatProgressionIterator(start, end, 1.0f)
fun equals(other: Any?): Boolean =
other is FloatRange && java.lang.Float.compare(start, other.start) == 0 && java.lang.Float.compare(end, other.end) == 0
fun hashCode() = 31 * java.lang.Float.floatToIntBits(start) + java.lang.Float.floatToIntBits(end)
fun hashCode(): Int = 31 * java.lang.Float.floatToIntBits(start) + java.lang.Float.floatToIntBits(end)
class object {
public val EMPTY: FloatRange = FloatRange(1.0f, 0.0f)
@@ -114,7 +114,7 @@ public class DoubleRange(public override val start: Double, public override val
override val increment: Double
get() = 1.0
override fun contains(item: Double) = start <= item && item <= end
override fun contains(item: Double): Boolean = start <= item && item <= end
override fun iterator(): DoubleIterator = DoubleProgressionIterator(start, end, 1.0)