Iterables

interface Iterables : Variable

Iterable 操作相关接口.

Author

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

Functions

Link copied to clipboard
abstract fun getGlobalName(): String

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

Link copied to clipboard
abstract fun getPublicType(): Type

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

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 <T> listOf(vararg elements: T): List<T>

创建不可变的 List 并将给定元素添加到其中.

Link copied to clipboard
abstract fun <T> mutableListOf(vararg elements: T): MutableList<T>

创建可变的 MutableList 并将给定元素添加到其中.

Link copied to clipboard
abstract fun <T> mutableSetOf(vararg elements: T): MutableSet<T>

创建可变的 MutableSet 并将给定元素添加到其中.

Link copied to clipboard
abstract fun <T> setOf(vararg elements: T): Set<T>

创建不可变的 Set 并将给定元素添加到其中.

Link copied to clipboard
abstract fun <T> toList(iterable: Iterable<T>): List<T>

Iterable 转换为 List.

Link copied to clipboard
abstract fun <T> toMutableList(iterable: Iterable<T>): MutableList<T>

Iterable 转换为 MutableList.

Link copied to clipboard
abstract fun <T> toMutableSet(iterable: Iterable<T>): MutableSet<T>

Iterable 转换为 MutableSet.

Link copied to clipboard
abstract fun <T> toSequence(iterable: Iterable<T>): Sequence<T>

Iterable 转换为 Sequence.

Link copied to clipboard
abstract fun <T> toSet(iterable: Iterable<T>): Set<T>

Iterable 转换为 Set.

Link copied to clipboard
abstract fun <T> toTypedArray(collection: Collection<T>, clazz: Class<T>): Array<T>

转换 Collection 为指定类型的 Array.