diff --git a/js/js.libraries/src/core/javautil.kt b/js/js.libraries/src/core/javautil.kt index 59a003224ae..31adf1747dd 100644 --- a/js/js.libraries/src/core/javautil.kt +++ b/js/js.libraries/src/core/javautil.kt @@ -7,17 +7,17 @@ native public fun MutableMap.set(key: K, value: V): Unit = noImpl library("collectionsMax") -public fun max(col : Collection, comp : Comparator) : T = js.noImpl +public fun max(col: Collection, comp: Comparator): T = js.noImpl library public trait Comparator { - fun compare(obj1 : T, obj2 : T) : Int; + fun compare(obj1: T, obj2: T): Int; } library public abstract class AbstractCollection() : MutableCollection { override fun toArray(): Array = js.noImpl - override fun toArray(a : Array) : Array = js.noImpl + override fun toArray(a: Array): Array = js.noImpl override fun isEmpty(): Boolean = js.noImpl override fun contains(o: Any?): Boolean = js.noImpl @@ -27,44 +27,61 @@ public abstract class AbstractCollection() : MutableCollection { override fun remove(o: Any?): Boolean = js.noImpl override fun addAll(c: Collection): Boolean = js.noImpl - override fun containsAll(c : Collection) : Boolean = js.noImpl - override fun removeAll(c : Collection) : Boolean = js.noImpl - override fun retainAll(c : Collection) : Boolean = js.noImpl + override fun containsAll(c: Collection): Boolean = js.noImpl + override fun removeAll(c: Collection): Boolean = js.noImpl + override fun retainAll(c: Collection): Boolean = js.noImpl override fun clear(): Unit = js.noImpl override fun size(): Int = js.noImpl - override fun hashCode() : Int = js.noImpl - override fun equals(other : Any?) : Boolean = js.noImpl + override fun hashCode(): Int = js.noImpl + override fun equals(other: Any?): Boolean = js.noImpl } library -public abstract class AbstractList(): AbstractCollection(), MutableList { +public abstract class AbstractList() : AbstractCollection(), MutableList { override fun get(index: Int): E = js.noImpl override fun set(index: Int, element: E): E = js.noImpl + override fun add(e: E): Boolean = js.noImpl library("addAt") override fun add(index: Int, element: E): Unit = js.noImpl - override fun addAll(index : Int, c : Collection) : Boolean = js.noImpl + override fun addAll(index: Int, c: Collection): Boolean = js.noImpl library("removeAt") override fun remove(index: Int): E = js.noImpl override fun indexOf(o: Any?): Int = js.noImpl - override fun lastIndexOf(o : Any?) : Int = js.noImpl + override fun lastIndexOf(o: Any?): Int = js.noImpl - override fun listIterator() : MutableListIterator = js.noImpl - override fun listIterator(index : Int) : MutableListIterator = js.noImpl + override fun listIterator(): MutableListIterator = js.noImpl + override fun listIterator(index: Int): MutableListIterator = js.noImpl - override fun subList(fromIndex : Int, toIndex : Int) : MutableList = js.noImpl + override fun subList(fromIndex: Int, toIndex: Int): MutableList = js.noImpl + + override fun size(): Int = js.noImpl + + override fun equals(other: Any?): Boolean = js.noImpl + + fun toString(): String = js.noImpl } library -public open class ArrayList(capacity:Int=0) : AbstractList() { +public open class ArrayList(capacity: Int = 0) : AbstractList() { } library -public open class HashSet(): AbstractCollection(), MutableSet { +public open class LinkedList() : AbstractList() { + public override fun get(index: Int): E = js.noImpl + public override fun set(index: Int, element: E): E = js.noImpl + public override fun add(index: Int, element: E): Unit = js.noImpl + public fun poll(): E? = js.noImpl + public fun peek(): E? = js.noImpl + public fun offer(e: E): Boolean = js.noImpl +} + +library +public open class HashSet() : AbstractCollection(), MutableSet { } library @@ -76,33 +93,23 @@ public open class TreeSet() : AbstractCollection(), MutableSet, SortedS } library -public open class LinkedHashSet(): AbstractCollection(), MutableSet { +public open class LinkedHashSet() : AbstractCollection(), MutableSet { } library -public open class HashMap(capacity:Int=0) : MutableMap { - public override fun size() : Int = js.noImpl - public override fun isEmpty() : Boolean = js.noImpl - public override fun get(key : Any?) : V? = js.noImpl - public override fun containsKey(key : Any?) : Boolean = js.noImpl - public override fun put(key : K, value : V) : V = js.noImpl - public override fun putAll(m : Map) : Unit = js.noImpl - public override fun remove(key : Any?) : V? = js.noImpl - public override fun clear() : Unit = js.noImpl - public override fun containsValue(value : Any?) : Boolean = js.noImpl - public override fun keySet() : MutableSet = js.noImpl - public override fun values() : MutableCollection = js.noImpl - public override fun entrySet() : MutableSet> = js.noImpl -} - -library -public open class LinkedList(): AbstractList() { - public override fun get(index: Int): E = js.noImpl - public override fun set(index: Int, element: E): E = js.noImpl - public override fun add(index: Int, element: E): Unit = js.noImpl - public fun poll(): E? = js.noImpl - public fun peek(): E? = js.noImpl - public fun offer(e: E): Boolean = js.noImpl +public open class HashMap(capacity: Int = 0) : MutableMap { + public override fun size(): Int = js.noImpl + public override fun isEmpty(): Boolean = js.noImpl + public override fun get(key: Any?): V? = js.noImpl + public override fun containsKey(key: Any?): Boolean = js.noImpl + public override fun put(key: K, value: V): V = js.noImpl + public override fun putAll(m: Map): Unit = js.noImpl + public override fun remove(key: Any?): V? = js.noImpl + public override fun clear(): Unit = js.noImpl + public override fun containsValue(value: Any?): Boolean = js.noImpl + public override fun keySet(): MutableSet = js.noImpl + public override fun values(): MutableCollection = js.noImpl + public override fun entrySet(): MutableSet> = js.noImpl } library @@ -110,20 +117,21 @@ public class StringBuilder() : Appendable { override fun append(c: Char): Appendable? = js.noImpl override fun append(csq: CharSequence?): Appendable? = js.noImpl override fun append(csq: CharSequence?, start: Int, end: Int): Appendable? = js.noImpl - public fun append(obj : Any?) : StringBuilder = js.noImpl - public fun toString() : String = js.noImpl + public fun append(obj: Any?): StringBuilder = js.noImpl + public fun toString(): String = js.noImpl } library -public class NoSuchElementException() : Exception() {} +public class NoSuchElementException() : Exception() { +} library public trait Enumeration { - open public fun hasMoreElements() : Boolean - open public fun nextElement() : E + public fun hasMoreElements(): Boolean + public fun nextElement(): E } native public class Date() { - public fun getTime() : Int = js.noImpl + public fun getTime(): Int = js.noImpl }