KT-274 stdlib part and commented test. Still require frontend test

This commit is contained in:
Alex Tkachman
2012-01-05 00:16:25 +02:00
parent 79049ca2e2
commit ebe2c375cd
3 changed files with 38 additions and 0 deletions
+20
View File
@@ -7,6 +7,26 @@ import java.util.HashSet
import java.util.LinkedHashSet
import java.util.TreeSet
/*
Helper to make jet.Iterator usable in for
*/
inline fun <T> jet.Iterator<T>.iterator() = this
/*
Helper to make java.util.Iterator usable in for
*/
inline fun <T> java.util.Iterator<T>.iterator() = this
/*
Helper to make java.util.Enumeration usable in for
*/
inline fun <T> java.util.Enumeration<T>.iterator() = object: Iterator<T> {
override val hasNext: Boolean
get() = hasMoreElements()
override fun next() = nextElement()
}
/*
* Extension functions on the standard Kotlin types to behave like the java.lang.* and java.util.* collections
*/