core.javautil.kt Maven / Gradle / Ivy
package java.util
@native
private val DEFAULT_INITIAL_CAPACITY = 16
@native
private val DEFAULT_LOAD_FACTOR = 0.75f
@library
public interface Comparator {
public fun compare(obj1: T, obj2: T): Int;
}
public inline fun Comparator(crossinline comparison: (T, T) -> Int): Comparator = object : Comparator {
override fun compare(obj1: T, obj2: T): Int = comparison(obj1, obj2)
}
@library
public abstract class AbstractCollection() : MutableCollection {
override fun isEmpty(): Boolean = noImpl
override fun contains(o: E): Boolean = noImpl
override fun iterator(): MutableIterator = noImpl
override fun add(e: E): Boolean = noImpl
override fun remove(o: E): Boolean = noImpl
override fun addAll(c: Collection): Boolean = noImpl
override fun containsAll(c: Collection): Boolean = noImpl
override fun removeAll(c: Collection): Boolean = noImpl
override fun retainAll(c: Collection): Boolean = noImpl
override fun clear(): Unit = noImpl
abstract override val size: Int
override fun hashCode(): Int = noImpl
override fun equals(other: Any?): Boolean = noImpl
}
@library
public abstract class AbstractList() : AbstractCollection(), MutableList {
abstract override fun get(index: Int): E
override fun set(index: Int, element: E): E = noImpl
override fun add(e: E): Boolean = noImpl
override fun add(index: Int, element: E): Unit = noImpl
override fun addAll(index: Int, c: Collection): Boolean = noImpl
override fun removeAt(index: Int): E = noImpl
override fun indexOf(o: E): Int = noImpl
override fun lastIndexOf(o: E): Int = noImpl
override fun listIterator(): MutableListIterator = noImpl
override fun listIterator(index: Int): MutableListIterator = noImpl
override fun subList(fromIndex: Int, toIndex: Int): MutableList = noImpl
override val size: Int get() = noImpl
override fun equals(other: Any?): Boolean = noImpl
override fun toString(): String = noImpl
}
@library
public open class ArrayList(capacity: Int = 0) : AbstractList() {
override fun get(index: Int): E = noImpl
override val size: Int get() = noImpl
}
@library
public open class LinkedList() : AbstractList() {
override fun get(index: Int): E = noImpl
override fun set(index: Int, element: E): E = noImpl
override fun add(index: Int, element: E): Unit = noImpl
public fun poll(): E? = noImpl
public fun peek(): E? = noImpl
public fun offer(e: E): Boolean = noImpl
}
@library
public open class HashSet(
initialCapacity: Int = DEFAULT_INITIAL_CAPACITY, loadFactor: Float = DEFAULT_LOAD_FACTOR
) : AbstractCollection(), MutableSet {
override val size: Int get() = noImpl
}
@library
public interface SortedSet : Set {
}
@library
public open class TreeSet() : AbstractCollection(), MutableSet, SortedSet {
override val size: Int get() = noImpl
}
@library
public open class LinkedHashSet(
initialCapacity: Int = DEFAULT_INITIAL_CAPACITY, loadFactor: Float = DEFAULT_LOAD_FACTOR
) : HashSet(initialCapacity, loadFactor), MutableSet {
override val size: Int get() = noImpl
}
@library
public open class HashMap(initialCapacity: Int = DEFAULT_INITIAL_CAPACITY, loadFactor: Float = DEFAULT_LOAD_FACTOR) : MutableMap {
override val size: Int get() = noImpl
override fun isEmpty(): Boolean = noImpl
override fun get(key: K): V? = noImpl
override fun containsKey(key: K): Boolean = noImpl
override fun put(key: K, value: V): V? = noImpl
override fun putAll(m: Map): Unit = noImpl
override fun remove(key: K): V? = noImpl
override fun clear(): Unit = noImpl
override fun containsValue(value: V): Boolean = noImpl
override val keys: MutableSet get() = noImpl
override val values: MutableCollection get() = noImpl
override val entries: MutableSet> get() = noImpl
}
@library
public open class LinkedHashMap(
initialCapacity: Int = DEFAULT_INITIAL_CAPACITY, loadFactor: Float = DEFAULT_LOAD_FACTOR, accessOrder: Boolean = false
) : HashMap(initialCapacity, loadFactor)
@library
public open class NoSuchElementException(message: String? = null) : Exception() {}
@library
public interface Enumeration {
public fun hasMoreElements(): Boolean
public fun nextElement(): E
}
@native
public class Date() {
public fun getTime(): Int = noImpl
}