All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jtransc.lang.array.kt Maven / Gradle / Ivy

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 - 2024 Weber Informatics LLC | Privacy Policy