Class WeakTable

java.lang.Object
com.prineside.luaj.WeakTable
All Implemented Interfaces:
com.esotericsoftware.kryo.KryoSerializable

public class WeakTable extends Object implements com.esotericsoftware.kryo.KryoSerializable
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

    • write

      public void write(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output)
      Specified by:
      write in interface com.esotericsoftware.kryo.KryoSerializable
    • read

      public void read(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input)
      Specified by:
      read in interface com.esotericsoftware.kryo.KryoSerializable
    • 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)