Public Member Functions | |
abstract int | execute () throws LuaException, RemoteException, UnsupportedEncodingException |
JavaFunction (LuaState L) | |
LuaObject | getParam (int idx) |
void | register (String name) throws LuaException |
Protected Attributes | |
LuaState | L |
JavaFunction is a class that can be used to implement a Lua function in Java. JavaFunction is an abstract class, so in order to use it you must extend this class and implement the execute
method. This execute
method is the method that will be called when you call the function from Lua. To register the JavaFunction in Lua use the method register(String name)
.
org.keplerproject.luajava.JavaFunction.JavaFunction | ( | LuaState | L | ) |
Constructor that receives a LuaState.
L | LuaState object associated with this JavaFunction object |
|
pure virtual |
This method is called from Lua. Any parameters can be taken with getParam
. A reference to the JavaFunctionWrapper itself is always the first parameter received. Values passed back as results of the function must be pushed onto the stack.
RemoteException | |
UnsupportedEncodingException |
Implemented in com.offsetnull.bt.window.Window.NoteFunction, com.offsetnull.bt.service.plugin.Plugin.TriggerEnabledFunction, com.offsetnull.bt.service.plugin.function.TriggerEnabledFunction, and com.offsetnull.bt.service.plugin.function.NoteFunction.
LuaObject org.keplerproject.luajava.JavaFunction.getParam | ( | int | idx | ) |
Returns a parameter received from Lua. Parameters are numbered from 1. A reference to the JavaFunction itself is always the first parameter received (the same as this
).
idx | Index of the parameter. |
void org.keplerproject.luajava.JavaFunction.register | ( | String | name | ) | throws LuaException |
Register a JavaFunction with a given name. This method registers in a global variable the JavaFunction specified.
name | name of the function. |
|
protected |
This is the state in which this function will exist.