Samples updated to latest syntax

This commit is contained in:
Maxim Shafirov
2011-01-02 20:06:28 +03:00
parent 6a37d19509
commit b7493012af
20 changed files with 35 additions and 40 deletions
+6 -7
View File
@@ -1,8 +1,8 @@
interface class IAdder<in T> {
virtual class IAdder<in T> {
fun add(item : T) : Boolean
}
interface class ICloseable {
virtual class ICloseable {
fun close()
}
@@ -24,20 +24,19 @@ class FileInput : IIterator<Byte>, JavaCloseableWrapper {
override fun next() {
if (!nextUsed) {
nextUsed = true
return next.as<Byte>
return next as Byte
}
return
}
override val hasNext {
override val hasNext
get() { // implicitly throws IOException
if (nextUsed && next != -1) {
nextUsed = false
next = stream.read() // throws IOException
}
return next != -1
return next != -1
}
}
}
class FileOutput throws IOException : IAdder<Byte>, JavaCloseableWrapper {