Java Doc for LuaState.java in  » Scripting » LuaJava » org » keplerproject » luajava » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Scripting » LuaJava » org.keplerproject.luajava 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.keplerproject.luajava.LuaState

LuaState
public class LuaState (Code)
LuaState if the main class of LuaJava for the Java developer. LuaState is a mapping of most of Lua's C API functions. LuaState also provides many other functions that will be used to manipulate objects between Lua and Java.
author:
   Thiago Ponte


Field Summary
final public static  IntegerLUA_ERRERR
     error while running the error handler function.
final public static  IntegerLUA_ERRMEM
     memory allocation error.
final public static  IntegerLUA_ERRRUN
     a runtime error.
final public static  IntegerLUA_ERRSYNTAX
     syntax error during pre-compilation.
final public static  IntegerLUA_GCCOLLECT
    
final public static  IntegerLUA_GCCOUNT
    
final public static  IntegerLUA_GCCOUNTB
    
final public static  IntegerLUA_GCRESTART
    
final public static  IntegerLUA_GCSETPAUSE
    
final public static  IntegerLUA_GCSETSTEPMUL
    
final public static  IntegerLUA_GCSTEP
    
final public static  IntegerLUA_GCSTOP
    
final public static  IntegerLUA_GLOBALSINDEX
    
final public static  IntegerLUA_MULTRET
     Specifies that an unspecified (multiple) number of return arguments will be returned by a call.
final public static  IntegerLUA_REGISTRYINDEX
    
final public static  IntegerLUA_TBOOLEAN
    
final public static  IntegerLUA_TFUNCTION
    
final public static  IntegerLUA_TLIGHTUSERDATA
    
final public static  IntegerLUA_TNIL
    
final public static  IntegerLUA_TNONE
    
final public static  IntegerLUA_TNUMBER
    
final public static  IntegerLUA_TSTRING
    
final public static  IntegerLUA_TTABLE
    
final public static  IntegerLUA_TTHREAD
    
final public static  IntegerLUA_TUSERDATA
    
final public static  IntegerLUA_YIELD
    

Constructor Summary
protected  LuaState(int stateId)
    
protected  LuaState(CPtr luaState)
    

Method Summary
public  intLargError(int numArg, String extraMsg)
    
public  intLcallMeta(int obj, String e)
    
public  voidLcheckAny(int nArg)
    
public  intLcheckInteger(int numArg)
    
public  doubleLcheckNumber(int numArg)
    
public  voidLcheckStack(int sz, String msg)
    
public  StringLcheckString(int numArg)
    
public  voidLcheckType(int nArg, int t)
    
public  intLdoFile(String fileName)
    
public  intLdoString(String str)
    
public  StringLfindTable(int idx, String fname, int szhint)
    
public  intLgetMetaField(int obj, String e)
    
public  voidLgetMetatable(String tName)
    
public  intLgetN(int t)
    
public  StringLgsub(String s, String p, String r)
    
public  intLloadBuffer(byte[] buff, String name)
    
public  intLloadFile(String fileName)
    
public  intLloadString(String s)
    
public  intLnewMetatable(String tName)
    
public  intLoptInteger(int numArg, int def)
    
public  doubleLoptNumber(int numArg, double def)
    
public  StringLoptString(int numArg, String def)
    
public  intLref(int t)
    
public  voidLsetN(int t, int n)
    
public  intLtyperror(int nArg, String tName)
    
public  voidLunRef(int t, int ref)
    
public  voidLwhere(int lvl)
    
public  voidcall(int nArgs, int nResults)
    
public  intcheckStack(int sz)
    
public synchronized  voidclose()
    
public  voidconcat(int n)
    
public static  NumberconvertLuaNumber(Double db, Class retType)
    
public  voidcreateTable(int narr, int nrec)
    
public  intequal(int idx1, int idx2)
    
public  interror()
    
public  intgc(int what, int data)
    
public  longgetCPtrPeer()
    
public  voidgetFEnv(int idx)
    
public  voidgetField(int idx, String k)
    
public  intgetGcCount()
    
public synchronized  voidgetGlobal(String global)
    
public  LuaObjectgetLuaObject(String globalName)
    
public  LuaObjectgetLuaObject(LuaObject parent, String name)
    
public  LuaObjectgetLuaObject(LuaObject parent, Number name)
     This constructor creates a LuaObject from a table that is indexed by a number.
public  LuaObjectgetLuaObject(LuaObject parent, LuaObject name)
     This constructor creates a LuaObject from a table that is indexed by any LuaObject.
public  LuaObjectgetLuaObject(int index)
    
public  intgetMetaTable(int idx)
    
public  ObjectgetObjectFromUserdata(int idx)
    
public  voidgetTable(int idx)
    
public  intgetTop()
    
public  voidinsert(int idx)
    
public  booleanisBoolean(int idx)
    
public  booleanisCFunction(int idx)
    
public synchronized  booleanisClosed()
     Returns true if state is closed.
public  booleanisFunction(int idx)
    
public  booleanisJavaFunction(int idx)
    
public  booleanisNil(int idx)
    
public  booleanisNone(int idx)
    
public  booleanisNoneOrNil(int idx)
    
public  booleanisNumber(int idx)
    
public  booleanisObject(int idx)
    
public  booleanisString(int idx)
    
public  booleanisTable(int idx)
    
public  booleanisThread(int idx)
    
public  booleanisUserdata(int idx)
    
public  intlessthan(int idx1, int idx2)
    
public  voidnewTable()
    
public  LuaStatenewThread()
    
public  intnext(int idx)
    
public  intobjLen(int idx)
    
public  voidopenBase()
    
public  voidopenDebug()
    
public  voidopenIo()
    
public  voidopenLibs()
    
public  voidopenMath()
    
public  voidopenOs()
    
public  voidopenPackage()
    
public  voidopenString()
    
public  voidopenTable()
    
public  intpcall(int nArgs, int nResults, int errFunc)
    
public  voidpop(int n)
    
public  voidpushBoolean(boolean bool)
    
public  voidpushInteger(int integer)
    
public  voidpushJavaFunction(JavaFunction func)
    
public  voidpushJavaObject(Object obj)
     Pushes a Java Object into the lua stack.
This function does not check if the object is from a class that could be represented by a lua type.
public  voidpushNil()
    
public  voidpushNumber(double db)
    
public  voidpushObjectValue(Object obj)
     Pushes into the stack any object value.
This function checks if the object could be pushed as a lua type, if not pushes the java object.
public  voidpushString(String str)
    
public  voidpushString(byte[] bytes)
    
public  voidpushValue(int idx)
    
public  voidrawGet(int idx)
    
public  voidrawGetI(int idx, int n)
    
public  voidrawSet(int idx)
    
public  voidrawSetI(int idx, int n)
    
public  intrawequal(int idx1, int idx2)
    
public  voidremove(int idx)
    
public  voidreplace(int idx)
    
public  intresume(int nArgs)
    
public  intsetFEnv(int idx)
    
public  voidsetField(int idx, String k)
    
public synchronized  voidsetGlobal(String name)
    
public  intsetMetaTable(int idx)
    
public  voidsetTable(int idx)
    
public  voidsetTop(int idx)
    
public  intstatus()
    
public  intstrLen(int idx)
    
public  booleantoBoolean(int idx)
    
public  inttoInteger(int idx)
    
public synchronized  ObjecttoJavaObject(int idx)
     Function that returns a Java Object equivalent to the one in the given position of the Lua Stack.
public  doubletoNumber(int idx)
    
public  StringtoString(int idx)
    
public  LuaStatetoThread(int idx)
    
public  inttype(int idx)
    
public  StringtypeName(int tp)
    
public  voidxmove(LuaState to, int n)
    
public  intyield(int nResults)
    

Field Detail
LUA_ERRERR
final public static Integer LUA_ERRERR(Code)
error while running the error handler function.



LUA_ERRMEM
final public static Integer LUA_ERRMEM(Code)
memory allocation error. For such errors, Lua does not call the error handler function.



LUA_ERRRUN
final public static Integer LUA_ERRRUN(Code)
a runtime error.



LUA_ERRSYNTAX
final public static Integer LUA_ERRSYNTAX(Code)
syntax error during pre-compilation.



LUA_GCCOLLECT
final public static Integer LUA_GCCOLLECT(Code)



LUA_GCCOUNT
final public static Integer LUA_GCCOUNT(Code)



LUA_GCCOUNTB
final public static Integer LUA_GCCOUNTB(Code)



LUA_GCRESTART
final public static Integer LUA_GCRESTART(Code)



LUA_GCSETPAUSE
final public static Integer LUA_GCSETPAUSE(Code)



LUA_GCSETSTEPMUL
final public static Integer LUA_GCSETSTEPMUL(Code)



LUA_GCSTEP
final public static Integer LUA_GCSTEP(Code)



LUA_GCSTOP
final public static Integer LUA_GCSTOP(Code)



LUA_GLOBALSINDEX
final public static Integer LUA_GLOBALSINDEX(Code)



LUA_MULTRET
final public static Integer LUA_MULTRET(Code)
Specifies that an unspecified (multiple) number of return arguments will be returned by a call.



LUA_REGISTRYINDEX
final public static Integer LUA_REGISTRYINDEX(Code)



LUA_TBOOLEAN
final public static Integer LUA_TBOOLEAN(Code)



LUA_TFUNCTION
final public static Integer LUA_TFUNCTION(Code)



LUA_TLIGHTUSERDATA
final public static Integer LUA_TLIGHTUSERDATA(Code)



LUA_TNIL
final public static Integer LUA_TNIL(Code)



LUA_TNONE
final public static Integer LUA_TNONE(Code)



LUA_TNUMBER
final public static Integer LUA_TNUMBER(Code)



LUA_TSTRING
final public static Integer LUA_TSTRING(Code)



LUA_TTABLE
final public static Integer LUA_TTABLE(Code)



LUA_TTHREAD
final public static Integer LUA_TTHREAD(Code)



LUA_TUSERDATA
final public static Integer LUA_TUSERDATA(Code)



LUA_YIELD
final public static Integer LUA_YIELD(Code)




Constructor Detail
LuaState
protected LuaState(int stateId)(Code)
Constructor to instance a new LuaState and initialize it with LuaJava's functions
Parameters:
  stateId -



LuaState
protected LuaState(CPtr luaState)(Code)
Receives a existing state and initializes it
Parameters:
  luaState -




Method Detail
LargError
public int LargError(int numArg, String extraMsg)(Code)



LcallMeta
public int LcallMeta(int obj, String e)(Code)



LcheckAny
public void LcheckAny(int nArg)(Code)



LcheckInteger
public int LcheckInteger(int numArg)(Code)



LcheckNumber
public double LcheckNumber(int numArg)(Code)



LcheckStack
public void LcheckStack(int sz, String msg)(Code)



LcheckString
public String LcheckString(int numArg)(Code)



LcheckType
public void LcheckType(int nArg, int t)(Code)



LdoFile
public int LdoFile(String fileName)(Code)



LdoString
public int LdoString(String str)(Code)



LfindTable
public String LfindTable(int idx, String fname, int szhint)(Code)



LgetMetaField
public int LgetMetaField(int obj, String e)(Code)



LgetMetatable
public void LgetMetatable(String tName)(Code)



LgetN
public int LgetN(int t)(Code)



Lgsub
public String Lgsub(String s, String p, String r)(Code)



LloadBuffer
public int LloadBuffer(byte[] buff, String name)(Code)



LloadFile
public int LloadFile(String fileName)(Code)



LloadString
public int LloadString(String s)(Code)



LnewMetatable
public int LnewMetatable(String tName)(Code)



LoptInteger
public int LoptInteger(int numArg, int def)(Code)



LoptNumber
public double LoptNumber(int numArg, double def)(Code)



LoptString
public String LoptString(int numArg, String def)(Code)



Lref
public int Lref(int t)(Code)



LsetN
public void LsetN(int t, int n)(Code)



Ltyperror
public int Ltyperror(int nArg, String tName)(Code)



LunRef
public void LunRef(int t, int ref)(Code)



Lwhere
public void Lwhere(int lvl)(Code)



call
public void call(int nArgs, int nResults)(Code)



checkStack
public int checkStack(int sz)(Code)



close
public synchronized void close()(Code)
Closes state and removes the object from the LuaStateFactory



concat
public void concat(int n)(Code)



convertLuaNumber
public static Number convertLuaNumber(Double db, Class retType)(Code)
When you call a function in lua, it may return a number, and the number will be interpreted as a Double.
This function converts the number into a type specified by retType
Parameters:
  db - lua number to be converted
Parameters:
  retType - type to convert to The converted number



createTable
public void createTable(int narr, int nrec)(Code)



equal
public int equal(int idx1, int idx2)(Code)



error
public int error()(Code)



gc
public int gc(int what, int data)(Code)



getCPtrPeer
public long getCPtrPeer()(Code)
Return the long representing the LuaState pointer long



getFEnv
public void getFEnv(int idx)(Code)



getField
public void getField(int idx, String k)(Code)



getGcCount
public int getGcCount()(Code)



getGlobal
public synchronized void getGlobal(String global)(Code)



getLuaObject
public LuaObject getLuaObject(String globalName)(Code)
Creates a reference to an object in the variable globalName
Parameters:
  globalName - LuaObject



getLuaObject
public LuaObject getLuaObject(LuaObject parent, String name) throws LuaException(Code)
Creates a reference to an object inside another object
Parameters:
  parent - The Lua Table or Userdata that contains the Field.
Parameters:
  name - The name that index the field LuaObject
throws:
  LuaException - if parent is not a table or userdata



getLuaObject
public LuaObject getLuaObject(LuaObject parent, Number name) throws LuaException(Code)
This constructor creates a LuaObject from a table that is indexed by a number.
Parameters:
  parent - The Lua Table or Userdata that contains the Field.
Parameters:
  name - The name (number) that index the field LuaObject
throws:
  LuaException - When the parent object isn't a Table or Userdata



getLuaObject
public LuaObject getLuaObject(LuaObject parent, LuaObject name) throws LuaException(Code)
This constructor creates a LuaObject from a table that is indexed by any LuaObject.
Parameters:
  parent - The Lua Table or Userdata that contains the Field.
Parameters:
  name - The name (LuaObject) that index the field LuaObject
throws:
  LuaException - When the parent object isn't a Table or Userdata



getLuaObject
public LuaObject getLuaObject(int index)(Code)
Creates a reference to an object in the index position of the stack
Parameters:
  index - position on the stack LuaObject



getMetaTable
public int getMetaTable(int idx)(Code)



getObjectFromUserdata
public Object getObjectFromUserdata(int idx) throws LuaException(Code)
Gets a Object from Lua
Parameters:
  idx - index of the lua stack Object
throws:
  LuaException - if the lua object does not represent a java object.



getTable
public void getTable(int idx)(Code)



getTop
public int getTop()(Code)



insert
public void insert(int idx)(Code)



isBoolean
public boolean isBoolean(int idx)(Code)



isCFunction
public boolean isCFunction(int idx)(Code)



isClosed
public synchronized boolean isClosed()(Code)
Returns true if state is closed.



isFunction
public boolean isFunction(int idx)(Code)



isJavaFunction
public boolean isJavaFunction(int idx)(Code)
Returns whether a userdata contains a Java Function
Parameters:
  idx - index of the lua stack boolean



isNil
public boolean isNil(int idx)(Code)



isNone
public boolean isNone(int idx)(Code)



isNoneOrNil
public boolean isNoneOrNil(int idx)(Code)



isNumber
public boolean isNumber(int idx)(Code)



isObject
public boolean isObject(int idx)(Code)
Tells whether a lua index contains a java Object
Parameters:
  idx - index of the lua stack boolean



isString
public boolean isString(int idx)(Code)



isTable
public boolean isTable(int idx)(Code)



isThread
public boolean isThread(int idx)(Code)



isUserdata
public boolean isUserdata(int idx)(Code)



lessthan
public int lessthan(int idx1, int idx2)(Code)



newTable
public void newTable()(Code)



newThread
public LuaState newThread()(Code)



next
public int next(int idx)(Code)



objLen
public int objLen(int idx)(Code)



openBase
public void openBase()(Code)



openDebug
public void openDebug()(Code)



openIo
public void openIo()(Code)



openLibs
public void openLibs()(Code)



openMath
public void openMath()(Code)



openOs
public void openOs()(Code)



openPackage
public void openPackage()(Code)



openString
public void openString()(Code)



openTable
public void openTable()(Code)



pcall
public int pcall(int nArgs, int nResults, int errFunc)(Code)



pop
public void pop(int n)(Code)



pushBoolean
public void pushBoolean(boolean bool)(Code)



pushInteger
public void pushInteger(int integer)(Code)



pushJavaFunction
public void pushJavaFunction(JavaFunction func) throws LuaException(Code)
Pushes a JavaFunction into the state stack
Parameters:
  func -



pushJavaObject
public void pushJavaObject(Object obj)(Code)
Pushes a Java Object into the lua stack.
This function does not check if the object is from a class that could be represented by a lua type. Eg: java.lang.String could be a lua string.
Parameters:
  obj - Object to be pushed into lua



pushNil
public void pushNil()(Code)



pushNumber
public void pushNumber(double db)(Code)



pushObjectValue
public void pushObjectValue(Object obj) throws LuaException(Code)
Pushes into the stack any object value.
This function checks if the object could be pushed as a lua type, if not pushes the java object.
Parameters:
  obj -



pushString
public void pushString(String str)(Code)



pushString
public void pushString(byte[] bytes)(Code)



pushValue
public void pushValue(int idx)(Code)



rawGet
public void rawGet(int idx)(Code)



rawGetI
public void rawGetI(int idx, int n)(Code)



rawSet
public void rawSet(int idx)(Code)



rawSetI
public void rawSetI(int idx, int n)(Code)



rawequal
public int rawequal(int idx1, int idx2)(Code)



remove
public void remove(int idx)(Code)



replace
public void replace(int idx)(Code)



resume
public int resume(int nArgs)(Code)



setFEnv
public int setFEnv(int idx)(Code)



setField
public void setField(int idx, String k)(Code)



setGlobal
public synchronized void setGlobal(String name)(Code)



setMetaTable
public int setMetaTable(int idx)(Code)



setTable
public void setTable(int idx)(Code)



setTop
public void setTop(int idx)(Code)



status
public int status()(Code)



strLen
public int strLen(int idx)(Code)



toBoolean
public boolean toBoolean(int idx)(Code)



toInteger
public int toInteger(int idx)(Code)



toJavaObject
public synchronized Object toJavaObject(int idx) throws LuaException(Code)
Function that returns a Java Object equivalent to the one in the given position of the Lua Stack.
Parameters:
  idx - Index in the Lua Stack Java object equivalent to the Lua one



toNumber
public double toNumber(int idx)(Code)



toString
public String toString(int idx)(Code)



toThread
public LuaState toThread(int idx)(Code)



type
public int type(int idx)(Code)



typeName
public String typeName(int tp)(Code)



xmove
public void xmove(LuaState to, int n)(Code)



yield
public int yield(int nResults)(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.