Class LuaArrayHelper
java.lang.Object
games.stendhal.server.core.scripting.lua.LuaArrayHelper
Handles some conversion of Java arrays to Lua tables.
-
Method Summary
Modifier and TypeMethodDescriptionstatic LuaArrayHelper
get()
Retrieves the static instance.Object[]
toArray(org.luaj.vm2.LuaTable table)
Converts a Lua table to Java array.toList(org.luaj.vm2.LuaTable table)
Converts a Lua table to Java list.org.luaj.vm2.LuaTable
Creates a Lua table from a Java array.org.luaj.vm2.LuaTable
Creates a Lua table from a Java list.
-
Method Details
-
get
Retrieves the static instance.- Returns:
- Static ArraysHelper instance.
-
toTable
Creates a Lua table from a Java array.- Parameters:
list
- Array containing values.- Returns:
- New LuaTable.
-
toTable
Creates a Lua table from a Java list.- Parameters:
list
- List containing values.- Returns:
- New LuaTable.
-
toList
Converts a Lua table to Java list.- Parameters:
table
- Table with contents to be transferred to new list.- Returns:
- New
List
instance.
-
toArray
Converts a Lua table to Java array.- Parameters:
table
- Table with contents to be transferred to new array.- Returns:
- New
Object[]
instance.
-