BlowTorch
 All Classes Namespaces Files Functions Variables Enumerator Pages
Public Member Functions | Protected Attributes | List of all members
org.keplerproject.luajava.JavaFunction Class Referenceabstract
Inheritance diagram for org.keplerproject.luajava.JavaFunction:
Inheritance graph
[legend]
Collaboration diagram for org.keplerproject.luajava.JavaFunction:
Collaboration graph
[legend]

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
 

Detailed Description

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).

Constructor & Destructor Documentation

org.keplerproject.luajava.JavaFunction.JavaFunction ( LuaState  L)

Constructor that receives a LuaState.

Parameters
LLuaState object associated with this JavaFunction object

Member Function Documentation

abstract int org.keplerproject.luajava.JavaFunction.execute ( ) throws LuaException, RemoteException, UnsupportedEncodingException
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.

Returns
The number of values pushed onto the stack.
Exceptions
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).

Parameters
idxIndex of the parameter.
Returns
Reference to parameter.
See Also
LuaObject

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
namename of the function.

Here is the call graph for this function:

Member Data Documentation

LuaState org.keplerproject.luajava.JavaFunction.L
protected

This is the state in which this function will exist.


The documentation for this class was generated from the following file: