Class TableLib

All Implemented Interfaces:
com.esotericsoftware.kryo.KryoSerializable

public class TableLib extends TwoArgFunction
Subclass of LibFunction which implements the lua standard table library.

Typically, this library is included as part of a call to either

 
 Globals globals = JsePlatform.standardGlobals();
 System.out.println( globals.get("table").get("length").call( LuaValue.tableOf() ) );
  

To instantiate and use it directly, link it into your globals table via LuaValue.load(LuaValue) using code such as:

 
 Globals globals = new Globals();
 globals.load(new JseBaseLib());
 globals.load(new PackageLib());
 globals.load(new TableLib());
 System.out.println( globals.get("table").get("length").call( LuaValue.tableOf() ) );
  

This has been implemented to match as closely as possible the behavior in the corresponding library in C.

See Also: