Arrays

interface Arrays : Variable

数组操作相关接口.

Author

M8Test, [email protected], https://m8test.com

Functions

Link copied to clipboard
abstract fun <T> arrayOf(clazz: Class<T>, vararg elements: T): Array<T>

创建新的数组并将给定元素添加到数组中.

Link copied to clipboard
abstract fun booleanArrayOf(vararg elements: Boolean): BooleanArray

创建 boolean[] 并将给定元素添加到数组中.

Link copied to clipboard
abstract fun byteArrayOf(vararg elements: Byte): ByteArray

创建 byte[] 并将给定元素添加到数组中.

Link copied to clipboard
abstract fun charArrayOf(vararg elements: Char): CharArray

创建 char[] 并将给定元素添加到数组中.

Link copied to clipboard
abstract fun doubleArrayOf(vararg elements: Double): DoubleArray

创建 double[] 并将给定元素添加到数组中.

Link copied to clipboard
abstract fun floatArrayOf(vararg elements: Float): FloatArray

创建 float[] 并将给定元素添加到数组中.

Link copied to clipboard
abstract fun getGlobalName(): String

获取作为全局变量时的名称.

Link copied to clipboard
abstract fun getPublicType(): Type

获取 Variable 注入到脚本时需要显示的类型.

Link copied to clipboard
abstract fun intArrayOf(vararg elements: Int): IntArray

创建 int[] 并将给定元素添加到数组中.

Link copied to clipboard
abstract fun isPrefixRequired(): Boolean

是否需要添加前缀, 每种编程语言添加的前缀不一样, 前缀可以通过 Language.getVariablePrefix 获取.

Link copied to clipboard
abstract fun isSuffixRequired(): Boolean

是否需要添加后缀, 每种编程语言添加的后缀不一样, 后缀可以通过 Language.getVariableSuffix 获取.

Link copied to clipboard
abstract fun longArrayOf(vararg elements: Long): LongArray

创建 long[] 并将给定元素添加到数组中.

Link copied to clipboard
abstract fun <T> newArray(clazz: Class<T>, size: Int): Array<T>

创建指定大小的数组.

Link copied to clipboard
abstract fun newBooleanArray(size: Int): BooleanArray

创建指定大小的 boolean[].

Link copied to clipboard
abstract fun newByteArray(size: Int): ByteArray

创建指定大小的 byte[].

Link copied to clipboard
abstract fun newCharArray(size: Int): CharArray

创建指定大小的 char[].

Link copied to clipboard
abstract fun newDoubleArray(size: Int): DoubleArray

创建指定大小的 double[].

Link copied to clipboard
abstract fun newFloatArray(size: Int): FloatArray

创建指定大小的 float[].

Link copied to clipboard
abstract fun newIntArray(size: Int): IntArray

创建指定大小的 int[].

Link copied to clipboard
abstract fun newLongArray(size: Int): LongArray

创建指定大小的 long[].

Link copied to clipboard
abstract fun newShortArray(size: Int): ShortArray

创建指定大小的 short[].

Link copied to clipboard
abstract fun shortArrayOf(vararg elements: Short): ShortArray

创建 short[] 并将给定元素添加到数组中.

Link copied to clipboard

Array 转成 boolean[].

Link copied to clipboard
abstract fun toByteArray(array: ByteArray): ByteArray

Array 转成 byte[].

Link copied to clipboard
abstract fun toCharArray(array: CharArray): CharArray

Array 转成 char[].

Link copied to clipboard
abstract fun toDoubleArray(array: DoubleArray): DoubleArray

Array 转成 double[].

Link copied to clipboard
abstract fun toFloatArray(array: FloatArray): FloatArray

Array 转成 float[].

Link copied to clipboard
abstract fun toIntArray(array: IntArray): IntArray

Array 转成 int[].

Link copied to clipboard
abstract fun <T> toIterable(array: Array<T>): Iterable<T>

将数组转成 Iterable.

Link copied to clipboard
abstract fun <T> toList(array: Array<T>): List<T>

将数组转成 List.

Link copied to clipboard
abstract fun toLongArray(array: LongArray): LongArray

Array 转成 long[].

Link copied to clipboard
abstract fun <T> toMutableList(array: Array<T>): MutableList<T>

将数组转成 MutableList.

Link copied to clipboard
abstract fun <T> toMutableSet(array: Array<T>): MutableSet<T>

将数组转成 MutableSet.

Link copied to clipboard
abstract fun <T> toSequence(array: Array<T>): Sequence<T>

将数组转成 Sequence.

Link copied to clipboard
abstract fun <T> toSet(array: Array<T>): Set<T>

将数组转成 Set.

Link copied to clipboard
abstract fun toShortArray(array: ShortArray): ShortArray

Array 转成 short[].