Class WeakTable

java.lang.Object
com.prineside.luaj.WeakTable

public class WeakTable extends Object
Subclass of LuaTable that provides weak key and weak value semantics.

Normally these are not created directly, but indirectly when changing the mode of a LuaTable as lua script executes.

However, calling the constructors directly when weak tables are required from Java will reduce overhead.

  • Constructor Details

    • WeakTable

      public WeakTable(boolean weakkeys, boolean weakvalues, LuaValue backing)
      Construct a table with weak keys, weak values, or both
      Parameters:
      weakkeys - true to let the table have weak keys
      weakvalues - true to let the table have weak values
  • Method Details

    • make

      public static LuaTable make(boolean weakkeys, boolean weakvalues)
    • useWeakKeys

      public boolean useWeakKeys()
    • useWeakValues

      public boolean useWeakValues()
    • toLuaValue

      public LuaValue toLuaValue()
    • entry

      public LuaTable.Slot entry(LuaValue key, LuaValue value)
    • wrap

      public LuaValue wrap(LuaValue value)
    • arrayget

      public LuaValue arrayget(LuaValue[] array, int index)