com.jtransc.lang.array.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jtransc-utils Show documentation
Show all versions of jtransc-utils Show documentation
JVM AOT compiler currently generating JavaScript, C++, Haxe, with initial focus on Kotlin and games.
package com.jtransc.lang
class ReflectedArray(val array: Any) {
fun getType(): Class<*> = array.javaClass.componentType
operator fun get(index:Int): Any? = java.lang.reflect.Array.get(array, index)
operator fun set(index:Int, value: Any?): Unit {
java.lang.reflect.Array.set(array, index, value)
}
val size: Int get() = java.lang.reflect.Array.getLength(array)
val length: Int get() = size
fun toList(): List = (0 until length).map { get(it) }
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy