Changed extension in parsing test data (jet -> kt)

This commit is contained in:
Evgeny Gerashchenko
2013-09-17 18:05:44 +04:00
parent 2ee3d22ab9
commit e338cda06d
259 changed files with 519 additions and 400 deletions
@@ -0,0 +1,25 @@
open class IIterator<out T> {
fun next() : T
val hasNext : Boolean
fun toArray(buffer : MutableArray<in T>) : Int { // T is still an in-parameter
return fillBuffer(buffer, 0, buffer.size)
}
fun toArray(buffer : MutableArray<in T>, from : Int, length : Int) : Int { // T is still an in-parameter
if (from < 0 || from > buffer.lastIndex || length < 0 || length > buffer.size - from) {
throw IndexOutOfBoundsException();
}
if (len == 0) return 0
var count = 0;
for (i in from .. from + length - 1) {
if (!hasNext)
return count
buffer[i] = next()
count++
}
return count
}
}