Package dan200.computercraft.api.lua
Interface LuaTable<K,V>
- Type Parameters:
K
- The type of keys in a table, will typically be a wildcard.V
- The type of values in a table, will typically be a wildcard.
- All Superinterfaces:
Map<K,
V>
- All Known Implementing Classes:
ObjectLuaTable
A view of a Lua table, which may be able to access table elements in a more optimised manner than
IArguments.getTable(int)
.-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
clear()
default int
getInt
(int index) Get an array entry as an integer.default int
Get a table entry as an integer.default long
getLong
(int index) Get an array entry as an integer.default long
Get a table entry as an integer.default int
length()
Compute the length of the array part of this table.default V
default void
default V
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, putIfAbsent, remove, replace, replace, replaceAll, size, values
-
Method Details
-
length
default int length()Compute the length of the array part of this table.- Returns:
- This table's length.
-
getLong
Get an array entry as an integer.- Parameters:
index
- The index in the table, starting at 1.- Returns:
- The table's value.
- Throws:
LuaException
- If the value is not an integer.
-
getLong
Get a table entry as an integer.- Parameters:
key
- The name of the field in the table.- Returns:
- The table's value.
- Throws:
LuaException
- If the value is not an integer.
-
getInt
Get an array entry as an integer.- Parameters:
index
- The index in the table, starting at 1.- Returns:
- The table's value.
- Throws:
LuaException
- If the value is not an integer.
-
getInt
Get a table entry as an integer.- Parameters:
key
- The name of the field in the table.- Returns:
- The table's value.
- Throws:
LuaException
- If the value is not an integer.
-
put
-
remove
-
putAll
-
clear
default void clear()
-