sealed class ArrayMap : Iterable { protected constructor() /* primary */ { super/*Any*/() /* () */ } abstract val size: Int abstract get abstract operator fun set(index: Int, value: T) abstract operator fun get(index: Int): T? abstract fun copy(): ArrayMap } fun ArrayMap<*>.isEmpty(): Boolean { return EQEQ(arg0 = .(), arg1 = 0) } fun ArrayMap<*>.isNotEmpty(): Boolean { return EQEQ(arg0 = .(), arg1 = 0).not() } internal object EmptyArrayMap : ArrayMap { private constructor() /* primary */ { super/*ArrayMap*/() /* () */ } override val size: Int override get(): Int { return 0 } override operator fun set(index: Int, value: Nothing) { throw IllegalStateException() } override operator fun get(index: Int): Nothing? { return null } override fun copy(): ArrayMap { return } override operator fun iterator(): Iterator { return { // BLOCK local class : Iterator { constructor() /* primary */ { super/*Any*/() /* () */ } override operator fun hasNext(): Boolean { return false } override operator fun next(): Nothing { throw NoSuchElementException() } } () } } } internal class OneElementArrayMap : ArrayMap { constructor(value: T, index: Int) /* primary */ { super/*ArrayMap*/() /* () */ } val value: T field = value get val index: Int field = index get override val size: Int override get(): Int { return 1 } override operator fun set(index: Int, value: T) { throw IllegalStateException() } override operator fun get(index: Int): T? { return when { EQEQ(arg0 = index, arg1 = .()) -> .() else -> null } } override fun copy(): ArrayMap { return OneElementArrayMap(value = .(), index = .()) } override operator fun iterator(): Iterator { return { // BLOCK local class : Iterator { constructor() /* primary */ { super/*Any*/() /* () */ } private var notVisited: Boolean field = true private get private set override operator fun hasNext(): Boolean { return .() } override operator fun next(): T { when { .() -> { // BLOCK .( = false) return .() } else -> { // BLOCK throw NoSuchElementException() } } } } () } } } internal class ArrayMapImpl : ArrayMap { private constructor(data: Array) /* primary */ { super/*ArrayMap*/() /* () */ } private var data: Array field = data private get private set companion object Companion { private constructor() /* primary */ { super/*Any*/() /* () */ } private const val DEFAULT_SIZE: Int field = 20 private get private const val INCREASE_K: Int field = 2 private get } constructor() { this/*ArrayMapImpl*/(data = arrayOfNulls(size = Companion.())) } override var size: Int field = 0 override get private open set private fun ensureCapacity(index: Int) { when { lessOrEqual(arg0 = .().(), arg1 = index) -> { // BLOCK .( = .().copyOf(newSize = .().().times(other = Companion.()))) } } } override operator fun set(index: Int, value: T) { .ensureCapacity(index = index) when { EQEQ(arg0 = .().get(index = index), arg1 = null) -> { // BLOCK { // BLOCK val tmp0_this: ArrayMapImpl = { // BLOCK val tmp1: Int = tmp0_this.() tmp0_this.( = tmp1.inc()) tmp1 } } } /*~> Unit */ } .().set(index = index, value = value) } override operator fun get(index: Int): T? { return .().getOrNull(index = index) as T? } override fun copy(): ArrayMap { return ArrayMapImpl(data = .().copyOf()) } override operator fun iterator(): Iterator { return { // BLOCK local class : AbstractIterator { constructor() /* primary */ { super/*AbstractIterator*/() /* () */ } private var index: Int field = -1 private get private set protected override fun computeNext() { { // BLOCK do// COMPOSITE { { // BLOCK val tmp0_this: = { // BLOCK val tmp1: Int = tmp0_this.() tmp0_this.( = tmp1.inc()) tmp1 } } /*~> Unit */ // } while (when { less(arg0 = .(), arg1 = .().()) -> EQEQ(arg0 = .().get(index = .()), arg1 = null) else -> false }) } when { greaterOrEqual(arg0 = .(), arg1 = .().()) -> { // BLOCK .done() } else -> { // BLOCK .setNext(value = .().get(index = .()) as T) } } } } () } } fun remove(index: Int) { when { EQEQ(arg0 = .().get(index = index), arg1 = null).not() -> { // BLOCK { // BLOCK val tmp0_this: ArrayMapImpl = { // BLOCK val tmp1: Int = tmp0_this.() tmp0_this.( = tmp1.dec()) tmp1 } } } /*~> Unit */ } .().set(index = index, value = null) } fun entries(): List> { return .().mapIndexedNotNull>(transform = local fun (index: Int, value: Any?): Entry? { return when { EQEQ(arg0 = value, arg1 = null).not() -> Entry(key = index, value = value as T) else -> null } } ) } data class Entry : Entry { constructor(key: Int, value: T) /* primary */ { super/*Any*/() /* () */ } override val key: Int field = key override get override val value: T field = value override get operator fun component1(): Int { return .() } operator fun component2(): T { return .() } fun copy(key: Int = .(), value: T = .()): Entry { return Entry(key = key, value = value) } override fun toString(): String { return "Entry(" + "key=" + .() + ", " + "value=" + .() + ")" } override fun hashCode(): Int { var result: Int = .().hashCode() result = result.times(other = 31).plus(other = when { EQEQ(arg0 = .(), arg1 = null) -> 0 else -> .().hashCode() }) return result } override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true } when { other !is Entry -> return false } val tmp0_other_with_cast: Entry = other as Entry when { EQEQ(arg0 = .(), arg1 = tmp0_other_with_cast.()).not() -> return false } when { EQEQ(arg0 = .(), arg1 = tmp0_other_with_cast.()).not() -> return false } return true } } }