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

public interface LuaTable<K,V> extends Map<K,V>
A view of a Lua table, which may be able to access table elements in a more optimised manner than IArguments.getTable(int).
  • Method Details

    • length

      default int length()
      Compute the length of the array part of this table.
      Returns:
      This table's length.
    • getLong

      default long getLong(int index) throws LuaException
      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

      default long getLong(String key) throws LuaException
      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

      default int getInt(int index) throws LuaException
      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

      default int getInt(String key) throws LuaException
      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

      @Nullable default V put(K o, V o2)
      Specified by:
      put in interface Map<K,V>
    • remove

      default V remove(Object o)
      Specified by:
      remove in interface Map<K,V>
    • putAll

      default void putAll(Map<? extends K,? extends V> map)
      Specified by:
      putAll in interface Map<K,V>
    • clear

      default void clear()
      Specified by:
      clear in interface Map<K,V>