Table

data class Table(val value: MutableMap<Value, Value> = mutableMapOf(), var metatable: Value.Table? = Companion.metatable) : Value, MutableMap<Value, Value>

A table.

Parameters

value

The backing map of the table.

metatable

The metatable of the table.

Constructors

Link copied to clipboard
constructor(value: MutableMap<Value, Value> = mutableMapOf(), metatable: Value.Table? = Companion.metatable)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
open override val keys: MutableSet<Value>
Link copied to clipboard
open override var metatable: Value.Table?
Link copied to clipboard
open override val size: Int
Link copied to clipboard
Link copied to clipboard
open override val values: MutableCollection<Value>

Functions

Link copied to clipboard
inline fun <T> Value.asObj(): T

If this is a Value.Native, returns the native object, otherwise throws an error.

Link copied to clipboard

Converts this value to a kotlin.Boolean, or throws an error if it cannot be converted.

Link copied to clipboard

Converts this value to a Value.Bytes, or throws an error if it cannot be converted.

Link copied to clipboard
open override fun clear()
Link copied to clipboard
open fun compute(p0: Value, p1: BiFunction<in Value, in Value?, out Value?>): Value?
Link copied to clipboard
open fun computeIfAbsent(p0: Value, p1: Function<in Value, out Value>): Value
Link copied to clipboard
open fun computeIfPresent(p0: Value, p1: BiFunction<in Value, in Value, out Value?>): Value?
Link copied to clipboard
open override fun containsKey(key: Value): Boolean
Link copied to clipboard
open override fun containsValue(value: Value): Boolean
Link copied to clipboard
inline fun <T : Value> Value.convertTo(): T

Converts this value to a T, or throws an error if it cannot be converted.

Link copied to clipboard

Converts this value to a Double, or throws an error if it cannot be converted.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open fun forEach(p0: BiConsumer<in Value, in Value>)
Link copied to clipboard
open operator override fun get(key: Value): Value?
Link copied to clipboard
operator fun MutableMap<Value, Value>.get(key: String): Value?
Link copied to clipboard
open fun getOrDefault(key: Value, defaultValue: Value): Value
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

Converts this value to a Int, or throws an error if it cannot be converted.

Link copied to clipboard
open override fun isEmpty(): Boolean
Link copied to clipboard

Converts this value to a Value.List, or throws an error if it cannot be converted.

Link copied to clipboard
fun Value.lookUp(key: Value): Value?

Look up a value in this value, possibly using the metatable.

Link copied to clipboard
open override fun lookUpDirect(key: Value): Value?

Look up a value in this value.

Link copied to clipboard
fun Value.lookUpHierarchy(vararg keys: String): Value?

Look up a successive sequence of strings in this value.

Link copied to clipboard
open fun merge(p0: Value, p1: Value, p2: BiFunction<in Value, in Value, out Value?>): Value?
Link copied to clipboard

If this value is null, return Value.Null, otherwise return this value.

Link copied to clipboard
open override fun put(key: Value, value: Value): Value?
Link copied to clipboard
open override fun putAll(from: Map<out Value, Value>)
Link copied to clipboard
open fun putIfAbsent(p0: Value, p1: Value): Value?
Link copied to clipboard
open override fun remove(key: Value): Value?
open fun remove(key: Value, value: Value): Boolean
Link copied to clipboard
open fun replace(p0: Value, p1: Value): Value?
open fun replace(p0: Value, p1: Value, p2: Value): Boolean
Link copied to clipboard
open fun replaceAll(p0: BiFunction<in Value, in Value, out Value>)
Link copied to clipboard
fun Value.set(key: Value, value: Value): Boolean

Sets a value in this value, possibly using the metatable.

operator fun MutableMap<Value, Value>.set(key: String, value: Value)
Link copied to clipboard
open override fun setDirect(key: Value, value: Value): Boolean

Set a value in this value.

Link copied to clipboard
fun Value.setOrError(key: Value, value: Value)

Sets a value in this value, or throws an error if it cannot be set.

Link copied to clipboard

Converts this value to a String, or throws an error if it cannot be converted.

Link copied to clipboard

Converts this value to a Value.Table, or throws an error if it cannot be converted.

Link copied to clipboard
open override fun toString(): String