Create module 'builtins', move 'runtime' -> 'runtime.jvm'
'builtins' will be used for platform-independent core built-in definitions, 'runtime.jvm' for things that should be present at runtime in order for Kotlin code to execute correctly on JVM ProgressionUtil goes to 'builtins' right now because progression iterators depend on it, but should be rewritten to Kotlin later
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package jet
|
||||
|
||||
public annotation class atomic
|
||||
public annotation class data
|
||||
public annotation class deprecated(val value: String)
|
||||
public annotation class suppress(vararg val names: String)
|
||||
public annotation class tailRecursive
|
||||
@@ -0,0 +1,73 @@
|
||||
// Generated by org.jetbrains.jet.generators.runtime.functions.GenerateFunctions
|
||||
|
||||
package jet
|
||||
|
||||
public trait ExtensionFunction0<in T, out R> {
|
||||
public fun T.invoke(): R
|
||||
}
|
||||
public trait ExtensionFunction1<in T, in P1, out R> {
|
||||
public fun T.invoke(p1: P1): R
|
||||
}
|
||||
public trait ExtensionFunction2<in T, in P1, in P2, out R> {
|
||||
public fun T.invoke(p1: P1, p2: P2): R
|
||||
}
|
||||
public trait ExtensionFunction3<in T, in P1, in P2, in P3, out R> {
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3): R
|
||||
}
|
||||
public trait ExtensionFunction4<in T, in P1, in P2, in P3, in P4, out R> {
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4): R
|
||||
}
|
||||
public trait ExtensionFunction5<in T, in P1, in P2, in P3, in P4, in P5, out R> {
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5): R
|
||||
}
|
||||
public trait ExtensionFunction6<in T, in P1, in P2, in P3, in P4, in P5, in P6, out R> {
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6): R
|
||||
}
|
||||
public trait ExtensionFunction7<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, out R> {
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7): R
|
||||
}
|
||||
public trait ExtensionFunction8<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, out R> {
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8): R
|
||||
}
|
||||
public trait ExtensionFunction9<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, out R> {
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9): R
|
||||
}
|
||||
public trait ExtensionFunction10<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, out R> {
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10): R
|
||||
}
|
||||
public trait ExtensionFunction11<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, out R> {
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11): R
|
||||
}
|
||||
public trait ExtensionFunction12<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, out R> {
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12): R
|
||||
}
|
||||
public trait ExtensionFunction13<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, out R> {
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13): R
|
||||
}
|
||||
public trait ExtensionFunction14<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, out R> {
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14): R
|
||||
}
|
||||
public trait ExtensionFunction15<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, out R> {
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15): R
|
||||
}
|
||||
public trait ExtensionFunction16<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, out R> {
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16): R
|
||||
}
|
||||
public trait ExtensionFunction17<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, out R> {
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17): R
|
||||
}
|
||||
public trait ExtensionFunction18<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, out R> {
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17, p18: P18): R
|
||||
}
|
||||
public trait ExtensionFunction19<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, out R> {
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17, p18: P18, p19: P19): R
|
||||
}
|
||||
public trait ExtensionFunction20<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, in P20, out R> {
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17, p18: P18, p19: P19, p20: P20): R
|
||||
}
|
||||
public trait ExtensionFunction21<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, in P20, in P21, out R> {
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17, p18: P18, p19: P19, p20: P20, p21: P21): R
|
||||
}
|
||||
public trait ExtensionFunction22<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, in P20, in P21, in P22, out R> {
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17, p18: P18, p19: P19, p20: P20, p21: P21, p22: P22): R
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
// Generated by org.jetbrains.jet.generators.runtime.functions.GenerateFunctions
|
||||
|
||||
package jet
|
||||
|
||||
public trait Function0<out R> {
|
||||
public fun invoke(): R
|
||||
}
|
||||
public trait Function1<in P1, out R> {
|
||||
public fun invoke(p1: P1): R
|
||||
}
|
||||
public trait Function2<in P1, in P2, out R> {
|
||||
public fun invoke(p1: P1, p2: P2): R
|
||||
}
|
||||
public trait Function3<in P1, in P2, in P3, out R> {
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3): R
|
||||
}
|
||||
public trait Function4<in P1, in P2, in P3, in P4, out R> {
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4): R
|
||||
}
|
||||
public trait Function5<in P1, in P2, in P3, in P4, in P5, out R> {
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5): R
|
||||
}
|
||||
public trait Function6<in P1, in P2, in P3, in P4, in P5, in P6, out R> {
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6): R
|
||||
}
|
||||
public trait Function7<in P1, in P2, in P3, in P4, in P5, in P6, in P7, out R> {
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7): R
|
||||
}
|
||||
public trait Function8<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, out R> {
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8): R
|
||||
}
|
||||
public trait Function9<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, out R> {
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9): R
|
||||
}
|
||||
public trait Function10<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, out R> {
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10): R
|
||||
}
|
||||
public trait Function11<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, out R> {
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11): R
|
||||
}
|
||||
public trait Function12<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, out R> {
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12): R
|
||||
}
|
||||
public trait Function13<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, out R> {
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13): R
|
||||
}
|
||||
public trait Function14<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, out R> {
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14): R
|
||||
}
|
||||
public trait Function15<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, out R> {
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15): R
|
||||
}
|
||||
public trait Function16<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, out R> {
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16): R
|
||||
}
|
||||
public trait Function17<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, out R> {
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17): R
|
||||
}
|
||||
public trait Function18<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, out R> {
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17, p18: P18): R
|
||||
}
|
||||
public trait Function19<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, out R> {
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17, p18: P18, p19: P19): R
|
||||
}
|
||||
public trait Function20<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, in P20, out R> {
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17, p18: P18, p19: P19, p20: P20): R
|
||||
}
|
||||
public trait Function21<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, in P20, in P21, out R> {
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17, p18: P18, p19: P19, p20: P20, p21: P21): R
|
||||
}
|
||||
public trait Function22<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, in P20, in P21, in P22, out R> {
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17, p18: P18, p19: P19, p20: P20, p21: P21, p22: P22): R
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package jet
|
||||
|
||||
public annotation class noinline
|
||||
public annotation class inline(public val strategy: InlineStrategy = InlineStrategy.AS_FUNCTION)
|
||||
public enum class InlineStrategy {
|
||||
AS_FUNCTION
|
||||
IN_PLACE
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
// Generated by org.jetbrains.jet.generators.runtime.iterators.GenerateIterators
|
||||
|
||||
package jet
|
||||
|
||||
public abstract class ByteIterator : Iterator<Byte> {
|
||||
override final fun next() = nextByte()
|
||||
|
||||
public abstract fun nextByte(): Byte
|
||||
}
|
||||
|
||||
public abstract class CharIterator : Iterator<Char> {
|
||||
override final fun next() = nextChar()
|
||||
|
||||
public abstract fun nextChar(): Char
|
||||
}
|
||||
|
||||
public abstract class ShortIterator : Iterator<Short> {
|
||||
override final fun next() = nextShort()
|
||||
|
||||
public abstract fun nextShort(): Short
|
||||
}
|
||||
|
||||
public abstract class IntIterator : Iterator<Int> {
|
||||
override final fun next() = nextInt()
|
||||
|
||||
public abstract fun nextInt(): Int
|
||||
}
|
||||
|
||||
public abstract class LongIterator : Iterator<Long> {
|
||||
override final fun next() = nextLong()
|
||||
|
||||
public abstract fun nextLong(): Long
|
||||
}
|
||||
|
||||
public abstract class FloatIterator : Iterator<Float> {
|
||||
override final fun next() = nextFloat()
|
||||
|
||||
public abstract fun nextFloat(): Float
|
||||
}
|
||||
|
||||
public abstract class DoubleIterator : Iterator<Double> {
|
||||
override final fun next() = nextDouble()
|
||||
|
||||
public abstract fun nextDouble(): Double
|
||||
}
|
||||
|
||||
public abstract class BooleanIterator : Iterator<Boolean> {
|
||||
override final fun next() = nextBoolean()
|
||||
|
||||
public abstract fun nextBoolean(): Boolean
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
// Generated by org.jetbrains.jet.generators.runtime.functions.GenerateFunctions
|
||||
|
||||
package jet
|
||||
|
||||
public trait KExtensionFunction0<in T, out R> : ExtensionFunction0<T, R>
|
||||
public trait KExtensionFunction1<in T, in P1, out R> : ExtensionFunction1<T, P1, R>
|
||||
public trait KExtensionFunction2<in T, in P1, in P2, out R> : ExtensionFunction2<T, P1, P2, R>
|
||||
public trait KExtensionFunction3<in T, in P1, in P2, in P3, out R> : ExtensionFunction3<T, P1, P2, P3, R>
|
||||
public trait KExtensionFunction4<in T, in P1, in P2, in P3, in P4, out R> : ExtensionFunction4<T, P1, P2, P3, P4, R>
|
||||
public trait KExtensionFunction5<in T, in P1, in P2, in P3, in P4, in P5, out R> : ExtensionFunction5<T, P1, P2, P3, P4, P5, R>
|
||||
public trait KExtensionFunction6<in T, in P1, in P2, in P3, in P4, in P5, in P6, out R> : ExtensionFunction6<T, P1, P2, P3, P4, P5, P6, R>
|
||||
public trait KExtensionFunction7<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, out R> : ExtensionFunction7<T, P1, P2, P3, P4, P5, P6, P7, R>
|
||||
public trait KExtensionFunction8<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, out R> : ExtensionFunction8<T, P1, P2, P3, P4, P5, P6, P7, P8, R>
|
||||
public trait KExtensionFunction9<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, out R> : ExtensionFunction9<T, P1, P2, P3, P4, P5, P6, P7, P8, P9, R>
|
||||
public trait KExtensionFunction10<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, out R> : ExtensionFunction10<T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, R>
|
||||
public trait KExtensionFunction11<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, out R> : ExtensionFunction11<T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, R>
|
||||
public trait KExtensionFunction12<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, out R> : ExtensionFunction12<T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, R>
|
||||
public trait KExtensionFunction13<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, out R> : ExtensionFunction13<T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, R>
|
||||
public trait KExtensionFunction14<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, out R> : ExtensionFunction14<T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, R>
|
||||
public trait KExtensionFunction15<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, out R> : ExtensionFunction15<T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, R>
|
||||
public trait KExtensionFunction16<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, out R> : ExtensionFunction16<T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, R>
|
||||
public trait KExtensionFunction17<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, out R> : ExtensionFunction17<T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, R>
|
||||
public trait KExtensionFunction18<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, out R> : ExtensionFunction18<T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, R>
|
||||
public trait KExtensionFunction19<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, out R> : ExtensionFunction19<T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, R>
|
||||
public trait KExtensionFunction20<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, in P20, out R> : ExtensionFunction20<T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, R>
|
||||
public trait KExtensionFunction21<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, in P20, in P21, out R> : ExtensionFunction21<T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21, R>
|
||||
public trait KExtensionFunction22<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, in P20, in P21, in P22, out R> : ExtensionFunction22<T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21, P22, R>
|
||||
@@ -0,0 +1,27 @@
|
||||
// Generated by org.jetbrains.jet.generators.runtime.functions.GenerateFunctions
|
||||
|
||||
package jet
|
||||
|
||||
public trait KFunction0<out R> : Function0<R>
|
||||
public trait KFunction1<in P1, out R> : Function1<P1, R>
|
||||
public trait KFunction2<in P1, in P2, out R> : Function2<P1, P2, R>
|
||||
public trait KFunction3<in P1, in P2, in P3, out R> : Function3<P1, P2, P3, R>
|
||||
public trait KFunction4<in P1, in P2, in P3, in P4, out R> : Function4<P1, P2, P3, P4, R>
|
||||
public trait KFunction5<in P1, in P2, in P3, in P4, in P5, out R> : Function5<P1, P2, P3, P4, P5, R>
|
||||
public trait KFunction6<in P1, in P2, in P3, in P4, in P5, in P6, out R> : Function6<P1, P2, P3, P4, P5, P6, R>
|
||||
public trait KFunction7<in P1, in P2, in P3, in P4, in P5, in P6, in P7, out R> : Function7<P1, P2, P3, P4, P5, P6, P7, R>
|
||||
public trait KFunction8<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, out R> : Function8<P1, P2, P3, P4, P5, P6, P7, P8, R>
|
||||
public trait KFunction9<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, out R> : Function9<P1, P2, P3, P4, P5, P6, P7, P8, P9, R>
|
||||
public trait KFunction10<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, out R> : Function10<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, R>
|
||||
public trait KFunction11<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, out R> : Function11<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, R>
|
||||
public trait KFunction12<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, out R> : Function12<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, R>
|
||||
public trait KFunction13<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, out R> : Function13<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, R>
|
||||
public trait KFunction14<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, out R> : Function14<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, R>
|
||||
public trait KFunction15<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, out R> : Function15<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, R>
|
||||
public trait KFunction16<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, out R> : Function16<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, R>
|
||||
public trait KFunction17<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, out R> : Function17<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, R>
|
||||
public trait KFunction18<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, out R> : Function18<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, R>
|
||||
public trait KFunction19<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, out R> : Function19<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, R>
|
||||
public trait KFunction20<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, in P20, out R> : Function20<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, R>
|
||||
public trait KFunction21<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, in P20, in P21, out R> : Function21<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21, R>
|
||||
public trait KFunction22<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, in P20, in P21, in P22, out R> : Function22<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21, P22, R>
|
||||
@@ -0,0 +1,27 @@
|
||||
// Generated by org.jetbrains.jet.generators.runtime.functions.GenerateFunctions
|
||||
|
||||
package jet
|
||||
|
||||
public trait KMemberFunction0<in T, out R> : ExtensionFunction0<T, R>
|
||||
public trait KMemberFunction1<in T, in P1, out R> : ExtensionFunction1<T, P1, R>
|
||||
public trait KMemberFunction2<in T, in P1, in P2, out R> : ExtensionFunction2<T, P1, P2, R>
|
||||
public trait KMemberFunction3<in T, in P1, in P2, in P3, out R> : ExtensionFunction3<T, P1, P2, P3, R>
|
||||
public trait KMemberFunction4<in T, in P1, in P2, in P3, in P4, out R> : ExtensionFunction4<T, P1, P2, P3, P4, R>
|
||||
public trait KMemberFunction5<in T, in P1, in P2, in P3, in P4, in P5, out R> : ExtensionFunction5<T, P1, P2, P3, P4, P5, R>
|
||||
public trait KMemberFunction6<in T, in P1, in P2, in P3, in P4, in P5, in P6, out R> : ExtensionFunction6<T, P1, P2, P3, P4, P5, P6, R>
|
||||
public trait KMemberFunction7<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, out R> : ExtensionFunction7<T, P1, P2, P3, P4, P5, P6, P7, R>
|
||||
public trait KMemberFunction8<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, out R> : ExtensionFunction8<T, P1, P2, P3, P4, P5, P6, P7, P8, R>
|
||||
public trait KMemberFunction9<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, out R> : ExtensionFunction9<T, P1, P2, P3, P4, P5, P6, P7, P8, P9, R>
|
||||
public trait KMemberFunction10<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, out R> : ExtensionFunction10<T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, R>
|
||||
public trait KMemberFunction11<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, out R> : ExtensionFunction11<T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, R>
|
||||
public trait KMemberFunction12<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, out R> : ExtensionFunction12<T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, R>
|
||||
public trait KMemberFunction13<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, out R> : ExtensionFunction13<T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, R>
|
||||
public trait KMemberFunction14<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, out R> : ExtensionFunction14<T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, R>
|
||||
public trait KMemberFunction15<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, out R> : ExtensionFunction15<T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, R>
|
||||
public trait KMemberFunction16<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, out R> : ExtensionFunction16<T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, R>
|
||||
public trait KMemberFunction17<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, out R> : ExtensionFunction17<T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, R>
|
||||
public trait KMemberFunction18<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, out R> : ExtensionFunction18<T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, R>
|
||||
public trait KMemberFunction19<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, out R> : ExtensionFunction19<T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, R>
|
||||
public trait KMemberFunction20<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, in P20, out R> : ExtensionFunction20<T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, R>
|
||||
public trait KMemberFunction21<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, in P20, in P21, out R> : ExtensionFunction21<T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21, R>
|
||||
public trait KMemberFunction22<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, in P20, in P21, in P22, out R> : ExtensionFunction22<T, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21, P22, R>
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright 2010-2014 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
|
||||
|
||||
public trait Progression<N : Any> : Iterable<N> {
|
||||
public val start: N
|
||||
|
||||
public val end: N
|
||||
|
||||
public val increment: Number
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
package jet
|
||||
|
||||
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
|
||||
|
||||
override fun hasNext() = hasNext
|
||||
|
||||
override fun nextByte(): Byte {
|
||||
val value = next
|
||||
if (value == finalElement.toInt()) {
|
||||
hasNext = false
|
||||
}
|
||||
else {
|
||||
next += increment
|
||||
}
|
||||
return value.toByte()
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
override fun hasNext() = hasNext
|
||||
|
||||
override fun nextChar(): Char {
|
||||
val value = next
|
||||
if (value == finalElement.toInt()) {
|
||||
hasNext = false
|
||||
}
|
||||
else {
|
||||
next += increment
|
||||
}
|
||||
return value.toChar()
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
override fun hasNext() = hasNext
|
||||
|
||||
override fun nextShort(): Short {
|
||||
val value = next
|
||||
if (value == finalElement.toInt()) {
|
||||
hasNext = false
|
||||
}
|
||||
else {
|
||||
next += increment
|
||||
}
|
||||
return value.toShort()
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
override fun hasNext() = hasNext
|
||||
|
||||
override fun nextInt(): Int {
|
||||
val value = next
|
||||
if (value == finalElement) {
|
||||
hasNext = false
|
||||
}
|
||||
else {
|
||||
next += increment
|
||||
}
|
||||
return value
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
override fun hasNext() = hasNext
|
||||
|
||||
override fun nextLong(): Long {
|
||||
val value = next
|
||||
if (value == finalElement) {
|
||||
hasNext = false
|
||||
}
|
||||
else {
|
||||
next += increment
|
||||
}
|
||||
return value
|
||||
}
|
||||
}
|
||||
|
||||
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 nextFloat(): Float {
|
||||
val value = next
|
||||
next += increment
|
||||
return value
|
||||
}
|
||||
}
|
||||
|
||||
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 nextDouble(): Double {
|
||||
val value = next
|
||||
next += increment
|
||||
return value
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
// Generated by org.jetbrains.jet.generators.runtime.progressions.GenerateProgressions
|
||||
|
||||
package jet
|
||||
|
||||
public class ByteProgression(
|
||||
public override val start: Byte,
|
||||
public override val end: Byte,
|
||||
public override val increment: Int
|
||||
) : Progression<Byte> {
|
||||
{
|
||||
if (increment == 0) throw IllegalArgumentException("Increment must be non-zero")
|
||||
}
|
||||
|
||||
override fun iterator(): ByteIterator = ByteProgressionIterator(start, end, increment)
|
||||
|
||||
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 toString() = if (increment > 0) "$start..$end step $increment" else "$start downTo $end step ${-increment}"
|
||||
}
|
||||
|
||||
public class CharProgression(
|
||||
public override val start: Char,
|
||||
public override val end: Char,
|
||||
public override val increment: Int
|
||||
) : Progression<Char> {
|
||||
{
|
||||
if (increment == 0) throw IllegalArgumentException("Increment must be non-zero")
|
||||
}
|
||||
|
||||
override fun iterator(): CharIterator = CharProgressionIterator(start, end, increment)
|
||||
|
||||
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 toString() = if (increment > 0) "$start..$end step $increment" else "$start downTo $end step ${-increment}"
|
||||
}
|
||||
|
||||
public class ShortProgression(
|
||||
public override val start: Short,
|
||||
public override val end: Short,
|
||||
public override val increment: Int
|
||||
) : Progression<Short> {
|
||||
{
|
||||
if (increment == 0) throw IllegalArgumentException("Increment must be non-zero")
|
||||
}
|
||||
|
||||
override fun iterator(): ShortIterator = ShortProgressionIterator(start, end, increment)
|
||||
|
||||
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 toString() = if (increment > 0) "$start..$end step $increment" else "$start downTo $end step ${-increment}"
|
||||
}
|
||||
|
||||
public class IntProgression(
|
||||
public override val start: Int,
|
||||
public override val end: Int,
|
||||
public override val increment: Int
|
||||
) : Progression<Int> {
|
||||
{
|
||||
if (increment == 0) throw IllegalArgumentException("Increment must be non-zero")
|
||||
}
|
||||
|
||||
override fun iterator(): IntIterator = IntProgressionIterator(start, end, increment)
|
||||
|
||||
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 toString() = if (increment > 0) "$start..$end step $increment" else "$start downTo $end step ${-increment}"
|
||||
}
|
||||
|
||||
public class LongProgression(
|
||||
public override val start: Long,
|
||||
public override val end: Long,
|
||||
public override val increment: Long
|
||||
) : Progression<Long> {
|
||||
{
|
||||
if (increment == 0L) throw IllegalArgumentException("Increment must be non-zero")
|
||||
}
|
||||
|
||||
override fun iterator(): LongIterator = LongProgressionIterator(start, end, increment)
|
||||
|
||||
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 toString() = if (increment > 0) "$start..$end step $increment" else "$start downTo $end step ${-increment}"
|
||||
}
|
||||
|
||||
public class FloatProgression(
|
||||
public override val start: Float,
|
||||
public override val end: Float,
|
||||
public override val increment: Float
|
||||
) : Progression<Float> {
|
||||
{
|
||||
if (java.lang.Float.isNaN(increment)) throw IllegalArgumentException("Increment must be not NaN")
|
||||
if (increment == 0.0f) throw IllegalArgumentException("Increment must be non-zero")
|
||||
}
|
||||
|
||||
override fun iterator(): FloatIterator = FloatProgressionIterator(start, end, increment)
|
||||
|
||||
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 toString() = if (increment > 0) "$start..$end step $increment" else "$start downTo $end step ${-increment}"
|
||||
}
|
||||
|
||||
public class DoubleProgression(
|
||||
public override val start: Double,
|
||||
public override val end: Double,
|
||||
public override val increment: Double
|
||||
) : Progression<Double> {
|
||||
{
|
||||
if (java.lang.Double.isNaN(increment)) throw IllegalArgumentException("Increment must be not NaN")
|
||||
if (increment == 0.0) throw IllegalArgumentException("Increment must be non-zero")
|
||||
}
|
||||
|
||||
override fun iterator(): DoubleIterator = DoubleProgressionIterator(start, end, increment)
|
||||
|
||||
fun equals(other: Any?): Boolean =
|
||||
other is DoubleProgression && java.lang.Double.compare(start, other.start) == 0 && java.lang.Double.compare(end, other.end) == 0 && java.lang.Double.compare(increment, other.increment) == 0
|
||||
|
||||
fun hashCode(): Int {
|
||||
var temp = java.lang.Double.doubleToLongBits(start)
|
||||
var result = (temp xor (temp ushr 32))
|
||||
temp = java.lang.Double.doubleToLongBits(end)
|
||||
result = 31 * result + (temp xor (temp ushr 32))
|
||||
temp = java.lang.Double.doubleToLongBits(increment)
|
||||
return (31 * result + (temp xor (temp ushr 32))).toInt()
|
||||
}
|
||||
|
||||
fun toString() = if (increment > 0) "$start..$end step $increment" else "$start downTo $end step ${-increment}"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package jet
|
||||
|
||||
public trait PropertyMetadata {
|
||||
public val name: String
|
||||
}
|
||||
|
||||
public class PropertyMetadataImpl(public override val name: String): PropertyMetadata
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright 2010-2014 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
|
||||
|
||||
public trait Range<in T : Comparable<T>> {
|
||||
public val start: T
|
||||
|
||||
public val end: T
|
||||
|
||||
public fun contains(item: T): Boolean
|
||||
|
||||
public fun toString(): String = "$start..$end"
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
// Generated by org.jetbrains.jet.generators.runtime.ranges.GenerateRanges
|
||||
|
||||
package jet
|
||||
|
||||
public class ByteRange(public override val start: Byte, public override val end: Byte) : Range<Byte>, Progression<Byte> {
|
||||
override val increment: Int
|
||||
get() = 1
|
||||
|
||||
override fun contains(item: Byte) = 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
|
||||
|
||||
class object {
|
||||
public val EMPTY: ByteRange = ByteRange(1, 0)
|
||||
}
|
||||
}
|
||||
|
||||
public class CharRange(public override val start: Char, public override val end: Char) : Range<Char>, Progression<Char> {
|
||||
override val increment: Int
|
||||
get() = 1
|
||||
|
||||
override fun contains(item: Char) = 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
|
||||
|
||||
class object {
|
||||
public val EMPTY: CharRange = CharRange(1.toChar(), 0.toChar())
|
||||
}
|
||||
}
|
||||
|
||||
public class ShortRange(public override val start: Short, public override val end: Short) : Range<Short>, Progression<Short> {
|
||||
override val increment: Int
|
||||
get() = 1
|
||||
|
||||
override fun contains(item: Short) = 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
|
||||
|
||||
class object {
|
||||
public val EMPTY: ShortRange = ShortRange(1, 0)
|
||||
}
|
||||
}
|
||||
|
||||
public class IntRange(public override val start: Int, public override val end: Int) : Range<Int>, Progression<Int> {
|
||||
override val increment: Int
|
||||
get() = 1
|
||||
|
||||
override fun contains(item: Int) = 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
|
||||
|
||||
class object {
|
||||
public val EMPTY: IntRange = IntRange(1, 0)
|
||||
}
|
||||
}
|
||||
|
||||
public class LongRange(public override val start: Long, public override val end: Long) : Range<Long>, Progression<Long> {
|
||||
override val increment: Long
|
||||
get() = 1
|
||||
|
||||
override fun contains(item: Long) = 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()
|
||||
|
||||
class object {
|
||||
public val EMPTY: LongRange = LongRange(1, 0)
|
||||
}
|
||||
}
|
||||
|
||||
public class FloatRange(public override val start: Float, public override val end: Float) : Range<Float>, Progression<Float> {
|
||||
override val increment: Float
|
||||
get() = 1.0f
|
||||
|
||||
override fun contains(item: Float) = 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)
|
||||
|
||||
class object {
|
||||
public val EMPTY: FloatRange = FloatRange(1.0f, 0.0f)
|
||||
}
|
||||
}
|
||||
|
||||
public class DoubleRange(public override val start: Double, public override val end: Double) : Range<Double>, Progression<Double> {
|
||||
override val increment: Double
|
||||
get() = 1.0
|
||||
|
||||
override fun contains(item: Double) = start <= item && item <= end
|
||||
|
||||
override fun iterator(): DoubleIterator = DoubleProgressionIterator(start, end, 1.0)
|
||||
|
||||
fun equals(other: Any?): Boolean =
|
||||
other is DoubleRange && java.lang.Double.compare(start, other.start) == 0 && java.lang.Double.compare(end, other.end) == 0
|
||||
|
||||
fun hashCode(): Int {
|
||||
var temp = java.lang.Double.doubleToLongBits(start)
|
||||
val result = (temp xor (temp ushr 32))
|
||||
temp = java.lang.Double.doubleToLongBits(end)
|
||||
return (31 * result + (temp xor (temp ushr 32))).toInt()
|
||||
}
|
||||
|
||||
class object {
|
||||
public val EMPTY: DoubleRange = DoubleRange(1.0, 0.0)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright 2010-2014 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
|
||||
|
||||
public class Unit private() {
|
||||
fun toString() = "Unit.VALUE"
|
||||
|
||||
class object {
|
||||
// TODO: remove suppression after a successful bootstrap
|
||||
suppress("INVISIBLE_MEMBER")
|
||||
public val VALUE: Unit = Unit()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* 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.runtime;
|
||||
|
||||
public class ProgressionUtil {
|
||||
private ProgressionUtil() {
|
||||
}
|
||||
|
||||
// a mod b (in arithmetical sense)
|
||||
private static int mod(int a, int b) {
|
||||
int mod = a % b;
|
||||
return mod >= 0 ? mod : mod + b;
|
||||
}
|
||||
|
||||
private static long mod(long a, long b) {
|
||||
long mod = a % b;
|
||||
return mod >= 0 ? mod : mod + b;
|
||||
}
|
||||
|
||||
// (a - b) mod c
|
||||
private static int differenceModulo(int a, int b, int c) {
|
||||
return mod(mod(a, c) - mod(b, c), c);
|
||||
}
|
||||
|
||||
private static long differenceModulo(long a, long b, long c) {
|
||||
return mod(mod(a, c) - mod(b, c), c);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Calculates the final element of a bounded arithmetic progression, i.e. the last element of the progression which is in the range
|
||||
* from {@code start} to {@code end} in case of a positive {@code increment}, or from {@code end} to {@code start} in case of a negative
|
||||
* increment.
|
||||
*
|
||||
* <p>No validation on passed parameters is performed. The given parameters should satisfy the condition: either
|
||||
* {@code increment > 0} and {@code start <= end}, or {@code increment < 0} and {@code start >= end}.
|
||||
* @param start first element of the progression
|
||||
* @param end ending bound for the progression
|
||||
* @param increment increment, or difference of successive elements in the progression
|
||||
* @return the final element of the progression
|
||||
*/
|
||||
public static int getProgressionFinalElement(int start, int end, int increment) {
|
||||
if (increment > 0) {
|
||||
return end - differenceModulo(end, start, increment);
|
||||
}
|
||||
else {
|
||||
return end + differenceModulo(start, end, -increment);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates the final element of a bounded arithmetic progression, i.e. the last element of the progression which is in the range
|
||||
* from {@code start} to {@code end} in case of a positive {@code increment}, or from {@code end} to {@code start} in case of a negative
|
||||
* increment.
|
||||
*
|
||||
* <p>No validation on passed parameters is performed. The given parameters should satisfy the condition: either
|
||||
* {@code increment > 0} and {@code start <= end}, or {@code increment < 0} and {@code start >= end}.
|
||||
* @param start first element of the progression
|
||||
* @param end ending bound for the progression
|
||||
* @param increment increment, or difference of successive elements in the progression
|
||||
* @return the final element of the progression
|
||||
*/
|
||||
public static long getProgressionFinalElement(long start, long end, long increment) {
|
||||
if (increment > 0) {
|
||||
return end - differenceModulo(end, start, increment);
|
||||
}
|
||||
else {
|
||||
return end + differenceModulo(start, end, -increment);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user