JS backend: cosmetic changes in javautil.kt:

- added some methods to AbstractList
 - fixed codestyle
 - moved up LinkedList declaration
This commit is contained in:
develar
2013-08-08 19:51:49 +04:00
committed by Zalim Bashorov
parent 1435bdb7c7
commit 411caef8ce
+21 -13
View File
@@ -43,6 +43,7 @@ public abstract class AbstractList<E>(): AbstractCollection<E>(), MutableList<E>
override fun get(index: Int): E = js.noImpl override fun get(index: Int): E = js.noImpl
override fun set(index: Int, element: E): E = js.noImpl override fun set(index: Int, element: E): E = js.noImpl
override fun add(e: E): Boolean = js.noImpl
library("addAt") library("addAt")
override fun add(index: Int, element: E): Unit = js.noImpl override fun add(index: Int, element: E): Unit = js.noImpl
override fun addAll(index: Int, c: Collection<E>): Boolean = js.noImpl override fun addAll(index: Int, c: Collection<E>): Boolean = js.noImpl
@@ -57,12 +58,28 @@ public abstract class AbstractList<E>(): AbstractCollection<E>(), MutableList<E>
override fun listIterator(index: Int): MutableListIterator<E> = js.noImpl override fun listIterator(index: Int): MutableListIterator<E> = js.noImpl
override fun subList(fromIndex: Int, toIndex: Int): MutableList<E> = js.noImpl override fun subList(fromIndex: Int, toIndex: Int): MutableList<E> = js.noImpl
override fun size(): Int = js.noImpl
override fun equals(other: Any?): Boolean = js.noImpl
fun toString(): String = js.noImpl
} }
library library
public open class ArrayList<E>(capacity: Int = 0) : AbstractList<E>() { public open class ArrayList<E>(capacity: Int = 0) : AbstractList<E>() {
} }
library
public open class LinkedList<E>() : AbstractList<E>() {
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 library
public open class HashSet<E>() : AbstractCollection<E>(), MutableSet<E> { public open class HashSet<E>() : AbstractCollection<E>(), MutableSet<E> {
} }
@@ -95,16 +112,6 @@ public open class HashMap<K, V>(capacity:Int=0) : MutableMap<K, V> {
public override fun entrySet(): MutableSet<MutableMap.MutableEntry<K, V>> = js.noImpl public override fun entrySet(): MutableSet<MutableMap.MutableEntry<K, V>> = js.noImpl
} }
library
public open class LinkedList<E>(): AbstractList<E>() {
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 library
public class StringBuilder() : Appendable { public class StringBuilder() : Appendable {
override fun append(c: Char): Appendable? = js.noImpl override fun append(c: Char): Appendable? = js.noImpl
@@ -115,12 +122,13 @@ public class StringBuilder() : Appendable {
} }
library library
public class NoSuchElementException() : Exception() {} public class NoSuchElementException() : Exception() {
}
library library
public trait Enumeration<E> { public trait Enumeration<E> {
open public fun hasMoreElements() : Boolean public fun hasMoreElements(): Boolean
open public fun nextElement() : E public fun nextElement(): E
} }
native native