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

Public Member Functions

LuaState getLuaState ()
 
void push ()
 
boolean isNil ()
 
boolean isBoolean ()
 
boolean isNumber ()
 
boolean isString ()
 
boolean isFunction ()
 
boolean isJavaObject ()
 
boolean isJavaFunction ()
 
boolean isTable ()
 
boolean isUserdata ()
 
int type ()
 
boolean getBoolean ()
 
double getNumber ()
 
String getString ()
 
byte[] getBytes ()
 
Object getObject () throws LuaException
 
LuaObject getField (String field) throws LuaException
 
Object[] call (Object[] args, int nres) throws LuaException
 
Object call (Object[] args) throws LuaException
 
String toString ()
 
Object createProxy (String implem) throws ClassNotFoundException, LuaException
 

Protected Member Functions

 LuaObject (LuaState L, String globalName)
 
 LuaObject (LuaObject parent, String name) throws LuaException
 
 LuaObject (LuaObject parent, Number name) throws LuaException
 
 LuaObject (LuaObject parent, LuaObject name) throws LuaException
 
 LuaObject (LuaState L, int index)
 
void finalize ()
 

Protected Attributes

Integer ref
 
LuaState L
 

Detailed Description

This class represents a Lua object of any type. A LuaObject is constructed by a LuaState object using one of the four methods:

The LuaObject will represent only the object itself, not a variable or a stack index, so when you change a string, remember that strings are immutable objects in Lua, and the LuaObject you have will represent the old one.

Proxies

LuaJava allows you to implement a class in Lua, like said before. If you want to create this proxy from Java, you should have a LuaObject representing the table that has the functions that implement the interface. From this LuaObject you can call the createProxy(String implements). This method receives the string with the name of the interfaces implemented by the object separated by comma.

Author
Rizzato
Thiago Ponte

Constructor & Destructor Documentation

org.keplerproject.luajava.LuaObject.LuaObject ( LuaState  L,
String  globalName 
)
protected

Creates a reference to an object in the variable globalName

Parameters
L
globalName

Here is the call graph for this function:

org.keplerproject.luajava.LuaObject.LuaObject ( LuaObject  parent,
String  name 
) throws LuaException
protected

Creates a reference to an object inside another object

Parameters
parentThe Lua Table or Userdata that contains the Field.
nameThe name that index the field

Here is the call graph for this function:

org.keplerproject.luajava.LuaObject.LuaObject ( LuaObject  parent,
Number  name 
) throws LuaException
protected

This constructor creates a LuaObject from a table that is indexed by a number.

Parameters
parentThe Lua Table or Userdata that contains the Field.
nameThe name (number) that index the field
Exceptions
LuaExceptionWhen the parent object isn't a Table or Userdata

Here is the call graph for this function:

org.keplerproject.luajava.LuaObject.LuaObject ( LuaObject  parent,
LuaObject  name 
) throws LuaException
protected

This constructor creates a LuaObject from a table that is indexed by a LuaObject.

Parameters
parentThe Lua Table or Userdata that contains the Field.
nameThe name (LuaObject) that index the field
Exceptions
LuaExceptionWhen the parent object isn't a Table or Userdata

Here is the call graph for this function:

org.keplerproject.luajava.LuaObject.LuaObject ( LuaState  L,
int  index 
)
protected

Creates a reference to an object in the given index of the stack

Parameters
L
indexof the object on the lua stack

Member Function Documentation

Object [] org.keplerproject.luajava.LuaObject.call ( Object[]  args,
int  nres 
) throws LuaException

Calls the object represented by this using Lua function pcall.

Parameters
args- Call arguments
nres- Number of objects returned
Returns
Object[] - Returned Objects
Exceptions
LuaException

Here is the call graph for this function:

Here is the caller graph for this function:

Object org.keplerproject.luajava.LuaObject.call ( Object[]  args) throws LuaException

Calls the object represented by this using Lua function pcall. Returns 1 object

Parameters
args- Call arguments
Returns
Object - Returned Object
Exceptions
LuaException

Here is the call graph for this function:

Object org.keplerproject.luajava.LuaObject.createProxy ( String  implem) throws ClassNotFoundException, LuaException

Function that creates a java proxy to the object represented by this

Parameters
implemInterfaces that are implemented, separated by ,

Here is the call graph for this function:

Here is the caller graph for this function:

void org.keplerproject.luajava.LuaObject.finalize ( )
protected

Here is the call graph for this function:

boolean org.keplerproject.luajava.LuaObject.getBoolean ( )

Here is the call graph for this function:

Here is the caller graph for this function:

byte [] org.keplerproject.luajava.LuaObject.getBytes ( )

Here is the call graph for this function:

LuaObject org.keplerproject.luajava.LuaObject.getField ( String  field) throws LuaException

If this is a table or userdata tries to set a field value.

Here is the call graph for this function:

Here is the caller graph for this function:

LuaState org.keplerproject.luajava.LuaObject.getLuaState ( )

Gets the Object's State

double org.keplerproject.luajava.LuaObject.getNumber ( )

Here is the call graph for this function:

Here is the caller graph for this function:

Object org.keplerproject.luajava.LuaObject.getObject ( ) throws LuaException

Here is the call graph for this function:

Here is the caller graph for this function:

String org.keplerproject.luajava.LuaObject.getString ( )

Here is the call graph for this function:

Here is the caller graph for this function:

boolean org.keplerproject.luajava.LuaObject.isBoolean ( )

Here is the call graph for this function:

Here is the caller graph for this function:

boolean org.keplerproject.luajava.LuaObject.isFunction ( )

Here is the call graph for this function:

Here is the caller graph for this function:

boolean org.keplerproject.luajava.LuaObject.isJavaFunction ( )

Here is the call graph for this function:

Here is the caller graph for this function:

boolean org.keplerproject.luajava.LuaObject.isJavaObject ( )

Here is the call graph for this function:

Here is the caller graph for this function:

boolean org.keplerproject.luajava.LuaObject.isNil ( )

Here is the call graph for this function:

Here is the caller graph for this function:

boolean org.keplerproject.luajava.LuaObject.isNumber ( )

Here is the call graph for this function:

Here is the caller graph for this function:

boolean org.keplerproject.luajava.LuaObject.isString ( )

Here is the call graph for this function:

Here is the caller graph for this function:

boolean org.keplerproject.luajava.LuaObject.isTable ( )

Here is the call graph for this function:

Here is the caller graph for this function:

boolean org.keplerproject.luajava.LuaObject.isUserdata ( )

Here is the call graph for this function:

Here is the caller graph for this function:

void org.keplerproject.luajava.LuaObject.push ( )

Pushes the object represented by this into L's stack

Here is the call graph for this function:

Here is the caller graph for this function:

String org.keplerproject.luajava.LuaObject.toString ( )

Here is the call graph for this function:

int org.keplerproject.luajava.LuaObject.type ( )

Here is the call graph for this function:

Member Data Documentation

LuaState org.keplerproject.luajava.LuaObject.L
protected
Integer org.keplerproject.luajava.LuaObject.ref
protected

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