diff --git a/.gitignore b/.gitignore index d56dcf1a7..1aa8828b3 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ deploy *.iws *.iml .gradle +luaj-2.0.3/lib +luaj-2.0.3/*.jar diff --git a/build.gradle b/build.gradle index 54599037f..8f54cb981 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ } } dependencies { - classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT' + classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT' } } apply plugin: 'net.minecraftforge.gradle.forge' @@ -21,12 +21,12 @@ } */ -version = "1.79" +version = "1.80pr0" group = "dan200.computercraft" archivesBaseName = "ComputerCraft" minecraft { - version = "1.8.9-11.15.0.1715" + version = "1.9.4-12.17.0.1959" runDir = "run" replace '${version}', project.version @@ -35,7 +35,7 @@ // stable_# stables are built at the discretion of the MCP team. // Use non-default mappings at your own risk. they may not allways work. // simply re-run your setup task after changing the mappings to update your workspace. - mappings = "snapshot_20151224" + mappings = "snapshot_20160518" // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. } diff --git a/codesize.sh b/codesize.sh new file mode 100755 index 000000000..3a0540185 --- /dev/null +++ b/codesize.sh @@ -0,0 +1,6 @@ +#!/bin/sh +echo "Java code:" +cat `find src | grep \\.java$` | wc + +echo "Lua code:" +cat `find src/main/resources/assets/computercraft/lua` | wc diff --git a/deploy.sh b/deploy.sh old mode 100755 new mode 100644 diff --git a/gradlew b/gradlew old mode 100755 new mode 100644 diff --git a/luaj-2.0.3/LICENSE.txt b/luaj-2.0.3/LICENSE similarity index 100% rename from luaj-2.0.3/LICENSE.txt rename to luaj-2.0.3/LICENSE diff --git a/luaj-2.0.3/docs/api/allclasses-frame.html b/luaj-2.0.3/docs/api/allclasses-frame.html deleted file mode 100644 index 6ddfdee4f..000000000 --- a/luaj-2.0.3/docs/api/allclasses-frame.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - -All Classes (Luaj API) - - - - - - - - - - - -All Classes -
- - - - - -
BaseLib -
-Buffer -
-CoerceJavaToLua -
-CoerceLuaToJava -
-CoroutineLib -
-DebugLib -
-IoLib -
-JmeIoLib -
-JmePlatform -
-JseBaseLib -
-JseIoLib -
-JseMathLib -
-JseMathLib.JseMathLib1 -
-JseMathLib.JseMathLib2 -
-JseOsLib -
-JsePlatform -
-JseProcess -
-LibFunction -
-LoadState -
-LoadState.LuaCompiler -
-LocVars -
-Lua -
-LuaBoolean -
-LuaC -
-LuaClosure -
-LuaDouble -
-LuaError -
-LuaFunction -
-LuaInteger -
-LuajavaLib -
-LuaJC -
-LuaNil -
-LuaNumber -
-LuaString -
-LuaTable -
-LuaThread -
-LuaThread.CallStack -
-LuaUserdata -
-LuaValue -
-MathLib -
-OneArgFunction -
-OrphanedThread -
-OsLib -
-PackageLib -
-Print -
-Prototype -
-ResourceFinder -
-StringLib -
-TableLib -
-TailcallVarargs -
-ThreeArgFunction -
-TwoArgFunction -
-UpValue -
-VarArgFunction -
-Varargs -
-WeakTable -
-ZeroArgFunction -
-
- - - diff --git a/luaj-2.0.3/docs/api/allclasses-noframe.html b/luaj-2.0.3/docs/api/allclasses-noframe.html deleted file mode 100644 index cdc91184b..000000000 --- a/luaj-2.0.3/docs/api/allclasses-noframe.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - -All Classes (Luaj API) - - - - - - - - - - - -All Classes -
- - - - - -
BaseLib -
-Buffer -
-CoerceJavaToLua -
-CoerceLuaToJava -
-CoroutineLib -
-DebugLib -
-IoLib -
-JmeIoLib -
-JmePlatform -
-JseBaseLib -
-JseIoLib -
-JseMathLib -
-JseMathLib.JseMathLib1 -
-JseMathLib.JseMathLib2 -
-JseOsLib -
-JsePlatform -
-JseProcess -
-LibFunction -
-LoadState -
-LoadState.LuaCompiler -
-LocVars -
-Lua -
-LuaBoolean -
-LuaC -
-LuaClosure -
-LuaDouble -
-LuaError -
-LuaFunction -
-LuaInteger -
-LuajavaLib -
-LuaJC -
-LuaNil -
-LuaNumber -
-LuaString -
-LuaTable -
-LuaThread -
-LuaThread.CallStack -
-LuaUserdata -
-LuaValue -
-MathLib -
-OneArgFunction -
-OrphanedThread -
-OsLib -
-PackageLib -
-Print -
-Prototype -
-ResourceFinder -
-StringLib -
-TableLib -
-TailcallVarargs -
-ThreeArgFunction -
-TwoArgFunction -
-UpValue -
-VarArgFunction -
-Varargs -
-WeakTable -
-ZeroArgFunction -
-
- - - diff --git a/luaj-2.0.3/docs/api/constant-values.html b/luaj-2.0.3/docs/api/constant-values.html deleted file mode 100644 index 3608e3102..000000000 --- a/luaj-2.0.3/docs/api/constant-values.html +++ /dev/null @@ -1,960 +0,0 @@ - - - - - - -Constant Field Values (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Constant Field Values

-
-
-Contents - - - - - - -
-org.luaj.*
- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
org.luaj.vm2.LoadState
-public static final intLUA_TBOOLEAN1
-public static final intLUA_TFUNCTION6
-public static final intLUA_TINT-2
-public static final intLUA_TLIGHTUSERDATA2
-public static final intLUA_TNIL0
-public static final intLUA_TNONE-1
-public static final intLUA_TNUMBER3
-public static final intLUA_TSTRING4
-public static final intLUA_TTABLE5
-public static final intLUA_TTHREAD8
-public static final intLUA_TUSERDATA7
-public static final intLUA_TVALUE9
-public static final intLUAC_FORMAT0
-public static final intLUAC_HEADERSIZE12
-public static final intLUAC_VERSION81
-public static final intNUMBER_FORMAT_FLOATS_OR_DOUBLES0
-public static final intNUMBER_FORMAT_INTS_ONLY1
-public static final intNUMBER_FORMAT_NUM_PATCH_INT324
-public static final java.lang.StringSOURCE_BINARY_STRING"binary string"
- -

- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
org.luaj.vm2.Lua
-public static final java.lang.String_VERSION"Luaj 0.0"
-public static final intBITRK256
-public static final intiABC0
-public static final intiABx1
-public static final intiAsBx2
-public static final intLFIELDS_PER_FLUSH50
-public static final intLUA_MULTRET-1
-public static final intMASK_A16320
-public static final intMASK_B-8388608
-public static final intMASK_Bx-16384
-public static final intMASK_C8372224
-public static final intMASK_NOT_A-16321
-public static final intMASK_NOT_B8388607
-public static final intMASK_NOT_Bx16383
-public static final intMASK_NOT_C-8372225
-public static final intMASK_NOT_OP-64
-public static final intMASK_OP63
-public static final intMAX_OP63
-public static final intMAXARG_A255
-public static final intMAXARG_B511
-public static final intMAXARG_Bx262143
-public static final intMAXARG_C511
-public static final intMAXARG_sBx131071
-public static final intMAXINDEXRK255
-public static final intNO_REG255
-public static final intNUM_OPCODES38
-public static final intOP_ADD12
-public static final intOP_AND60
-public static final intOP_CALL28
-public static final intOP_CLOSE35
-public static final intOP_CLOSURE36
-public static final intOP_CONCAT21
-public static final intOP_DIV15
-public static final intOP_EQ23
-public static final intOP_FORLOOP31
-public static final intOP_FORPREP32
-public static final intOP_GE62
-public static final intOP_GETGLOBAL5
-public static final intOP_GETTABLE6
-public static final intOP_GETUPVAL4
-public static final intOP_GT63
-public static final intOP_JMP22
-public static final intOP_LE25
-public static final intOP_LEN20
-public static final intOP_LOADBOOL2
-public static final intOP_LOADK1
-public static final intOP_LOADNIL3
-public static final intOP_LT24
-public static final intOP_MOD16
-public static final intOP_MOVE0
-public static final intOP_MUL14
-public static final intOP_NEQ61
-public static final intOP_NEWTABLE10
-public static final intOP_NOT19
-public static final intOP_OR59
-public static final intOP_POW17
-public static final intOP_RETURN30
-public static final intOP_SELF11
-public static final intOP_SETGLOBAL7
-public static final intOP_SETLIST34
-public static final intOP_SETTABLE9
-public static final intOP_SETUPVAL8
-public static final intOP_SUB13
-public static final intOP_TAILCALL29
-public static final intOP_TEST26
-public static final intOP_TESTSET27
-public static final intOP_TFORLOOP33
-public static final intOP_UNM18
-public static final intOP_VARARG37
-public static final intOpArgK3
-public static final intOpArgN0
-public static final intOpArgR2
-public static final intOpArgU1
-public static final intPOS_A6
-public static final intPOS_B23
-public static final intPOS_Bx14
-public static final intPOS_C14
-public static final intPOS_OP0
-public static final intSIZE_A8
-public static final intSIZE_B9
-public static final intSIZE_Bx18
-public static final intSIZE_C9
-public static final intSIZE_OP6
-public static final intVARARG_HASARG1
-public static final intVARARG_ISVARARG2
-public static final intVARARG_NEEDSARG4
- -

- -

- - - - - - - - - - - - - - - - - - - - - - -
org.luaj.vm2.LuaDouble
-public static final java.lang.StringJSTR_NAN"nan"
-public static final java.lang.StringJSTR_NEGINF"-inf"
-public static final java.lang.StringJSTR_POSINF"inf"
- -

- -

- - - - - - - - - - - - -
org.luaj.vm2.LuaThread
-public static final intMAX_CALLSTACK256
- -

- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
org.luaj.vm2.LuaValue
-public static final intTBOOLEAN1
-public static final intTFUNCTION6
-public static final intTINT-2
-public static final intTLIGHTUSERDATA2
-public static final intTNIL0
-public static final intTNONE-1
-public static final intTNUMBER3
-public static final intTSTRING4
-public static final intTTABLE5
-public static final intTTHREAD8
-public static final intTUSERDATA7
-public static final intTVALUE9
- -

- -

- - - - - - - - - - - - -
org.luaj.vm2.compiler.LuaC
-public static final intMAXSTACK250
- -

- -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/deprecated-list.html b/luaj-2.0.3/docs/api/deprecated-list.html deleted file mode 100644 index 807e0a856..000000000 --- a/luaj-2.0.3/docs/api/deprecated-list.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - -Deprecated List (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Deprecated API

-
-
-Contents - -
- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/help-doc.html b/luaj-2.0.3/docs/api/help-doc.html deleted file mode 100644 index 44c84fe55..000000000 --- a/luaj-2.0.3/docs/api/help-doc.html +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - -API Help (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-How This API Document Is Organized

-
-This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.

-Overview

-
- -

-The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.

-

-Package

-
- -

-Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:

-
-

-Class/Interface

-
- -

-Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

-Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
- -

-Annotation Type

-
- -

-Each annotation type has its own separate page with the following sections:

-
- -

-Enum

-
- -

-Each enum has its own separate page with the following sections:

-
-

-Use

-
-Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.
-

-Tree (Class Hierarchy)

-
-There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object. -
-

-Deprecated API

-
-The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
-

-Index

-
-The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
-

-Prev/Next

-These links take you to the next or previous class, interface, package, or related page.

-Frames/No Frames

-These links show and hide the HTML frames. All pages are available with or without frames. -

-

-Serialized Form

-Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description. -

-

-Constant Field Values

-The Constant Field Values page lists the static final fields and their values. -

- - -This help file applies to API documentation generated using the standard doclet. - -
-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/index-all.html b/luaj-2.0.3/docs/api/index-all.html deleted file mode 100644 index 6fcb0fc97..000000000 --- a/luaj-2.0.3/docs/api/index-all.html +++ /dev/null @@ -1,4272 +0,0 @@ - - - - - - -Index (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -A B C D E F G H I J K L M N O P R S T U V W Y Z _
-

-A

-
-
add(LuaValue) - -Method in class org.luaj.vm2.LuaDouble -
  -
add(double) - -Method in class org.luaj.vm2.LuaDouble -
  -
add(LuaValue) - -Method in class org.luaj.vm2.LuaInteger -
  -
add(double) - -Method in class org.luaj.vm2.LuaInteger -
  -
add(int) - -Method in class org.luaj.vm2.LuaInteger -
  -
add(LuaValue) - -Method in class org.luaj.vm2.LuaString -
  -
add(double) - -Method in class org.luaj.vm2.LuaString -
  -
add(int) - -Method in class org.luaj.vm2.LuaString -
  -
ADD - -Static variable in class org.luaj.vm2.LuaValue -
LuaString constant with value "__add" for use as metatag -
add(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Add: Perform numeric add operation with another value - including metatag processing. -
add(double) - -Method in class org.luaj.vm2.LuaValue -
Add: Perform numeric add operation with another value - of double type with metatag processing -
add(int) - -Method in class org.luaj.vm2.LuaValue -
Add: Perform numeric add operation with another value - of int type with metatag processing -
and(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Perform boolean and with another operand, based on lua rules for boolean evaluation. -
append(byte) - -Method in class org.luaj.vm2.Buffer -
Append a single byte to the buffer. -
append(LuaValue) - -Method in class org.luaj.vm2.Buffer -
Append a LuaValue to the buffer. -
append(LuaString) - -Method in class org.luaj.vm2.Buffer -
Append a LuaString to the buffer. -
append(String) - -Method in class org.luaj.vm2.Buffer -
Append a Java String to the buffer. -
arg(int) - -Method in class org.luaj.vm2.LuaValue -
  -
arg(int) - -Method in class org.luaj.vm2.TailcallVarargs -
  -
arg(int) - -Method in class org.luaj.vm2.Varargs -
Get the n-th argument value (1-based). -
arg1() - -Method in class org.luaj.vm2.LuaValue -
  -
arg1() - -Method in class org.luaj.vm2.TailcallVarargs -
  -
arg1() - -Method in class org.luaj.vm2.Varargs -
Get the first argument in the list. -
argcheck(boolean, int, String) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a LuaValue when a user-supplied assertion passes, or throw an error. -
argerror(String) - -Method in class org.luaj.vm2.LuaValue -
Throw a LuaError indicating an invalid argument was supplied to a function -
argerror(int, String) - -Static method in class org.luaj.vm2.LuaValue -
Throw a LuaError indicating an invalid argument was supplied to a function -
aritherror() - -Method in class org.luaj.vm2.LuaValue -
Throw a LuaError based on an arithmetic error such as add, or pow, - typically due to an invalid operand type -
aritherror(String) - -Method in class org.luaj.vm2.LuaValue -
Throw a LuaError based on an arithmetic error such as add, or pow, - typically due to an invalid operand type -
arithmt(LuaValue, LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Perform metatag processing for arithmetic operations. -
arithmtwith(LuaValue, double) - -Method in class org.luaj.vm2.LuaValue -
Perform metatag processing for arithmetic operations when the left-hand-side is a number. -
array - -Variable in class org.luaj.vm2.LuaTable -
the array values -
assert_(boolean, String) - -Static method in class org.luaj.vm2.LuaValue -
Assert a condition is true, or throw a LuaError if not -
-
-

-B

-
-
BaseLib - Class in org.luaj.vm2.lib
Subclass of LibFunction which implements the lua basic library functions.
BaseLib() - -Constructor for class org.luaj.vm2.lib.BaseLib -
Construct a base libarary instance. -
bind(LuaValue, Class, String[]) - -Method in class org.luaj.vm2.lib.LibFunction -
Bind a set of library functions. -
bind(LuaValue, Class, String[], int) - -Method in class org.luaj.vm2.lib.LibFunction -
Bind a set of library functions, with an offset -
BITRK - -Static variable in class org.luaj.vm2.Lua -
this bit 1 means constant (0 means register) -
booleanValue() - -Method in class org.luaj.vm2.LuaBoolean -
Return the boolean value for this boolean -
Buffer - Class in org.luaj.vm2
String buffer for use in string library methods, optimized for production - of StrValue instances.
Buffer() - -Constructor for class org.luaj.vm2.Buffer -
Create buffer with default capacity -
Buffer(int) - -Constructor for class org.luaj.vm2.Buffer -
Create buffer with specified initial capacity -
Buffer(LuaValue) - -Constructor for class org.luaj.vm2.Buffer -
Create buffer with specified initial value -
buffer() - -Method in class org.luaj.vm2.LuaValue -
Convert the value to a Buffer for more efficient concatenation of - multiple strings. -
-
-

-C

-
-
call(LuaValue) - -Method in class org.luaj.vm2.lib.BaseLib -
  -
call(LuaValue) - -Method in class org.luaj.vm2.lib.IoLib -
  -
call(LuaValue) - -Method in class org.luaj.vm2.lib.jse.JseMathLib -
  -
call(LuaValue) - -Method in class org.luaj.vm2.lib.jse.JseMathLib.JseMathLib1 -
  -
call(LuaValue, LuaValue) - -Method in class org.luaj.vm2.lib.jse.JseMathLib.JseMathLib2 -
  -
call(LuaValue) - -Method in class org.luaj.vm2.lib.MathLib -
  -
call(LuaValue) - -Method in class org.luaj.vm2.lib.OneArgFunction -
  -
call() - -Method in class org.luaj.vm2.lib.OneArgFunction -
  -
call(LuaValue, LuaValue) - -Method in class org.luaj.vm2.lib.OneArgFunction -
  -
call(LuaValue, LuaValue, LuaValue) - -Method in class org.luaj.vm2.lib.OneArgFunction -
  -
call(LuaValue) - -Method in class org.luaj.vm2.lib.PackageLib -
  -
call(LuaValue) - -Method in class org.luaj.vm2.lib.StringLib -
  -
call(LuaValue) - -Method in class org.luaj.vm2.lib.TableLib -
  -
call(LuaValue, LuaValue, LuaValue) - -Method in class org.luaj.vm2.lib.ThreeArgFunction -
  -
call() - -Method in class org.luaj.vm2.lib.ThreeArgFunction -
  -
call(LuaValue) - -Method in class org.luaj.vm2.lib.ThreeArgFunction -
  -
call(LuaValue, LuaValue) - -Method in class org.luaj.vm2.lib.ThreeArgFunction -
  -
call(LuaValue, LuaValue) - -Method in class org.luaj.vm2.lib.TwoArgFunction -
  -
call() - -Method in class org.luaj.vm2.lib.TwoArgFunction -
  -
call(LuaValue) - -Method in class org.luaj.vm2.lib.TwoArgFunction -
  -
call(LuaValue, LuaValue, LuaValue) - -Method in class org.luaj.vm2.lib.TwoArgFunction -
  -
call() - -Method in class org.luaj.vm2.lib.VarArgFunction -
  -
call(LuaValue) - -Method in class org.luaj.vm2.lib.VarArgFunction -
  -
call(LuaValue, LuaValue) - -Method in class org.luaj.vm2.lib.VarArgFunction -
  -
call(LuaValue, LuaValue, LuaValue) - -Method in class org.luaj.vm2.lib.VarArgFunction -
  -
call() - -Method in class org.luaj.vm2.lib.ZeroArgFunction -
  -
call(LuaValue) - -Method in class org.luaj.vm2.lib.ZeroArgFunction -
  -
call(LuaValue, LuaValue) - -Method in class org.luaj.vm2.lib.ZeroArgFunction -
  -
call(LuaValue, LuaValue, LuaValue) - -Method in class org.luaj.vm2.lib.ZeroArgFunction -
  -
call() - -Method in class org.luaj.vm2.LuaClosure -
  -
call(LuaValue) - -Method in class org.luaj.vm2.LuaClosure -
  -
call(LuaValue, LuaValue) - -Method in class org.luaj.vm2.LuaClosure -
  -
call(LuaValue, LuaValue, LuaValue) - -Method in class org.luaj.vm2.LuaClosure -
  -
CALL - -Static variable in class org.luaj.vm2.LuaValue -
LuaString constant with value "__call" for use as metatag -
call() - -Method in class org.luaj.vm2.LuaValue -
Call this with 0 arguments, including metatag processing, - and return only the first return value. -
call(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Call this with 1 argument, including metatag processing, - and return only the first return value. -
call(LuaValue, LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Call this with 2 arguments, including metatag processing, - and return only the first return value. -
call(LuaValue, LuaValue, LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Call this with 3 arguments, including metatag processing, - and return only the first return value. -
callmt() - -Method in class org.luaj.vm2.LuaValue -
Get the metatag value for the CALL metatag, if it exists. -
CALLS - -Static variable in class org.luaj.vm2.lib.DebugLib -
  -
changemode(boolean, boolean) - -Method in class org.luaj.vm2.LuaTable -
Change the mode of a table -
changemode(boolean, boolean) - -Method in class org.luaj.vm2.WeakTable -
  -
char_(Varargs) - -Static method in class org.luaj.vm2.lib.StringLib -
string.char (...) - - Receives zero or more integers. -
charAt(int) - -Method in class org.luaj.vm2.LuaString -
  -
checkboolean() - -Method in class org.luaj.vm2.LuaBoolean -
  -
checkboolean() - -Method in class org.luaj.vm2.LuaValue -
Check that the value is a LuaBoolean, - or throw LuaError if not -
checkboolean(int) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a boolean value, or throw an error if any other type. -
checkclosure() - -Method in class org.luaj.vm2.LuaClosure -
  -
checkclosure() - -Method in class org.luaj.vm2.LuaValue -
Check that the value is a LuaClosure , - or throw LuaError if not -
checkclosure(int) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a closure, or throw an error if any other type. -
checkdouble() - -Method in class org.luaj.vm2.LuaDouble -
  -
checkdouble() - -Method in class org.luaj.vm2.LuaInteger -
  -
checkdouble() - -Method in class org.luaj.vm2.LuaString -
  -
checkdouble() - -Method in class org.luaj.vm2.LuaValue -
Check that the value is numeric and return the value as a double, - or throw LuaError if not numeric -
checkdouble(int) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a double, or throw an error if it cannot be converted to one. -
checkfunction() - -Method in class org.luaj.vm2.LuaFunction -
  -
checkfunction() - -Method in class org.luaj.vm2.LuaValue -
Check that the value is a function , or throw LuaError if not -
checkfunction(int) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a function, or throw an error if an incompatible type. -
checkint() - -Method in class org.luaj.vm2.LuaDouble -
  -
checkint() - -Method in class org.luaj.vm2.LuaInteger -
  -
checkint() - -Method in class org.luaj.vm2.LuaString -
  -
checkint() - -Method in class org.luaj.vm2.LuaValue -
Check that the value is numeric, and convert and cast value to int, or throw LuaError if not numeric -
checkint(int) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a java int value, discarding any fractional part, or throw an error if not a number. -
checkinteger() - -Method in class org.luaj.vm2.LuaDouble -
  -
checkinteger() - -Method in class org.luaj.vm2.LuaInteger -
  -
checkinteger() - -Method in class org.luaj.vm2.LuaString -
  -
checkinteger() - -Method in class org.luaj.vm2.LuaValue -
Check that the value is numeric, and convert and cast value to int, or throw LuaError if not numeric -
checkinteger(int) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a java int value, or throw an error if not a number or is not representable by a java int. -
checkjstring() - -Method in class org.luaj.vm2.LuaDouble -
  -
checkjstring() - -Method in class org.luaj.vm2.LuaInteger -
  -
checkjstring() - -Method in class org.luaj.vm2.LuaString -
  -
checkjstring() - -Method in class org.luaj.vm2.LuaValue -
Convert this value to a Java String. -
checkjstring(int) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a java String if a string or number, or throw an error if any other type -
checklong() - -Method in class org.luaj.vm2.LuaDouble -
  -
checklong() - -Method in class org.luaj.vm2.LuaInteger -
  -
checklong() - -Method in class org.luaj.vm2.LuaString -
  -
checklong() - -Method in class org.luaj.vm2.LuaValue -
Check that the value is numeric, and convert and cast value to long, or throw LuaError if not numeric -
checklong(int) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a java long value, discarding any fractional part, or throw an error if not a number. -
checkmetatag(LuaValue, String) - -Method in class org.luaj.vm2.LuaValue -
Get particular metatag, or throw LuaError if it doesn't exist -
checknotnil() - -Method in class org.luaj.vm2.LuaNil -
  -
checknotnil() - -Method in class org.luaj.vm2.LuaValue -
Check that this is not the value NIL, or throw LuaError if it is -
checknotnil(int) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a LuaValue if it is not nil, or throw an error if it is nil. -
checknumber() - -Method in class org.luaj.vm2.LuaDouble -
  -
checknumber() - -Method in class org.luaj.vm2.LuaNumber -
  -
checknumber(String) - -Method in class org.luaj.vm2.LuaNumber -
  -
checknumber() - -Method in class org.luaj.vm2.LuaString -
  -
checknumber(String) - -Method in class org.luaj.vm2.LuaString -
  -
checknumber() - -Method in class org.luaj.vm2.LuaValue -
Check that the value is numeric, and return as a LuaNumber if so, or throw LuaError -
checknumber(String) - -Method in class org.luaj.vm2.LuaValue -
Check that the value is numeric, and return as a LuaNumber if so, or throw LuaError -
checknumber(int) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a LuaNumber, or throw an error if not a number or string that can be converted to a number. -
checkstring() - -Method in class org.luaj.vm2.LuaDouble -
  -
checkstring() - -Method in class org.luaj.vm2.LuaInteger -
  -
checkstring() - -Method in class org.luaj.vm2.LuaString -
  -
checkstring() - -Method in class org.luaj.vm2.LuaValue -
Check that this is a lua string, or throw LuaError if it is not. -
checkstring(int) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a LuaString if a string or number, or throw an error if any other type -
checktable() - -Method in class org.luaj.vm2.LuaTable -
  -
checktable() - -Method in class org.luaj.vm2.LuaValue -
Check that this is a LuaTable, or throw LuaError if it is not -
checktable(int) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a LuaTable if a lua table, or throw an error if any other type. -
checkthread() - -Method in class org.luaj.vm2.LuaThread -
  -
checkthread() - -Method in class org.luaj.vm2.LuaValue -
Check that this is a LuaThread, or throw LuaError if it is not -
checkthread(int) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a LuaThread if a lua thread, or throw an error if any other type. -
checkuserdata() - -Method in class org.luaj.vm2.LuaUserdata -
  -
checkuserdata(Class) - -Method in class org.luaj.vm2.LuaUserdata -
  -
checkuserdata() - -Method in class org.luaj.vm2.LuaValue -
Check that this is a LuaUserdata, or throw LuaError if it is not -
checkuserdata(Class) - -Method in class org.luaj.vm2.LuaValue -
Check that this is a LuaUserdata, or throw LuaError if it is not -
checkuserdata(int) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a java Object if a userdata, or throw an error if any other type. -
checkuserdata(int, Class) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a java Object if it is a userdata whose instance Class c or a subclass, - or throw an error if any other type. -
checkvalidkey() - -Method in class org.luaj.vm2.LuaDouble -
  -
checkvalidkey() - -Method in class org.luaj.vm2.LuaNil -
  -
checkvalidkey() - -Method in class org.luaj.vm2.LuaValue -
Check that this is a valid key in a table index operation, or throw LuaError if not -
checkvalue(int) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a LuaValue if it exists, or throw an error. -
classForName(String) - -Method in class org.luaj.vm2.lib.jse.LuajavaLib -
  -
clock() - -Method in class org.luaj.vm2.lib.OsLib -
  -
close() - -Method in class org.luaj.vm2.lib.IoLib.File -
  -
close() - -Method in class org.luaj.vm2.UpValue -
Close this upvalue so it is no longer on the stack -
code - -Variable in class org.luaj.vm2.Prototype -
  -
coerce(Object) - -Static method in class org.luaj.vm2.lib.jse.CoerceJavaToLua -
Coerse a Java object to a corresponding lua value. -
coerce(LuaValue, Class) - -Static method in class org.luaj.vm2.lib.jse.CoerceLuaToJava -
Coerce a LuaValue value to a specified java class -
CoerceJavaToLua - Class in org.luaj.vm2.lib.jse
Helper class to coerce values from Java to lua within the luajava library.
CoerceJavaToLua() - -Constructor for class org.luaj.vm2.lib.jse.CoerceJavaToLua -
  -
CoerceLuaToJava - Class in org.luaj.vm2.lib.jse
Helper class to coerce values from lua to Java within the luajava library.
CoerceLuaToJava() - -Constructor for class org.luaj.vm2.lib.jse.CoerceLuaToJava -
  -
compareerror(String) - -Method in class org.luaj.vm2.LuaValue -
Throw a LuaError based on a comparison error such as greater-than or less-than, - typically due to an invalid operand type -
compareerror(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Throw a LuaError based on a comparison error such as greater-than or less-than, - typically due to an invalid operand type -
comparemt(LuaValue, LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Perform metatag processing for comparison operations. -
compile(InputStream, String) - -Static method in class org.luaj.vm2.compiler.LuaC -
Compile a prototype or load as a binary chunk -
compileAll(InputStream, String, String) - -Method in class org.luaj.vm2.luajc.LuaJC -
  -
compiler - -Static variable in class org.luaj.vm2.LoadState -
Compiler instance, if installed -
concat(LuaValue) - -Method in class org.luaj.vm2.LuaNumber -
  -
concat(Buffer) - -Method in class org.luaj.vm2.LuaNumber -
  -
concat(LuaValue) - -Method in class org.luaj.vm2.LuaString -
  -
concat(Buffer) - -Method in class org.luaj.vm2.LuaString -
  -
concat(LuaString, int, int) - -Method in class org.luaj.vm2.LuaTable -
Concatenate the contents of a table efficiently, using Buffer -
CONCAT - -Static variable in class org.luaj.vm2.LuaValue -
LuaString constant with value "__concat" for use as metatag -
concat(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Concatenate another value onto this value and return the result - using rules of lua string concatenation including metatag processing. -
concat(Buffer) - -Method in class org.luaj.vm2.LuaValue -
Concatenate a Buffer onto this value and return the result - using rules of lua string concatenation including metatag processing. -
concatmt(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Perform metatag processing for concatenation operations. -
concatTo(LuaValue) - -Method in class org.luaj.vm2.Buffer -
Concatenate this buffer onto a LuaValue -
concatTo(LuaString) - -Method in class org.luaj.vm2.Buffer -
Concatenate this buffer onto a LuaString -
concatTo(LuaNumber) - -Method in class org.luaj.vm2.Buffer -
Concatenate this buffer onto a LuaNumber -
concatTo(LuaNumber) - -Method in class org.luaj.vm2.LuaNumber -
  -
concatTo(LuaString) - -Method in class org.luaj.vm2.LuaNumber -
  -
concatTo(LuaNumber) - -Method in class org.luaj.vm2.LuaString -
  -
concatTo(LuaString) - -Method in class org.luaj.vm2.LuaString -
  -
concatTo(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Reverse-concatenation: concatenate this value onto another value - whose type is unknwon - and return the result using rules of lua string concatenation including - metatag processing. -
concatTo(LuaNumber) - -Method in class org.luaj.vm2.LuaValue -
Reverse-concatenation: concatenate this value onto another value - known to be a LuaNumber - and return the result using rules of lua string concatenation including - metatag processing. -
concatTo(LuaString) - -Method in class org.luaj.vm2.LuaValue -
Reverse-concatenation: concatenate this value onto another value - known to be a LuaString - and return the result using rules of lua string concatenation including - metatag processing. -
copyInto(int, byte[], int, int) - -Method in class org.luaj.vm2.LuaString -
Copy the bytes of the string into the given byte array. -
coroutine_count - -Static variable in class org.luaj.vm2.LuaThread -
  -
CoroutineLib - Class in org.luaj.vm2.lib
Subclass of LibFunction which implements the lua standard coroutine - library.
CoroutineLib() - -Constructor for class org.luaj.vm2.lib.CoroutineLib -
  -
-
-

-D

-
-
date(String, double) - -Method in class org.luaj.vm2.lib.OsLib -
If the time argument is present, this is the time to be formatted - (see the os.time function for a description of this value). -
ddiv(double, double) - -Static method in class org.luaj.vm2.LuaDouble -
Divide two double numbers according to lua math, and return a LuaValue result. -
ddiv_d(double, double) - -Static method in class org.luaj.vm2.LuaDouble -
Divide two double numbers according to lua math, and return a double result. -
DEBUG_ENABLED - -Static variable in class org.luaj.vm2.lib.DebugLib -
  -
debugBytecode(int, Varargs, int) - -Static method in class org.luaj.vm2.lib.DebugLib -
Called by Closures on bytecode execution -
debugGlobals() - -Static method in class org.luaj.vm2.lib.jme.JmePlatform -
Create standard globals including the debug library. -
debugGlobals() - -Static method in class org.luaj.vm2.lib.jse.JsePlatform -
Create standard globals including the debug library. -
DebugLib - Class in org.luaj.vm2.lib
Subclass of LibFunction which implements the lua standard debug - library.
DebugLib() - -Constructor for class org.luaj.vm2.lib.DebugLib -
  -
debugOnCall(LuaThread, int, LuaFunction) - -Static method in class org.luaj.vm2.lib.DebugLib -
Called by Closures and recursing java functions on entry -
debugOnReturn(LuaThread, int) - -Static method in class org.luaj.vm2.lib.DebugLib -
Called by Closures and recursing java functions on return -
debugSetupCall(Varargs, LuaValue[]) - -Static method in class org.luaj.vm2.lib.DebugLib -
Called by Closures to set up stack and arguments to next call -
debugState - -Variable in class org.luaj.vm2.LuaThread -
Thread-local used by DebugLib to store debugging state. -
decodeAsUtf8(byte[], int, int) - -Static method in class org.luaj.vm2.LuaString -
Convert to Java String interpreting as utf8 characters. -
DEFAULT_LUA_PATH - -Static variable in class org.luaj.vm2.lib.PackageLib -
  -
difftime(double, double) - -Method in class org.luaj.vm2.lib.OsLib -
Returns the number of seconds from time t1 to time t2. -
div(LuaValue) - -Method in class org.luaj.vm2.LuaDouble -
  -
div(double) - -Method in class org.luaj.vm2.LuaDouble -
  -
div(int) - -Method in class org.luaj.vm2.LuaDouble -
  -
div(LuaValue) - -Method in class org.luaj.vm2.LuaInteger -
  -
div(double) - -Method in class org.luaj.vm2.LuaInteger -
  -
div(int) - -Method in class org.luaj.vm2.LuaInteger -
  -
div(LuaValue) - -Method in class org.luaj.vm2.LuaString -
  -
div(double) - -Method in class org.luaj.vm2.LuaString -
  -
div(int) - -Method in class org.luaj.vm2.LuaString -
  -
DIV - -Static variable in class org.luaj.vm2.LuaValue -
LuaString constant with value "__div" for use as metatag -
div(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Divide: Perform numeric divide operation by another value - of unknown type, - including metatag processing. -
div(double) - -Method in class org.luaj.vm2.LuaValue -
Divide: Perform numeric divide operation by another value - of double type without metatag processing -
div(int) - -Method in class org.luaj.vm2.LuaValue -
Divide: Perform numeric divide operation by another value - of int type without metatag processing -
divInto(double) - -Method in class org.luaj.vm2.LuaDouble -
  -
divInto(double) - -Method in class org.luaj.vm2.LuaInteger -
  -
divInto(double) - -Method in class org.luaj.vm2.LuaString -
  -
divInto(double) - -Method in class org.luaj.vm2.LuaValue -
Reverse-divide: Perform numeric divide operation into another value - with metatag processing -
dmod(double, double) - -Static method in class org.luaj.vm2.LuaDouble -
Take modulo double numbers according to lua math, and return a LuaValue result. -
dmod_d(double, double) - -Static method in class org.luaj.vm2.LuaDouble -
Take modulo for double numbers according to lua math, and return a double result. -
dpow(double, double) - -Static method in class org.luaj.vm2.lib.MathLib -
compute power using installed math library, or default if there is no math library installed -
dpow_d(double, double) - -Static method in class org.luaj.vm2.lib.MathLib -
  -
dpow_default(double, double) - -Static method in class org.luaj.vm2.lib.MathLib -
Default JME version computes using longhand heuristics. -
dpow_lib(double, double) - -Method in class org.luaj.vm2.lib.jse.JseMathLib -
Faster, better version of pow() used by arithmetic operator ^ -
dpow_lib(double, double) - -Method in class org.luaj.vm2.lib.MathLib -
Hook to override default dpow behavior with faster implementation. -
-
-

-E

-
-
EMPTYSTRING - -Static variable in class org.luaj.vm2.LuaValue -
LuaString constant with value "" -
encodeToUtf8(char[], byte[], int) - -Static method in class org.luaj.vm2.LuaString -
Encode the given Java string as UTF-8 bytes, writing the result to bytes - starting at offset. -
endpc - -Variable in class org.luaj.vm2.LocVars -
The instruction offset when the variable goes out of scope -
env - -Variable in class org.luaj.vm2.LuaFunction -
  -
eq(LuaValue) - -Method in class org.luaj.vm2.LuaDouble -
  -
eq(LuaValue) - -Method in class org.luaj.vm2.LuaInteger -
  -
eq(LuaValue) - -Method in class org.luaj.vm2.LuaString -
  -
eq(LuaValue) - -Method in class org.luaj.vm2.LuaTable -
  -
eq(LuaValue) - -Method in class org.luaj.vm2.LuaUserdata -
  -
EQ - -Static variable in class org.luaj.vm2.LuaValue -
LuaString constant with value "__eq" for use as metatag -
eq(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Equals: Perform equality comparison with another value - including metatag processing using EQ. -
eq_b(LuaValue) - -Method in class org.luaj.vm2.LuaDouble -
  -
eq_b(LuaValue) - -Method in class org.luaj.vm2.LuaInteger -
  -
eq_b(LuaValue) - -Method in class org.luaj.vm2.LuaString -
  -
eq_b(LuaValue) - -Method in class org.luaj.vm2.LuaTable -
  -
eq_b(LuaValue) - -Method in class org.luaj.vm2.LuaUserdata -
  -
eq_b(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Equals: Perform equality comparison with another value - including metatag processing using EQ, - and return java boolean -
eqmt(LuaValue) - -Method in class org.luaj.vm2.LuaUserdata -
  -
eqmtcall(LuaValue, LuaValue, LuaValue, LuaValue) - -Static method in class org.luaj.vm2.LuaValue -
Perform equality testing metatag processing -
equals(Object) - -Method in class org.luaj.vm2.LuaDouble -
  -
equals(Object) - -Method in class org.luaj.vm2.LuaInteger -
  -
equals(Object) - -Method in class org.luaj.vm2.LuaNil -
  -
equals(Object) - -Method in class org.luaj.vm2.LuaString -
  -
equals(LuaString, int, LuaString, int, int) - -Static method in class org.luaj.vm2.LuaString -
  -
equals(byte[], int, byte[], int, int) - -Static method in class org.luaj.vm2.LuaString -
  -
equals(Object) - -Method in class org.luaj.vm2.LuaUserdata -
  -
equals(Object) - -Method in class org.luaj.vm2.LuaValue -
  -
err - -Variable in class org.luaj.vm2.LuaThread -
Field to hold state of error condition during debug hook function calls. -
error(String) - -Static method in class org.luaj.vm2.LuaValue -
Throw a LuaError with a particular message -
eval() - -Method in class org.luaj.vm2.TailcallVarargs -
  -
eval() - -Method in class org.luaj.vm2.Varargs -
Evaluate any pending tail call and return result. -
EXEC_ERROR - -Static variable in class org.luaj.vm2.lib.jse.JseOsLib -
return code indicating the execute() threw an unknown exception -
EXEC_INTERRUPTED - -Static variable in class org.luaj.vm2.lib.jse.JseOsLib -
return code indicating the execute() was interrupted -
EXEC_IOEXCEPTION - -Static variable in class org.luaj.vm2.lib.jse.JseOsLib -
return code indicating the execute() threw an I/O exception -
execute(String) - -Method in class org.luaj.vm2.lib.jse.JseOsLib -
  -
execute(String) - -Method in class org.luaj.vm2.lib.OsLib -
This function is equivalent to the C function system. -
execute(LuaValue[], Varargs) - -Method in class org.luaj.vm2.LuaClosure -
  -
exit(int) - -Method in class org.luaj.vm2.lib.OsLib -
Calls the C function exit, with an optional code, to terminate the host program. -
exitValue() - -Method in class org.luaj.vm2.lib.jse.JseProcess -
Get the exit value of the process. -
-
-

-F

-
-
FALSE - -Static variable in class org.luaj.vm2.LuaValue -
LuaBoolean constant corresponding to lua false -
FILE_NAMES - -Static variable in class org.luaj.vm2.lib.IoLib -
  -
fileline() - -Static method in class org.luaj.vm2.lib.DebugLib -
Get file and line for the nearest calling closure. -
fileline(int) - -Static method in class org.luaj.vm2.lib.DebugLib -
Get file and line for a particular level, even if it is a java function. -
FINDER - -Static variable in class org.luaj.vm2.lib.BaseLib -
Singleton file opener for this Java ClassLoader realm. -
findResource(String) - -Method in class org.luaj.vm2.lib.BaseLib -
ResourceFinder implementation - - Tries to open the file as a resource, which can work for . -
findResource(String) - -Method in class org.luaj.vm2.lib.jse.JseBaseLib -
Try to open a file in the current working directory, - or fall back to base opener if not found. -
findResource(String) - -Method in interface org.luaj.vm2.lib.ResourceFinder -
Try to open a file, or return null if not found. -
flush() - -Method in class org.luaj.vm2.lib.IoLib.File -
  -
foreach(LuaValue) - -Method in class org.luaj.vm2.LuaTable -
Call the supplied function once for each key-value pair -
foreachi(LuaValue) - -Method in class org.luaj.vm2.LuaTable -
Call the supplied function once for each key-value pair - in the contiguous array part -
freadall(IoLib.File) - -Static method in class org.luaj.vm2.lib.IoLib -
  -
freadbytes(IoLib.File, int) - -Static method in class org.luaj.vm2.lib.IoLib -
  -
freadline(IoLib.File) - -Static method in class org.luaj.vm2.lib.IoLib -
  -
freadnumber(IoLib.File) - -Static method in class org.luaj.vm2.lib.IoLib -
  -
freaduntil(IoLib.File, boolean) - -Static method in class org.luaj.vm2.lib.IoLib -
  -
-
-

-G

-
-
GC_INTERVAL - -Static variable in class org.luaj.vm2.LuaThread -
Interval to check for LuaThread dereferencing. -
get(LuaValue) - -Method in class org.luaj.vm2.lib.IoLib.File -
  -
get(LuaValue) - -Method in class org.luaj.vm2.LuaString -
  -
get(int) - -Method in class org.luaj.vm2.LuaTable -
  -
get(LuaValue) - -Method in class org.luaj.vm2.LuaTable -
  -
get(LuaValue) - -Method in class org.luaj.vm2.LuaUserdata -
  -
get(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Get a value in a table including metatag processing using INDEX. -
get(int) - -Method in class org.luaj.vm2.LuaValue -
Get a value in a table including metatag processing using INDEX. -
get(String) - -Method in class org.luaj.vm2.LuaValue -
Get a value in a table including metatag processing using INDEX. -
GET_OPCODE(int) - -Static method in class org.luaj.vm2.Lua -
  -
GETARG_A(int) - -Static method in class org.luaj.vm2.Lua -
  -
GETARG_B(int) - -Static method in class org.luaj.vm2.Lua -
  -
GETARG_Bx(int) - -Static method in class org.luaj.vm2.Lua -
  -
GETARG_C(int) - -Static method in class org.luaj.vm2.Lua -
  -
GETARG_sBx(int) - -Static method in class org.luaj.vm2.Lua -
  -
getArrayLength() - -Method in class org.luaj.vm2.LuaTable -
Get the length of the array part of the table. -
getArrayLength() - -Method in class org.luaj.vm2.WeakTable -
  -
getBMode(int) - -Static method in class org.luaj.vm2.Lua -
  -
getCallstackDepth() - -Method in class org.luaj.vm2.LuaThread.CallStack -
Get number of calls in stack -
getCallstackFunction(int) - -Static method in class org.luaj.vm2.LuaThread -
Get the function called as a specific location on the stack. -
getCause() - -Method in exception org.luaj.vm2.LuaError -
Get the cause, if any. -
getCMode(int) - -Static method in class org.luaj.vm2.Lua -
  -
getenv(String) - -Method in class org.luaj.vm2.lib.OsLib -
Returns the value of the process environment variable varname, - or null if the variable is not defined. -
getfenv() - -Method in class org.luaj.vm2.LuaFunction -
  -
getfenv() - -Method in class org.luaj.vm2.LuaThread -
  -
getfenv() - -Method in class org.luaj.vm2.LuaValue -
Get the environemnt for an instance. -
getGlobals() - -Static method in class org.luaj.vm2.LuaThread -
Get the current thread's environment -
getHashLength() - -Method in class org.luaj.vm2.LuaTable -
Get the length of the hash part of the table. -
getHashLength() - -Method in class org.luaj.vm2.WeakTable -
  -
getInstance() - -Static method in class org.luaj.vm2.luajc.LuaJC -
  -
getlocalname(int, int) - -Method in class org.luaj.vm2.Prototype -
Get the name of a local variable. -
getmetatable() - -Method in class org.luaj.vm2.LuaBoolean -
  -
getmetatable() - -Method in class org.luaj.vm2.LuaClosure -
  -
getmetatable() - -Method in class org.luaj.vm2.LuaFunction -
  -
getmetatable() - -Method in class org.luaj.vm2.LuaNil -
  -
getmetatable() - -Method in class org.luaj.vm2.LuaNumber -
  -
getmetatable() - -Method in class org.luaj.vm2.LuaString -
  -
getmetatable() - -Method in class org.luaj.vm2.LuaTable -
  -
getmetatable() - -Method in class org.luaj.vm2.LuaThread -
  -
getmetatable() - -Method in class org.luaj.vm2.LuaUserdata -
  -
getmetatable() - -Method in class org.luaj.vm2.LuaValue -
Get the metatable for this LuaValue -
getn() - -Method in class org.luaj.vm2.LuaTable -
  -
getn() - -Method in class org.luaj.vm2.LuaValue -
Implementation of lua 5.0 getn() function. -
getOpMode(int) - -Static method in class org.luaj.vm2.Lua -
  -
getRunning() - -Static method in class org.luaj.vm2.LuaThread -
Get the currently running thread. -
getSourceName(String) - -Static method in class org.luaj.vm2.LoadState -
Construct a source name from a supplied chunk name -
getStatus() - -Method in class org.luaj.vm2.LuaThread -
  -
gettable(LuaValue, LuaValue) - -Static method in class org.luaj.vm2.LuaValue -
get value from metatable operations, or NIL if not defined by metatables -
getUpvalue(int) - -Method in class org.luaj.vm2.LuaClosure -
  -
getValue() - -Method in class org.luaj.vm2.UpValue -
Get the value of the upvalue -
gt(LuaValue) - -Method in class org.luaj.vm2.LuaDouble -
  -
gt(double) - -Method in class org.luaj.vm2.LuaDouble -
  -
gt(int) - -Method in class org.luaj.vm2.LuaDouble -
  -
gt(LuaValue) - -Method in class org.luaj.vm2.LuaInteger -
  -
gt(double) - -Method in class org.luaj.vm2.LuaInteger -
  -
gt(int) - -Method in class org.luaj.vm2.LuaInteger -
  -
gt(LuaValue) - -Method in class org.luaj.vm2.LuaString -
  -
gt(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Greater than: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue. -
gt(double) - -Method in class org.luaj.vm2.LuaValue -
Greater than: Perform numeric comparison with another value - of double type, - including metatag processing, and returning LuaValue. -
gt(int) - -Method in class org.luaj.vm2.LuaValue -
Greater than: Perform numeric comparison with another value - of int type, - including metatag processing, and returning LuaValue. -
gt_b(LuaValue) - -Method in class org.luaj.vm2.LuaDouble -
  -
gt_b(int) - -Method in class org.luaj.vm2.LuaDouble -
  -
gt_b(double) - -Method in class org.luaj.vm2.LuaDouble -
  -
gt_b(LuaValue) - -Method in class org.luaj.vm2.LuaInteger -
  -
gt_b(int) - -Method in class org.luaj.vm2.LuaInteger -
  -
gt_b(double) - -Method in class org.luaj.vm2.LuaInteger -
  -
gt_b(LuaValue) - -Method in class org.luaj.vm2.LuaString -
  -
gt_b(int) - -Method in class org.luaj.vm2.LuaString -
  -
gt_b(double) - -Method in class org.luaj.vm2.LuaString -
  -
gt_b(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Greater than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean. -
gt_b(int) - -Method in class org.luaj.vm2.LuaValue -
Greater than: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean. -
gt_b(double) - -Method in class org.luaj.vm2.LuaValue -
Greater than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean. -
gteq(LuaValue) - -Method in class org.luaj.vm2.LuaDouble -
  -
gteq(double) - -Method in class org.luaj.vm2.LuaDouble -
  -
gteq(int) - -Method in class org.luaj.vm2.LuaDouble -
  -
gteq(LuaValue) - -Method in class org.luaj.vm2.LuaInteger -
  -
gteq(double) - -Method in class org.luaj.vm2.LuaInteger -
  -
gteq(int) - -Method in class org.luaj.vm2.LuaInteger -
  -
gteq(LuaValue) - -Method in class org.luaj.vm2.LuaString -
  -
gteq(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Greater than or equals: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue. -
gteq(double) - -Method in class org.luaj.vm2.LuaValue -
Greater than or equals: Perform numeric comparison with another value - of double type, - including metatag processing, and returning LuaValue. -
gteq(int) - -Method in class org.luaj.vm2.LuaValue -
Greater than or equals: Perform numeric comparison with another value - of int type, - including metatag processing, and returning LuaValue. -
gteq_b(LuaValue) - -Method in class org.luaj.vm2.LuaDouble -
  -
gteq_b(int) - -Method in class org.luaj.vm2.LuaDouble -
  -
gteq_b(double) - -Method in class org.luaj.vm2.LuaDouble -
  -
gteq_b(LuaValue) - -Method in class org.luaj.vm2.LuaInteger -
  -
gteq_b(int) - -Method in class org.luaj.vm2.LuaInteger -
  -
gteq_b(double) - -Method in class org.luaj.vm2.LuaInteger -
  -
gteq_b(LuaValue) - -Method in class org.luaj.vm2.LuaString -
  -
gteq_b(int) - -Method in class org.luaj.vm2.LuaString -
  -
gteq_b(double) - -Method in class org.luaj.vm2.LuaString -
  -
gteq_b(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Greater than or equals: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean. -
gteq_b(int) - -Method in class org.luaj.vm2.LuaValue -
Greater than or equals: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean. -
gteq_b(double) - -Method in class org.luaj.vm2.LuaValue -
Greater than or equals: Perform numeric comparison with another value - of double type, - including metatag processing, - and returning java boolean. -
-
-

-H

-
-
hashClearSlot(int) - -Method in class org.luaj.vm2.LuaTable -
Clear a particular slot in the table -
hashCode() - -Method in class org.luaj.vm2.LuaDouble -
  -
hashCode() - -Method in class org.luaj.vm2.LuaInteger -
  -
hashCode() - -Method in class org.luaj.vm2.LuaString -
  -
hashCode() - -Method in class org.luaj.vm2.LuaUserdata -
  -
hashEntries - -Variable in class org.luaj.vm2.LuaTable -
the number of hash entries -
hashFindSlot(LuaValue) - -Method in class org.luaj.vm2.LuaTable -
Find the hashtable slot to use -
hashFindSlot(LuaValue) - -Method in class org.luaj.vm2.WeakTable -
  -
hashget(LuaValue) - -Method in class org.luaj.vm2.LuaTable -
  -
hashget(LuaValue) - -Method in class org.luaj.vm2.WeakTable -
Get the hash value for a key - key the key to look up -
hashKeys - -Variable in class org.luaj.vm2.LuaTable -
the hash keys -
hashset(LuaValue, LuaValue) - -Method in class org.luaj.vm2.LuaTable -
Set a hashtable value -
hashValues - -Variable in class org.luaj.vm2.LuaTable -
the hash values -
-
-

-I

-
-
iABC - -Static variable in class org.luaj.vm2.Lua -
  -
iABx - -Static variable in class org.luaj.vm2.Lua -
  -
iAsBx - -Static variable in class org.luaj.vm2.Lua -
  -
illegal(String, String) - -Method in class org.luaj.vm2.LuaValue -
Throw a LuaError indicating an illegal operation occurred, - typically involved in managing weak references -
INDEX - -Static variable in class org.luaj.vm2.LuaValue -
LuaString constant with value "__index" for use as metatag -
INDEXK(int) - -Static method in class org.luaj.vm2.Lua -
gets the index of the constant -
indexOf(byte, int) - -Method in class org.luaj.vm2.LuaString -
Find the index of a byte starting at a point in this string -
indexOf(LuaString, int) - -Method in class org.luaj.vm2.LuaString -
Find the index of a string starting at a point in this string -
indexOfAny(LuaString) - -Method in class org.luaj.vm2.LuaString -
Java version of strpbrk - find index of any byte that in an accept string. -
inext(LuaValue) - -Method in class org.luaj.vm2.LuaTable -
Get the next element after a particular key in the - contiguous array part of a table -
inext(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Find the next integer-key,value pair if this is a table, - return NIL if there are no more, or throw a LuaError if not a table. -
init() - -Method in class org.luaj.vm2.lib.OsLib -
  -
insert(int, LuaValue) - -Method in class org.luaj.vm2.LuaTable -
Insert an element at a position in a list-table -
install() - -Static method in class org.luaj.vm2.compiler.LuaC -
Install the compiler so that LoadState will first - try to use it when handed bytes that are - not already a compiled lua chunk. -
install() - -Static method in class org.luaj.vm2.luajc.LuaJC -
Install the compiler as the main compiler to use. -
instance - -Static variable in class org.luaj.vm2.compiler.LuaC -
  -
instance - -Static variable in class org.luaj.vm2.lib.BaseLib -
  -
instance - -Static variable in class org.luaj.vm2.lib.PackageLib -
Most recent instance of PackageLib -
instance - -Static variable in class org.luaj.vm2.lib.StringLib -
  -
invoke(Varargs) - -Method in class org.luaj.vm2.lib.CoroutineLib -
  -
invoke(Varargs) - -Method in class org.luaj.vm2.lib.DebugLib -
  -
invoke(Varargs) - -Method in class org.luaj.vm2.lib.jse.LuajavaLib -
  -
invoke(Varargs) - -Method in class org.luaj.vm2.lib.OneArgFunction -
  -
invoke(Varargs) - -Method in class org.luaj.vm2.lib.OsLib -
  -
invoke(Varargs) - -Method in class org.luaj.vm2.lib.ThreeArgFunction -
  -
invoke(Varargs) - -Method in class org.luaj.vm2.lib.TwoArgFunction -
  -
invoke(Varargs) - -Method in class org.luaj.vm2.lib.VarArgFunction -
Override and implement for the best performance. -
invoke(Varargs) - -Method in class org.luaj.vm2.lib.ZeroArgFunction -
  -
invoke(Varargs) - -Method in class org.luaj.vm2.LuaClosure -
  -
invoke() - -Method in class org.luaj.vm2.LuaValue -
Call this with 0 arguments, including metatag processing, - and retain all return values in a Varargs. -
invoke(Varargs) - -Method in class org.luaj.vm2.LuaValue -
Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs. -
invoke(LuaValue, Varargs) - -Method in class org.luaj.vm2.LuaValue -
Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs. -
invoke(LuaValue, LuaValue, Varargs) - -Method in class org.luaj.vm2.LuaValue -
Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs. -
invoke(LuaValue[]) - -Method in class org.luaj.vm2.LuaValue -
Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs. -
invoke(LuaValue[], Varargs) - -Method in class org.luaj.vm2.LuaValue -
Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs. -
invokemethod(String) - -Method in class org.luaj.vm2.LuaValue -
Call named method on this with 0 arguments, including metatag processing, - and retain all return values in a Varargs. -
invokemethod(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Call named method on this with 0 arguments, including metatag processing, - and retain all return values in a Varargs. -
invokemethod(String, Varargs) - -Method in class org.luaj.vm2.LuaValue -
Call named method on this with 1 argument, including metatag processing, - and retain all return values in a Varargs. -
invokemethod(LuaValue, Varargs) - -Method in class org.luaj.vm2.LuaValue -
Call named method on this with variable arguments, including metatag processing, - and retain all return values in a Varargs. -
invokemethod(String, LuaValue[]) - -Method in class org.luaj.vm2.LuaValue -
Call named method on this with 1 argument, including metatag processing, - and retain all return values in a Varargs. -
invokemethod(LuaValue, LuaValue[]) - -Method in class org.luaj.vm2.LuaValue -
Call named method on this with variable arguments, including metatag processing, - and retain all return values in a Varargs. -
IO_NAMES - -Static variable in class org.luaj.vm2.lib.IoLib -
  -
IoLib - Class in org.luaj.vm2.lib
Abstract base class extending LibFunction which implements the - core of the lua standard io library.
IoLib() - -Constructor for class org.luaj.vm2.lib.IoLib -
  -
IoLib.File - Class in org.luaj.vm2.lib
 
IoLib.File() - -Constructor for class org.luaj.vm2.lib.IoLib.File -
  -
is - -Variable in class org.luaj.vm2.LoadState -
input stream from which we are loading -
is_vararg - -Variable in class org.luaj.vm2.Prototype -
  -
isboolean() - -Method in class org.luaj.vm2.LuaBoolean -
  -
isboolean() - -Method in class org.luaj.vm2.LuaValue -
Check if this is a boolean -
isclosed() - -Method in class org.luaj.vm2.lib.IoLib.File -
  -
isclosure() - -Method in class org.luaj.vm2.LuaClosure -
  -
isclosure() - -Method in class org.luaj.vm2.LuaValue -
Check if this is a function that is a closure, - meaning interprets lua bytecode for its execution -
isfunction() - -Method in class org.luaj.vm2.LuaFunction -
  -
isfunction() - -Method in class org.luaj.vm2.LuaValue -
Check if this is a function -
isfunction(int) - -Method in class org.luaj.vm2.Varargs -
Tests if argument i is a function. -
isint() - -Method in class org.luaj.vm2.LuaInteger -
  -
isint() - -Method in class org.luaj.vm2.LuaString -
  -
isint() - -Method in class org.luaj.vm2.LuaValue -
Check if this is a number and is representable by java int - without rounding or truncation -
isinttype() - -Method in class org.luaj.vm2.LuaInteger -
  -
isinttype() - -Method in class org.luaj.vm2.LuaValue -
Check if this is a LuaInteger -
ISK(int) - -Static method in class org.luaj.vm2.Lua -
test whether value is a constant -
islong() - -Method in class org.luaj.vm2.LuaDouble -
  -
islong() - -Method in class org.luaj.vm2.LuaInteger -
  -
islong() - -Method in class org.luaj.vm2.LuaString -
  -
islong() - -Method in class org.luaj.vm2.LuaValue -
Check if this is a number and is representable by java long - without rounding or truncation -
isMainThread(LuaThread) - -Static method in class org.luaj.vm2.LuaThread -
Test if this is the main thread -
isnil() - -Method in class org.luaj.vm2.LuaNil -
  -
isnil() - -Method in class org.luaj.vm2.LuaValue -
Check if this is nil -
isnil(int) - -Method in class org.luaj.vm2.Varargs -
Tests if argument i is nil. -
isnoneornil(int) - -Method in class org.luaj.vm2.Varargs -
Return true if there is no argument or nil at argument i. -
isnumber() - -Method in class org.luaj.vm2.LuaDouble -
  -
isnumber() - -Method in class org.luaj.vm2.LuaNumber -
  -
isnumber() - -Method in class org.luaj.vm2.LuaString -
  -
isnumber() - -Method in class org.luaj.vm2.LuaValue -
Check if this is a number -
isnumber(int) - -Method in class org.luaj.vm2.Varargs -
Tests if argument i is a number. -
isstdfile() - -Method in class org.luaj.vm2.lib.IoLib.File -
  -
isstring() - -Method in class org.luaj.vm2.LuaDouble -
  -
isstring() - -Method in class org.luaj.vm2.LuaInteger -
  -
isstring() - -Method in class org.luaj.vm2.LuaNumber -
  -
isstring() - -Method in class org.luaj.vm2.LuaString -
  -
isstring() - -Method in class org.luaj.vm2.LuaValue -
Check if this is a string -
isstring(int) - -Method in class org.luaj.vm2.Varargs -
Tests if argument i is a string. -
istable() - -Method in class org.luaj.vm2.LuaTable -
  -
istable() - -Method in class org.luaj.vm2.LuaValue -
Check if this is a table -
istable(int) - -Method in class org.luaj.vm2.Varargs -
Tests if argument i is a table. -
isTailcall() - -Method in class org.luaj.vm2.TailcallVarargs -
  -
isTailcall() - -Method in class org.luaj.vm2.Varargs -
Return true if this is a TailcallVarargs -
isthread() - -Method in class org.luaj.vm2.LuaThread -
  -
isthread() - -Method in class org.luaj.vm2.LuaValue -
Check if this is a thread -
isthread(int) - -Method in class org.luaj.vm2.Varargs -
Tests if argument i is a thread. -
isuserdata() - -Method in class org.luaj.vm2.LuaUserdata -
  -
isuserdata(Class) - -Method in class org.luaj.vm2.LuaUserdata -
  -
isuserdata() - -Method in class org.luaj.vm2.LuaValue -
Check if this is a userdata -
isuserdata(Class) - -Method in class org.luaj.vm2.LuaValue -
Check if this is a userdata of type c -
isuserdata(int) - -Method in class org.luaj.vm2.Varargs -
Tests if argument i is a userdata. -
isValidUtf8() - -Method in class org.luaj.vm2.LuaString -
Check that a byte sequence is valid UTF-8 -
isvalue(int) - -Method in class org.luaj.vm2.Varargs -
Tests if a value exists at argument i. -
isweaknil() - -Method in class org.luaj.vm2.LuaValue -
Test if this is a weak reference and its value no longer is referenced. -
-
-

-J

-
-
java_loader - -Variable in class org.luaj.vm2.lib.PackageLib -
Loader that loads as a Java class. -
JmeIoLib - Class in org.luaj.vm2.lib.jme
Subclass of IoLib and therefore LibFunction which implements the lua standard io - library for the JSE platform.
JmeIoLib() - -Constructor for class org.luaj.vm2.lib.jme.JmeIoLib -
  -
JmePlatform - Class in org.luaj.vm2.lib.jme
The JmePlatform class is a convenience class to standardize - how globals tables are initialized for the JME platform.
JmePlatform() - -Constructor for class org.luaj.vm2.lib.jme.JmePlatform -
  -
JseBaseLib - Class in org.luaj.vm2.lib.jse
Subclass of BaseLib and LibFunction which implements the lua basic library functions - and provides a directory based ResourceFinder as the BaseLib.FINDER.
JseBaseLib() - -Constructor for class org.luaj.vm2.lib.jse.JseBaseLib -
Construct a JSE base library instance -
JseIoLib - Class in org.luaj.vm2.lib.jse
Subclass of IoLib and therefore LibFunction which implements the lua standard io - library for the JSE platform.
JseIoLib() - -Constructor for class org.luaj.vm2.lib.jse.JseIoLib -
  -
JseMathLib - Class in org.luaj.vm2.lib.jse
Subclass of LibFunction which implements the lua standard math - library.
JseMathLib() - -Constructor for class org.luaj.vm2.lib.jse.JseMathLib -
  -
JseMathLib.JseMathLib1 - Class in org.luaj.vm2.lib.jse
 
JseMathLib.JseMathLib1() - -Constructor for class org.luaj.vm2.lib.jse.JseMathLib.JseMathLib1 -
  -
JseMathLib.JseMathLib2 - Class in org.luaj.vm2.lib.jse
 
JseMathLib.JseMathLib2() - -Constructor for class org.luaj.vm2.lib.jse.JseMathLib.JseMathLib2 -
  -
JseOsLib - Class in org.luaj.vm2.lib.jse
Subclass of LibFunction which implements the standard lua os library.
JseOsLib() - -Constructor for class org.luaj.vm2.lib.jse.JseOsLib -
public constructor -
JsePlatform - Class in org.luaj.vm2.lib.jse
The JsePlatform class is a convenience class to standardize - how globals tables are initialized for the JSE platform.
JsePlatform() - -Constructor for class org.luaj.vm2.lib.jse.JsePlatform -
  -
JseProcess - Class in org.luaj.vm2.lib.jse
Analog of Process that pipes input and output to client-specified streams.
JseProcess(String[], InputStream, OutputStream, OutputStream) - -Constructor for class org.luaj.vm2.lib.jse.JseProcess -
Construct a process around a command, with specified streams to redirect input and output to. -
JseProcess(String, InputStream, OutputStream, OutputStream) - -Constructor for class org.luaj.vm2.lib.jse.JseProcess -
Construct a process around a command, with specified streams to redirect input and output to. -
JSTR_NAN - -Static variable in class org.luaj.vm2.LuaDouble -
Constant String representation for NaN (not a number), "nan" -
JSTR_NEGINF - -Static variable in class org.luaj.vm2.LuaDouble -
Constant String representation for negative infinity, "-inf" -
JSTR_POSINF - -Static variable in class org.luaj.vm2.LuaDouble -
Constant String representation for positive infinity, "inf" -
-
-

-K

-
-
k - -Variable in class org.luaj.vm2.Prototype -
  -
keyCount() - -Method in class org.luaj.vm2.LuaTable -
This may be deprecated in a future release. -
keys() - -Method in class org.luaj.vm2.LuaTable -
This may be deprecated in a future release. -
-
-

-L

-
-
lastIndexOf(LuaString) - -Method in class org.luaj.vm2.LuaString -
Find the last index of a string in this string -
lastlinedefined - -Variable in class org.luaj.vm2.Prototype -
  -
LE - -Static variable in class org.luaj.vm2.LuaValue -
LuaString constant with value "__le" for use as metatag -
len() - -Method in class org.luaj.vm2.LuaString -
  -
len() - -Method in class org.luaj.vm2.LuaTable -
  -
LEN - -Static variable in class org.luaj.vm2.LuaValue -
LuaString constant with value "__len" for use as metatag -
len() - -Method in class org.luaj.vm2.LuaValue -
Length operator: return lua length of object (#this) including metatag processing as java int -
lenerror() - -Method in class org.luaj.vm2.LuaValue -
Throw a LuaError based on the len operator, - typically due to an invalid operand type -
length() - -Method in class org.luaj.vm2.LuaString -
  -
length() - -Method in class org.luaj.vm2.LuaTable -
  -
length() - -Method in class org.luaj.vm2.LuaValue -
Length operator: return lua length of object (#this) including metatag processing as java int -
lengthAsUtf8(char[]) - -Static method in class org.luaj.vm2.LuaString -
Count the number of bytes required to encode the string as UTF-8. -
LFIELDS_PER_FLUSH - -Static variable in class org.luaj.vm2.Lua -
  -
LibFunction - Class in org.luaj.vm2.lib
Subclass of LuaFunction common to Java functions exposed to lua.
LibFunction() - -Constructor for class org.luaj.vm2.lib.LibFunction -
Default constructor for use by subclasses -
linedefined - -Variable in class org.luaj.vm2.Prototype -
  -
lineinfo - -Variable in class org.luaj.vm2.Prototype -
  -
listOf(LuaValue[]) - -Static method in class org.luaj.vm2.LuaValue -
Construct a LuaTable initialized with supplied array values. -
listOf(LuaValue[], Varargs) - -Static method in class org.luaj.vm2.LuaValue -
Construct a LuaTable initialized with supplied array values. -
load(InputStream, String, LuaValue) - -Method in class org.luaj.vm2.compiler.LuaC -
Load into a Closure or LuaFunction, with the supplied initial environment -
load(Prototype, String, LuaValue) - -Method in class org.luaj.vm2.compiler.LuaC -
  -
load(InputStream, String, LuaValue) - -Static method in class org.luaj.vm2.LoadState -
Load lua in either binary or text form from an input stream. -
load(InputStream, String, LuaValue) - -Method in interface org.luaj.vm2.LoadState.LuaCompiler -
Load into a Closure or LuaFunction from a Stream and initializes the environment -
load(InputStream, String, LuaValue) - -Method in class org.luaj.vm2.luajc.LuaJC -
  -
load(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Load a library instance by setting its environment to this - and calling it, which should iniitalize the library instance and - install itself into this instance. -
loadBinaryChunk(int, InputStream, String) - -Static method in class org.luaj.vm2.LoadState -
Load lua thought to be a binary chunk from its first byte from an input stream. -
LOADED - -Variable in class org.luaj.vm2.lib.PackageLib -
  -
loadFile(String) - -Static method in class org.luaj.vm2.lib.BaseLib -
Load from a named file, returning the chunk or nil,error of can't load -
loadFunction(LuaString) - -Method in class org.luaj.vm2.LoadState -
Load a function prototype from the input stream -
loadHeader() - -Method in class org.luaj.vm2.LoadState -
Load the lua chunk header values. -
loadlib(Varargs) - -Static method in class org.luaj.vm2.lib.PackageLib -
  -
LoadState - Class in org.luaj.vm2
Class to manage loading of Prototype instances.
LoadState.LuaCompiler - Interface in org.luaj.vm2
Interface for the compiler, if it is installed.
loadStream(InputStream, String) - -Static method in class org.luaj.vm2.lib.BaseLib -
  -
LocVars - Class in org.luaj.vm2
Data class to hold debug information relatign to local variables for a Prototype
LocVars(LuaString, int, int) - -Constructor for class org.luaj.vm2.LocVars -
Construct a LocVars instance. -
locvars - -Variable in class org.luaj.vm2.Prototype -
  -
longBitsToLuaNumber(long) - -Static method in class org.luaj.vm2.LoadState -
Convert bits in a long value to a LuaValue. -
lt(LuaValue) - -Method in class org.luaj.vm2.LuaDouble -
  -
lt(double) - -Method in class org.luaj.vm2.LuaDouble -
  -
lt(int) - -Method in class org.luaj.vm2.LuaDouble -
  -
lt(LuaValue) - -Method in class org.luaj.vm2.LuaInteger -
  -
lt(double) - -Method in class org.luaj.vm2.LuaInteger -
  -
lt(int) - -Method in class org.luaj.vm2.LuaInteger -
  -
lt(LuaValue) - -Method in class org.luaj.vm2.LuaString -
  -
LT - -Static variable in class org.luaj.vm2.LuaValue -
LuaString constant with value "__lt" for use as metatag -
lt(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Less than: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue. -
lt(double) - -Method in class org.luaj.vm2.LuaValue -
Less than: Perform numeric comparison with another value - of double type, - including metatag processing, and returning LuaValue. -
lt(int) - -Method in class org.luaj.vm2.LuaValue -
Less than: Perform numeric comparison with another value - of int type, - including metatag processing, and returning LuaValue. -
lt_b(LuaValue) - -Method in class org.luaj.vm2.LuaDouble -
  -
lt_b(int) - -Method in class org.luaj.vm2.LuaDouble -
  -
lt_b(double) - -Method in class org.luaj.vm2.LuaDouble -
  -
lt_b(LuaValue) - -Method in class org.luaj.vm2.LuaInteger -
  -
lt_b(int) - -Method in class org.luaj.vm2.LuaInteger -
  -
lt_b(double) - -Method in class org.luaj.vm2.LuaInteger -
  -
lt_b(LuaValue) - -Method in class org.luaj.vm2.LuaString -
  -
lt_b(int) - -Method in class org.luaj.vm2.LuaString -
  -
lt_b(double) - -Method in class org.luaj.vm2.LuaString -
  -
lt_b(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Less than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean. -
lt_b(int) - -Method in class org.luaj.vm2.LuaValue -
Less than: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean. -
lt_b(double) - -Method in class org.luaj.vm2.LuaValue -
Less than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean. -
lteq(LuaValue) - -Method in class org.luaj.vm2.LuaDouble -
  -
lteq(double) - -Method in class org.luaj.vm2.LuaDouble -
  -
lteq(int) - -Method in class org.luaj.vm2.LuaDouble -
  -
lteq(LuaValue) - -Method in class org.luaj.vm2.LuaInteger -
  -
lteq(double) - -Method in class org.luaj.vm2.LuaInteger -
  -
lteq(int) - -Method in class org.luaj.vm2.LuaInteger -
  -
lteq(LuaValue) - -Method in class org.luaj.vm2.LuaString -
  -
lteq(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Less than or equals: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue. -
lteq(double) - -Method in class org.luaj.vm2.LuaValue -
Less than or equals: Perform numeric comparison with another value - of double type, - including metatag processing, and returning LuaValue. -
lteq(int) - -Method in class org.luaj.vm2.LuaValue -
Less than or equals: Perform numeric comparison with another value - of int type, - including metatag processing, and returning LuaValue. -
lteq_b(LuaValue) - -Method in class org.luaj.vm2.LuaDouble -
  -
lteq_b(int) - -Method in class org.luaj.vm2.LuaDouble -
  -
lteq_b(double) - -Method in class org.luaj.vm2.LuaDouble -
  -
lteq_b(LuaValue) - -Method in class org.luaj.vm2.LuaInteger -
  -
lteq_b(int) - -Method in class org.luaj.vm2.LuaInteger -
  -
lteq_b(double) - -Method in class org.luaj.vm2.LuaInteger -
  -
lteq_b(LuaValue) - -Method in class org.luaj.vm2.LuaString -
  -
lteq_b(int) - -Method in class org.luaj.vm2.LuaString -
  -
lteq_b(double) - -Method in class org.luaj.vm2.LuaString -
  -
lteq_b(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Less than or equals: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean. -
lteq_b(int) - -Method in class org.luaj.vm2.LuaValue -
Less than or equals: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean. -
lteq_b(double) - -Method in class org.luaj.vm2.LuaValue -
Less than or equals: Perform numeric comparison with another value - of double type, - including metatag processing, - and returning java boolean. -
Lua - Class in org.luaj.vm2
Constants for lua limits and opcodes.
Lua() - -Constructor for class org.luaj.vm2.Lua -
  -
lua_loader - -Variable in class org.luaj.vm2.lib.PackageLib -
Loader that loads as a lua script using the LUA_PATH -
LUA_MULTRET - -Static variable in class org.luaj.vm2.Lua -
use return values from previous op -
LUA_TBOOLEAN - -Static variable in class org.luaj.vm2.LoadState -
  -
LUA_TFUNCTION - -Static variable in class org.luaj.vm2.LoadState -
  -
LUA_TINT - -Static variable in class org.luaj.vm2.LoadState -
  -
LUA_TLIGHTUSERDATA - -Static variable in class org.luaj.vm2.LoadState -
  -
LUA_TNIL - -Static variable in class org.luaj.vm2.LoadState -
  -
LUA_TNONE - -Static variable in class org.luaj.vm2.LoadState -
  -
LUA_TNUMBER - -Static variable in class org.luaj.vm2.LoadState -
  -
LUA_TSTRING - -Static variable in class org.luaj.vm2.LoadState -
  -
LUA_TTABLE - -Static variable in class org.luaj.vm2.LoadState -
  -
LUA_TTHREAD - -Static variable in class org.luaj.vm2.LoadState -
  -
LUA_TUSERDATA - -Static variable in class org.luaj.vm2.LoadState -
  -
LUA_TVALUE - -Static variable in class org.luaj.vm2.LoadState -
  -
LuaBoolean - Class in org.luaj.vm2
Extension of LuaValue which can hold a Java boolean as its value.
luaByte(int) - -Method in class org.luaj.vm2.LuaString -
  -
LuaC - Class in org.luaj.vm2.compiler
Compiler for Lua.
LuaC() - -Constructor for class org.luaj.vm2.compiler.LuaC -
  -
LUAC_FORMAT - -Static variable in class org.luaj.vm2.LoadState -
for header of binary files -- this is the official format -
LUAC_HEADERSIZE - -Static variable in class org.luaj.vm2.LoadState -
size of header of binary files -
LUAC_VERSION - -Static variable in class org.luaj.vm2.LoadState -
for header of binary files -- this is Lua 5.1 -
LuaClosure - Class in org.luaj.vm2
Extension of LuaFunction which executes lua bytecode.
LuaClosure(Prototype, LuaValue) - -Constructor for class org.luaj.vm2.LuaClosure -
Supply the initial environment -
LuaClosure(int, LuaValue) - -Constructor for class org.luaj.vm2.LuaClosure -
  -
LuaDouble - Class in org.luaj.vm2
Extension of LuaNumber which can hold a Java double as its value.
LuaError - Exception in org.luaj.vm2
RuntimeException that is thrown and caught in response to a lua error.
LuaError(Throwable) - -Constructor for exception org.luaj.vm2.LuaError -
Construct LuaError when a program exception occurs. -
LuaError(String) - -Constructor for exception org.luaj.vm2.LuaError -
Construct a LuaError with a specific message. -
LuaError(String, int) - -Constructor for exception org.luaj.vm2.LuaError -
Construct a LuaError with a message, and level to draw line number information from. -
LuaFunction - Class in org.luaj.vm2
Base class for functions implemented in Java.
LuaFunction() - -Constructor for class org.luaj.vm2.LuaFunction -
  -
LuaFunction(LuaValue) - -Constructor for class org.luaj.vm2.LuaFunction -
  -
LuaInteger - Class in org.luaj.vm2
Extension of LuaNumber which can hold a Java int as its value.
LuajavaLib - Class in org.luaj.vm2.lib.jse
Subclass of LibFunction which implements the features of the luajava package.
LuajavaLib() - -Constructor for class org.luaj.vm2.lib.jse.LuajavaLib -
  -
LuaJC - Class in org.luaj.vm2.luajc
Implementation of LoadState.LuaCompiler which does direct - lua-to-java-bytecode compiling.
LuaJC() - -Constructor for class org.luaj.vm2.luajc.LuaJC -
  -
LuaNil - Class in org.luaj.vm2
Class to encapsulate behavior of the singleton instance nil
LuaNumber - Class in org.luaj.vm2
Base class for representing numbers as lua values directly.
LuaNumber() - -Constructor for class org.luaj.vm2.LuaNumber -
  -
luaP_opmodes - -Static variable in class org.luaj.vm2.Lua -
  -
LuaString - Class in org.luaj.vm2
Subclass of LuaValue for representing lua strings.
LuaTable - Class in org.luaj.vm2
Subclass of LuaValue for representing lua tables.
LuaTable() - -Constructor for class org.luaj.vm2.LuaTable -
Construct empty table -
LuaTable(int, int) - -Constructor for class org.luaj.vm2.LuaTable -
Construct table with preset capacity. -
LuaTable(LuaValue[], LuaValue[], Varargs) - -Constructor for class org.luaj.vm2.LuaTable -
Construct table with named and unnamed parts. -
LuaTable(Varargs) - -Constructor for class org.luaj.vm2.LuaTable -
Construct table of unnamed elements. -
LuaTable(Varargs, int) - -Constructor for class org.luaj.vm2.LuaTable -
Construct table of unnamed elements. -
LuaThread - Class in org.luaj.vm2
Subclass of LuaValue that implements - a lua coroutine thread using Java Threads.
LuaThread(LuaValue, LuaValue) - -Constructor for class org.luaj.vm2.LuaThread -
Create a LuaThread around a function and environment -
LuaThread.CallStack - Class in org.luaj.vm2
 
LuaThread.CallStack() - -Constructor for class org.luaj.vm2.LuaThread.CallStack -
  -
LuaUserdata - Class in org.luaj.vm2
 
LuaUserdata(Object) - -Constructor for class org.luaj.vm2.LuaUserdata -
  -
LuaUserdata(Object, LuaValue) - -Constructor for class org.luaj.vm2.LuaUserdata -
  -
LuaValue - Class in org.luaj.vm2
Base class for all concrete lua type values.
LuaValue() - -Constructor for class org.luaj.vm2.LuaValue -
  -
-
-

-M

-
-
m_bytes - -Variable in class org.luaj.vm2.LuaString -
The bytes for the string -
m_instance - -Variable in class org.luaj.vm2.LuaUserdata -
  -
m_length - -Variable in class org.luaj.vm2.LuaString -
The number of bytes that comprise this string -
m_metatable - -Variable in class org.luaj.vm2.LuaTable -
metatable for this table, or null -
m_metatable - -Variable in class org.luaj.vm2.LuaUserdata -
  -
m_offset - -Variable in class org.luaj.vm2.LuaString -
The offset into the byte array, 0 means start at the first byte -
makeroom(int, int) - -Method in class org.luaj.vm2.Buffer -
Ensure there is enough room before and after the bytes. -
MASK_A - -Static variable in class org.luaj.vm2.Lua -
  -
MASK_B - -Static variable in class org.luaj.vm2.Lua -
  -
MASK_Bx - -Static variable in class org.luaj.vm2.Lua -
  -
MASK_C - -Static variable in class org.luaj.vm2.Lua -
  -
MASK_NOT_A - -Static variable in class org.luaj.vm2.Lua -
  -
MASK_NOT_B - -Static variable in class org.luaj.vm2.Lua -
  -
MASK_NOT_Bx - -Static variable in class org.luaj.vm2.Lua -
  -
MASK_NOT_C - -Static variable in class org.luaj.vm2.Lua -
  -
MASK_NOT_OP - -Static variable in class org.luaj.vm2.Lua -
  -
MASK_OP - -Static variable in class org.luaj.vm2.Lua -
  -
MathLib - Class in org.luaj.vm2.lib
Subclass of LibFunction which implements the lua standard math - library.
MathLib() - -Constructor for class org.luaj.vm2.lib.MathLib -
  -
MATHLIB - -Static variable in class org.luaj.vm2.lib.MathLib -
  -
MAX_CALLSTACK - -Static variable in class org.luaj.vm2.LuaThread -
  -
MAX_OP - -Static variable in class org.luaj.vm2.Lua -
  -
MAXARG_A - -Static variable in class org.luaj.vm2.Lua -
  -
MAXARG_B - -Static variable in class org.luaj.vm2.Lua -
  -
MAXARG_Bx - -Static variable in class org.luaj.vm2.Lua -
  -
MAXARG_C - -Static variable in class org.luaj.vm2.Lua -
  -
MAXARG_sBx - -Static variable in class org.luaj.vm2.Lua -
  -
MAXINDEXRK - -Static variable in class org.luaj.vm2.Lua -
  -
maxn() - -Method in class org.luaj.vm2.LuaTable -
Return table.maxn() as defined by lua 5.0. -
maxn() - -Method in class org.luaj.vm2.WeakTable -
  -
MAXSTACK - -Static variable in class org.luaj.vm2.compiler.LuaC -
  -
maxstacksize - -Variable in class org.luaj.vm2.Prototype -
  -
METATABLE - -Static variable in class org.luaj.vm2.LuaValue -
LuaString constant with value "__metatable" for use as metatag -
metatag(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Get particular metatag, or return LuaValue.NIL if it doesn't exist -
method(String) - -Method in class org.luaj.vm2.LuaValue -
Call named method on this with 0 arguments, including metatag processing, - and return only the first return value. -
method(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Call named method on this with 0 arguments, including metatag processing, - and return only the first return value. -
method(String, LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Call named method on this with 1 argument, including metatag processing, - and return only the first return value. -
method(LuaValue, LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Call named method on this with 1 argument, including metatag processing, - and return only the first return value. -
method(String, LuaValue, LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Call named method on this with 2 arguments, including metatag processing, - and return only the first return value. -
method(LuaValue, LuaValue, LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Call named method on this with 2 arguments, including metatag processing, - and return only the first return value. -
MINUSONE - -Static variable in class org.luaj.vm2.LuaValue -
LuaValue number constant equal to -1 -
mod(LuaValue) - -Method in class org.luaj.vm2.LuaDouble -
  -
mod(double) - -Method in class org.luaj.vm2.LuaDouble -
  -
mod(int) - -Method in class org.luaj.vm2.LuaDouble -
  -
mod(LuaValue) - -Method in class org.luaj.vm2.LuaInteger -
  -
mod(double) - -Method in class org.luaj.vm2.LuaInteger -
  -
mod(int) - -Method in class org.luaj.vm2.LuaInteger -
  -
mod(LuaValue) - -Method in class org.luaj.vm2.LuaString -
  -
mod(double) - -Method in class org.luaj.vm2.LuaString -
  -
mod(int) - -Method in class org.luaj.vm2.LuaString -
  -
MOD - -Static variable in class org.luaj.vm2.LuaValue -
LuaString constant with value "__mod" for use as metatag -
mod(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Modulo: Perform numeric modulo operation with another value - of unknown type, - including metatag processing. -
mod(double) - -Method in class org.luaj.vm2.LuaValue -
Modulo: Perform numeric modulo operation with another value - of double type without metatag processing -
mod(int) - -Method in class org.luaj.vm2.LuaValue -
Modulo: Perform numeric modulo operation with another value - of int type without metatag processing -
MODE - -Static variable in class org.luaj.vm2.LuaValue -
LuaString constant with value "__mode" for use as metatag -
modFrom(double) - -Method in class org.luaj.vm2.LuaDouble -
  -
modFrom(double) - -Method in class org.luaj.vm2.LuaInteger -
  -
modFrom(double) - -Method in class org.luaj.vm2.LuaString -
  -
modFrom(double) - -Method in class org.luaj.vm2.LuaValue -
Reverse-modulo: Perform numeric modulo operation from another value - with metatag processing -
module(Varargs) - -Method in class org.luaj.vm2.lib.PackageLib -
module (name [, ...]) - - Creates a module. -
mul(LuaValue) - -Method in class org.luaj.vm2.LuaDouble -
  -
mul(double) - -Method in class org.luaj.vm2.LuaDouble -
  -
mul(int) - -Method in class org.luaj.vm2.LuaDouble -
  -
mul(LuaValue) - -Method in class org.luaj.vm2.LuaInteger -
  -
mul(double) - -Method in class org.luaj.vm2.LuaInteger -
  -
mul(int) - -Method in class org.luaj.vm2.LuaInteger -
  -
mul(LuaValue) - -Method in class org.luaj.vm2.LuaString -
  -
mul(double) - -Method in class org.luaj.vm2.LuaString -
  -
mul(int) - -Method in class org.luaj.vm2.LuaString -
  -
MUL - -Static variable in class org.luaj.vm2.LuaValue -
LuaString constant with value "__mul" for use as metatag -
mul(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Multiply: Perform numeric multiply operation with another value - of unknown type, - including metatag processing. -
mul(double) - -Method in class org.luaj.vm2.LuaValue -
Multiply: Perform numeric multiply operation with another value - of double type with metatag processing -
mul(int) - -Method in class org.luaj.vm2.LuaValue -
Multiply: Perform numeric multiply operation with another value - of int type with metatag processing -
-
-

-N

-
-
name - -Variable in class org.luaj.vm2.lib.LibFunction -
The common name for this function, useful for debugging. -
NAN - -Static variable in class org.luaj.vm2.LuaDouble -
Constant LuaDouble representing NaN (not a number) -
narg() - -Method in class org.luaj.vm2.LuaValue -
  -
narg() - -Method in class org.luaj.vm2.TailcallVarargs -
  -
narg() - -Method in class org.luaj.vm2.Varargs -
Get the number of arguments, or 0 if there are none. -
nCcalls - -Variable in class org.luaj.vm2.compiler.LuaC -
  -
neg() - -Method in class org.luaj.vm2.LuaDouble -
  -
neg() - -Method in class org.luaj.vm2.LuaInteger -
  -
neg() - -Method in class org.luaj.vm2.LuaString -
  -
neg() - -Method in class org.luaj.vm2.LuaValue -
Unary minus: return negative value (-this) as defined by lua unary minus operator -
NEGINF - -Static variable in class org.luaj.vm2.LuaDouble -
Constant LuaDouble representing negative infinity -
neq(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Notquals: Perform inequality comparison with another value - including metatag processing using EQ. -
neq_b(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Notquals: Perform inequality comparison with another value - including metatag processing using EQ. -
NEWINDEX - -Static variable in class org.luaj.vm2.LuaValue -
LuaString constant with value "__newindex" for use as metatag -
newTString(byte[], int, int) - -Method in class org.luaj.vm2.compiler.LuaC -
  -
newupe() - -Static method in class org.luaj.vm2.lib.LibFunction -
Java code generation utility to allocate storage for upvalue, leave it empty -
newupl(LuaValue) - -Static method in class org.luaj.vm2.lib.LibFunction -
Java code generation utility to allocate storage for upvalue, initialize with value -
newupn() - -Static method in class org.luaj.vm2.lib.LibFunction -
Java code generation utility to allocate storage for upvalue, initialize with nil -
next(LuaValue) - -Method in class org.luaj.vm2.LuaTable -
Get the next element after a particular key in the table -
next(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Find the next key,value pair if this is a table, - return NIL if there are no more, or throw a LuaError if not a table. -
next(LuaValue) - -Method in class org.luaj.vm2.WeakTable -
Get the next element after a particular key in the table -
NIL - -Static variable in class org.luaj.vm2.LuaValue -
LuaValue constant corresponding to lua nil -
NILS - -Static variable in class org.luaj.vm2.LuaValue -
Array of NIL values to optimize filling stacks using System.arraycopy(). -
NO_REG - -Static variable in class org.luaj.vm2.Lua -
invalid register that fits in 8 bits -
NONE - -Static variable in class org.luaj.vm2.LuaValue -
LuaValue constant corresponding to a Varargs list of no values -
not() - -Method in class org.luaj.vm2.LuaBoolean -
  -
not() - -Method in class org.luaj.vm2.LuaNil -
  -
not() - -Method in class org.luaj.vm2.LuaValue -
Unary not: return inverse boolean value (~this) as defined by lua not operator -
NOVALS - -Static variable in class org.luaj.vm2.LuaValue -
LuaValue array constant with no values -
NUM_OPCODES - -Static variable in class org.luaj.vm2.Lua -
  -
NUMBER_FORMAT_FLOATS_OR_DOUBLES - -Static variable in class org.luaj.vm2.LoadState -
format corresponding to non-number-patched lua, all numbers are floats or doubles -
NUMBER_FORMAT_INTS_ONLY - -Static variable in class org.luaj.vm2.LoadState -
format corresponding to non-number-patched lua, all numbers are ints -
NUMBER_FORMAT_NUM_PATCH_INT32 - -Static variable in class org.luaj.vm2.LoadState -
format corresponding to number-patched lua, all numbers are 32-bit (4 byte) ints -
numparams - -Variable in class org.luaj.vm2.Prototype -
  -
nups - -Variable in class org.luaj.vm2.Prototype -
  -
-
-

-O

-
-
onCall(LuaFunction) - -Static method in class org.luaj.vm2.LuaThread -
Callback used at the beginning of a call to prepare for possible getfenv/setfenv calls -
ONE - -Static variable in class org.luaj.vm2.LuaValue -
LuaValue number constant equal to 1 -
OneArgFunction - Class in org.luaj.vm2.lib
Abstract base class for Java function implementations that take one argument and - return one value.
OneArgFunction() - -Constructor for class org.luaj.vm2.lib.OneArgFunction -
Default constructor -
OneArgFunction(LuaValue) - -Constructor for class org.luaj.vm2.lib.OneArgFunction -
Constructor with specific environment -
onInvoke(Varargs) - -Method in class org.luaj.vm2.lib.VarArgFunction -
Override to provide a call implementation that runs in an environment - that can participate in setfenv, and behaves as expected - when returning TailcallVarargs. -
onInvoke(Varargs) - -Method in class org.luaj.vm2.LuaClosure -
  -
onInvoke(Varargs) - -Method in class org.luaj.vm2.LuaValue -
Callback used during tail call processing to invoke the function once. -
onReturn() - -Method in class org.luaj.vm2.LuaThread.CallStack -
Method to signal the end of a call -
OP_ADD - -Static variable in class org.luaj.vm2.Lua -
  -
OP_AND - -Static variable in class org.luaj.vm2.Lua -
  -
OP_CALL - -Static variable in class org.luaj.vm2.Lua -
  -
OP_CLOSE - -Static variable in class org.luaj.vm2.Lua -
  -
OP_CLOSURE - -Static variable in class org.luaj.vm2.Lua -
  -
OP_CONCAT - -Static variable in class org.luaj.vm2.Lua -
  -
OP_DIV - -Static variable in class org.luaj.vm2.Lua -
  -
OP_EQ - -Static variable in class org.luaj.vm2.Lua -
  -
OP_FORLOOP - -Static variable in class org.luaj.vm2.Lua -
  -
OP_FORPREP - -Static variable in class org.luaj.vm2.Lua -
  -
OP_GE - -Static variable in class org.luaj.vm2.Lua -
  -
OP_GETGLOBAL - -Static variable in class org.luaj.vm2.Lua -
  -
OP_GETTABLE - -Static variable in class org.luaj.vm2.Lua -
  -
OP_GETUPVAL - -Static variable in class org.luaj.vm2.Lua -
  -
OP_GT - -Static variable in class org.luaj.vm2.Lua -
  -
OP_JMP - -Static variable in class org.luaj.vm2.Lua -
  -
OP_LE - -Static variable in class org.luaj.vm2.Lua -
  -
OP_LEN - -Static variable in class org.luaj.vm2.Lua -
  -
OP_LOADBOOL - -Static variable in class org.luaj.vm2.Lua -
  -
OP_LOADK - -Static variable in class org.luaj.vm2.Lua -
  -
OP_LOADNIL - -Static variable in class org.luaj.vm2.Lua -
  -
OP_LT - -Static variable in class org.luaj.vm2.Lua -
  -
OP_MOD - -Static variable in class org.luaj.vm2.Lua -
  -
OP_MOVE - -Static variable in class org.luaj.vm2.Lua -
  -
OP_MUL - -Static variable in class org.luaj.vm2.Lua -
  -
OP_NEQ - -Static variable in class org.luaj.vm2.Lua -
  -
OP_NEWTABLE - -Static variable in class org.luaj.vm2.Lua -
  -
OP_NOT - -Static variable in class org.luaj.vm2.Lua -
  -
OP_OR - -Static variable in class org.luaj.vm2.Lua -
  -
OP_POW - -Static variable in class org.luaj.vm2.Lua -
  -
OP_RETURN - -Static variable in class org.luaj.vm2.Lua -
  -
OP_SELF - -Static variable in class org.luaj.vm2.Lua -
  -
OP_SETGLOBAL - -Static variable in class org.luaj.vm2.Lua -
  -
OP_SETLIST - -Static variable in class org.luaj.vm2.Lua -
  -
OP_SETTABLE - -Static variable in class org.luaj.vm2.Lua -
  -
OP_SETUPVAL - -Static variable in class org.luaj.vm2.Lua -
  -
OP_SUB - -Static variable in class org.luaj.vm2.Lua -
  -
OP_TAILCALL - -Static variable in class org.luaj.vm2.Lua -
  -
OP_TEST - -Static variable in class org.luaj.vm2.Lua -
  -
OP_TESTSET - -Static variable in class org.luaj.vm2.Lua -
  -
OP_TFORLOOP - -Static variable in class org.luaj.vm2.Lua -
  -
OP_UNM - -Static variable in class org.luaj.vm2.Lua -
  -
OP_VARARG - -Static variable in class org.luaj.vm2.Lua -
  -
OpArgK - -Static variable in class org.luaj.vm2.Lua -
  -
OpArgN - -Static variable in class org.luaj.vm2.Lua -
  -
OpArgR - -Static variable in class org.luaj.vm2.Lua -
  -
OpArgU - -Static variable in class org.luaj.vm2.Lua -
  -
opcode - -Variable in class org.luaj.vm2.lib.LibFunction -
User-defined opcode to differentiate between instances of the library function class. -
openFile(String, boolean, boolean, boolean, boolean) - -Method in class org.luaj.vm2.lib.IoLib -
Open a file in a particular mode. -
openFile(String, boolean, boolean, boolean, boolean) - -Method in class org.luaj.vm2.lib.jme.JmeIoLib -
  -
openFile(String, boolean, boolean, boolean, boolean) - -Method in class org.luaj.vm2.lib.jse.JseIoLib -
  -
openProgram(String, String) - -Method in class org.luaj.vm2.lib.IoLib -
Start a new process and return a file for input or output -
openProgram(String, String) - -Method in class org.luaj.vm2.lib.jme.JmeIoLib -
  -
openProgram(String, String) - -Method in class org.luaj.vm2.lib.jse.JseIoLib -
  -
OPNAMES - -Static variable in class org.luaj.vm2.Print -
  -
optboolean(boolean) - -Method in class org.luaj.vm2.LuaBoolean -
  -
optboolean(boolean) - -Method in class org.luaj.vm2.LuaNil -
  -
optboolean(boolean) - -Method in class org.luaj.vm2.LuaValue -
Check that optional argument is a boolean and return its boolean value -
optboolean(int, boolean) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a boolean value, defval if nil, or throw a LuaError if any other type. -
optclosure(LuaClosure) - -Method in class org.luaj.vm2.LuaClosure -
  -
optclosure(LuaClosure) - -Method in class org.luaj.vm2.LuaNil -
  -
optclosure(LuaClosure) - -Method in class org.luaj.vm2.LuaValue -
Check that optional argument is a closure and return as LuaClosure -
optclosure(int, LuaClosure) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a closure, defval if nil, or throw a LuaError if any other type. -
optdouble(double) - -Method in class org.luaj.vm2.LuaDouble -
  -
optdouble(double) - -Method in class org.luaj.vm2.LuaInteger -
  -
optdouble(double) - -Method in class org.luaj.vm2.LuaNil -
  -
optdouble(double) - -Method in class org.luaj.vm2.LuaString -
  -
optdouble(double) - -Method in class org.luaj.vm2.LuaValue -
Check that optional argument is a number or string convertible to number and return as double -
optdouble(int, double) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a double, defval if nil, or throw a LuaError if it cannot be converted to one. -
optfunction(LuaFunction) - -Method in class org.luaj.vm2.LuaFunction -
  -
optfunction(LuaFunction) - -Method in class org.luaj.vm2.LuaNil -
  -
optfunction(LuaFunction) - -Method in class org.luaj.vm2.LuaValue -
Check that optional argument is a function and return as LuaFunction -
optfunction(int, LuaFunction) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a function, defval if nil, or throw a LuaError if an incompatible type. -
optint(int) - -Method in class org.luaj.vm2.LuaDouble -
  -
optint(int) - -Method in class org.luaj.vm2.LuaInteger -
  -
optint(int) - -Method in class org.luaj.vm2.LuaNil -
  -
optint(int) - -Method in class org.luaj.vm2.LuaString -
  -
optint(int) - -Method in class org.luaj.vm2.LuaValue -
Check that optional argument is a number or string convertible to number and return as int -
optint(int, int) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a java int value, discarding any fractional part, defval if nil, or throw a LuaError if not a number. -
optinteger(LuaInteger) - -Method in class org.luaj.vm2.LuaDouble -
  -
optinteger(LuaInteger) - -Method in class org.luaj.vm2.LuaInteger -
  -
optinteger(LuaInteger) - -Method in class org.luaj.vm2.LuaNil -
  -
optinteger(LuaInteger) - -Method in class org.luaj.vm2.LuaString -
  -
optinteger(LuaInteger) - -Method in class org.luaj.vm2.LuaValue -
Check that optional argument is a number or string convertible to number and return as LuaInteger -
optinteger(int, LuaInteger) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a java int value, defval if nil, or throw a LuaError if not a number or is not representable by a java int. -
optjstring(String) - -Method in class org.luaj.vm2.LuaDouble -
  -
optjstring(String) - -Method in class org.luaj.vm2.LuaInteger -
  -
optjstring(String) - -Method in class org.luaj.vm2.LuaNil -
  -
optjstring(String) - -Method in class org.luaj.vm2.LuaString -
  -
optjstring(String) - -Method in class org.luaj.vm2.LuaValue -
Check that optional argument is a string or number and return as Java String -
optjstring(int, String) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a java String if a string or number, defval if nil, or throw a LuaError if any other type -
optlong(long) - -Method in class org.luaj.vm2.LuaDouble -
  -
optlong(long) - -Method in class org.luaj.vm2.LuaInteger -
  -
optlong(long) - -Method in class org.luaj.vm2.LuaNil -
  -
optlong(long) - -Method in class org.luaj.vm2.LuaString -
  -
optlong(long) - -Method in class org.luaj.vm2.LuaValue -
Check that optional argument is a number or string convertible to number and return as long -
optlong(int, long) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a java long value, discarding any fractional part, defval if nil, or throw a LuaError if not a number. -
optnumber(LuaNumber) - -Method in class org.luaj.vm2.LuaDouble -
  -
optnumber(LuaNumber) - -Method in class org.luaj.vm2.LuaNil -
  -
optnumber(LuaNumber) - -Method in class org.luaj.vm2.LuaNumber -
  -
optnumber(LuaNumber) - -Method in class org.luaj.vm2.LuaString -
  -
optnumber(LuaNumber) - -Method in class org.luaj.vm2.LuaValue -
Check that optional argument is a number or string convertible to number and return as LuaNumber -
optnumber(int, LuaNumber) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a LuaNumber, defval if nil, or throw a LuaError if not a number or string that can be converted to a number. -
optstring(LuaString) - -Method in class org.luaj.vm2.LuaDouble -
  -
optstring(LuaString) - -Method in class org.luaj.vm2.LuaInteger -
  -
optstring(LuaString) - -Method in class org.luaj.vm2.LuaNil -
  -
optstring(LuaString) - -Method in class org.luaj.vm2.LuaString -
  -
optstring(LuaString) - -Method in class org.luaj.vm2.LuaValue -
Check that optional argument is a string or number and return as LuaString -
optstring(int, LuaString) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a LuaString if a string or number, defval if nil, or throw a LuaError if any other type -
opttable(LuaTable) - -Method in class org.luaj.vm2.LuaNil -
  -
opttable(LuaTable) - -Method in class org.luaj.vm2.LuaTable -
  -
opttable(LuaTable) - -Method in class org.luaj.vm2.LuaValue -
Check that optional argument is a table and return as LuaTable -
opttable(int, LuaTable) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a LuaTable if a lua table, defval if nil, or throw a LuaError if any other type. -
optthread(LuaThread) - -Method in class org.luaj.vm2.LuaNil -
  -
optthread(LuaThread) - -Method in class org.luaj.vm2.LuaThread -
  -
optthread(LuaThread) - -Method in class org.luaj.vm2.LuaValue -
Check that optional argument is a thread and return as LuaThread -
optthread(int, LuaThread) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a LuaThread if a lua thread, defval if nil, or throw a LuaError if any other type. -
optuserdata(Object) - -Method in class org.luaj.vm2.LuaNil -
  -
optuserdata(Class, Object) - -Method in class org.luaj.vm2.LuaNil -
  -
optuserdata(Object) - -Method in class org.luaj.vm2.LuaUserdata -
  -
optuserdata(Class, Object) - -Method in class org.luaj.vm2.LuaUserdata -
  -
optuserdata(Object) - -Method in class org.luaj.vm2.LuaValue -
Check that optional argument is a userdata and return the Object instance -
optuserdata(Class, Object) - -Method in class org.luaj.vm2.LuaValue -
Check that optional argument is a userdata whose instance is of a type - and return the Object instance -
optuserdata(int, Object) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a java Object if a userdata, defval if nil, or throw a LuaError if any other type. -
optuserdata(int, Class, Object) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a java Object if it is a userdata whose instance Class c or a subclass, - defval if nil, or throw a LuaError if any other type. -
optvalue(LuaValue) - -Method in class org.luaj.vm2.LuaNil -
  -
optvalue(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Perform argument check that this is not nil or none. -
optvalue(int, LuaValue) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a LuaValue if it exists, or defval. -
or(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Perform boolean or with another operand, based on lua rules for boolean evaluation. -
org.luaj.vm2 - package org.luaj.vm2
 
org.luaj.vm2.compiler - package org.luaj.vm2.compiler
 
org.luaj.vm2.lib - package org.luaj.vm2.lib
 
org.luaj.vm2.lib.jme - package org.luaj.vm2.lib.jme
 
org.luaj.vm2.lib.jse - package org.luaj.vm2.lib.jse
 
org.luaj.vm2.luajc - package org.luaj.vm2.luajc
 
OrphanedThread - Error in org.luaj.vm2
Error sublcass that indicates a lua thread that is no - longer referenced has been detected.
OrphanedThread() - -Constructor for error org.luaj.vm2.OrphanedThread -
  -
OsLib - Class in org.luaj.vm2.lib
Subclass of LibFunction which implements the standard lua os library.
OsLib() - -Constructor for class org.luaj.vm2.lib.OsLib -
Create and OsLib instance. -
-
-

-P

-
-
p - -Variable in class org.luaj.vm2.LuaClosure -
  -
p - -Variable in class org.luaj.vm2.Prototype -
  -
PACKAGE - -Variable in class org.luaj.vm2.lib.PackageLib -
  -
PackageLib - Class in org.luaj.vm2.lib
Subclass of LibFunction which implements the lua standard package and module - library functions.
PackageLib() - -Constructor for class org.luaj.vm2.lib.PackageLib -
  -
pcall(LuaValue, Varargs, LuaValue) - -Static method in class org.luaj.vm2.lib.BaseLib -
  -
peek() - -Method in class org.luaj.vm2.lib.IoLib.File -
  -
POS_A - -Static variable in class org.luaj.vm2.Lua -
  -
POS_B - -Static variable in class org.luaj.vm2.Lua -
  -
POS_Bx - -Static variable in class org.luaj.vm2.Lua -
  -
POS_C - -Static variable in class org.luaj.vm2.Lua -
  -
POS_OP - -Static variable in class org.luaj.vm2.Lua -
  -
POSINF - -Static variable in class org.luaj.vm2.LuaDouble -
Constant LuaDouble representing positive infinity -
pow(LuaValue) - -Method in class org.luaj.vm2.LuaDouble -
  -
pow(double) - -Method in class org.luaj.vm2.LuaDouble -
  -
pow(int) - -Method in class org.luaj.vm2.LuaDouble -
  -
pow(LuaValue) - -Method in class org.luaj.vm2.LuaInteger -
  -
pow(double) - -Method in class org.luaj.vm2.LuaInteger -
  -
pow(int) - -Method in class org.luaj.vm2.LuaInteger -
  -
pow(LuaValue) - -Method in class org.luaj.vm2.LuaString -
  -
pow(double) - -Method in class org.luaj.vm2.LuaString -
  -
pow(int) - -Method in class org.luaj.vm2.LuaString -
  -
POW - -Static variable in class org.luaj.vm2.LuaValue -
LuaString constant with value "__pow" for use as metatag -
pow(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Raise to power: Raise this value to a power - including metatag processing. -
pow(double) - -Method in class org.luaj.vm2.LuaValue -
Raise to power: Raise this value to a power - of double type with metatag processing -
pow(int) - -Method in class org.luaj.vm2.LuaValue -
Raise to power: Raise this value to a power - of int type with metatag processing -
powWith(double) - -Method in class org.luaj.vm2.LuaDouble -
  -
powWith(int) - -Method in class org.luaj.vm2.LuaDouble -
  -
powWith(double) - -Method in class org.luaj.vm2.LuaInteger -
  -
powWith(int) - -Method in class org.luaj.vm2.LuaInteger -
  -
powWith(double) - -Method in class org.luaj.vm2.LuaString -
  -
powWith(int) - -Method in class org.luaj.vm2.LuaString -
  -
powWith(double) - -Method in class org.luaj.vm2.LuaValue -
Reverse-raise to power: Raise another value of double type to this power - with metatag processing -
powWith(int) - -Method in class org.luaj.vm2.LuaValue -
Reverse-raise to power: Raise another value of double type to this power - with metatag processing -
preload_loader - -Variable in class org.luaj.vm2.lib.PackageLib -
Loader that loads from preload table if found there -
prepend(LuaString) - -Method in class org.luaj.vm2.Buffer -
Concatenate bytes from a LuaString onto the front of this buffer -
presize(int) - -Method in class org.luaj.vm2.LuaTable -
  -
presize(int, int) - -Method in class org.luaj.vm2.LuaTable -
  -
presize(int) - -Method in class org.luaj.vm2.LuaValue -
Preallocate the array part of a table to be a certain size, -
presize(int) - -Method in class org.luaj.vm2.WeakTable -
  -
presize(int, int) - -Method in class org.luaj.vm2.WeakTable -
Presize capacity of both array and hash parts. -
Print - Class in org.luaj.vm2
Debug helper class to pretty-print lua bytecodes.
Print() - -Constructor for class org.luaj.vm2.Print -
  -
print(Prototype) - -Static method in class org.luaj.vm2.Print -
  -
printCode(Prototype) - -Static method in class org.luaj.vm2.Print -
Print the code in a prototype -
printFunction(Prototype, boolean) - -Static method in class org.luaj.vm2.Print -
  -
printOpCode(Prototype, int) - -Static method in class org.luaj.vm2.Print -
Print an opcode in a prototype -
printOpCode(PrintStream, Prototype, int) - -Static method in class org.luaj.vm2.Print -
Print an opcode in a prototype -
printStackTrace() - -Method in exception org.luaj.vm2.LuaError -
Print the message and stack trace -
printState(LuaClosure, int, LuaValue[], int, Varargs) - -Static method in class org.luaj.vm2.Print -
Print the state of a LuaClosure that is being executed -
Prototype - Class in org.luaj.vm2
Prototype representing compiled lua code.
Prototype() - -Constructor for class org.luaj.vm2.Prototype -
  -
ps - -Static variable in class org.luaj.vm2.Print -
  -
pushfstring(String) - -Method in class org.luaj.vm2.compiler.LuaC -
  -
-
-

-R

-
-
raweq(LuaValue) - -Method in class org.luaj.vm2.LuaDouble -
  -
raweq(double) - -Method in class org.luaj.vm2.LuaDouble -
  -
raweq(int) - -Method in class org.luaj.vm2.LuaDouble -
  -
raweq(LuaValue) - -Method in class org.luaj.vm2.LuaInteger -
  -
raweq(double) - -Method in class org.luaj.vm2.LuaInteger -
  -
raweq(int) - -Method in class org.luaj.vm2.LuaInteger -
  -
raweq(LuaValue) - -Method in class org.luaj.vm2.LuaString -
  -
raweq(LuaString) - -Method in class org.luaj.vm2.LuaString -
  -
raweq(LuaValue) - -Method in class org.luaj.vm2.LuaUserdata -
  -
raweq(LuaUserdata) - -Method in class org.luaj.vm2.LuaUserdata -
  -
raweq(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Equals: Perform direct equality comparison with another value - without metatag processing. -
raweq(LuaUserdata) - -Method in class org.luaj.vm2.LuaValue -
Equals: Perform direct equality comparison with a LuaUserdata value - without metatag processing. -
raweq(LuaString) - -Method in class org.luaj.vm2.LuaValue -
Equals: Perform direct equality comparison with a LuaString value - without metatag processing. -
raweq(double) - -Method in class org.luaj.vm2.LuaValue -
Equals: Perform direct equality comparison with a double value - without metatag processing. -
raweq(int) - -Method in class org.luaj.vm2.LuaValue -
Equals: Perform direct equality comparison with a int value - without metatag processing. -
rawget(int) - -Method in class org.luaj.vm2.LuaTable -
  -
rawget(LuaValue) - -Method in class org.luaj.vm2.LuaTable -
  -
rawget(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Get a value in a table without metatag processing. -
rawget(int) - -Method in class org.luaj.vm2.LuaValue -
Get a value in a table without metatag processing. -
rawget(String) - -Method in class org.luaj.vm2.LuaValue -
Get a value in a table without metatag processing. -
rawget(int) - -Method in class org.luaj.vm2.WeakTable -
  -
rawget(LuaValue) - -Method in class org.luaj.vm2.WeakTable -
  -
rawset(int, LuaValue) - -Method in class org.luaj.vm2.LuaTable -
  -
rawset(LuaValue, LuaValue) - -Method in class org.luaj.vm2.LuaTable -
caller must ensure key is not nil -
rawset(LuaValue, LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Set a value in a table without metatag processing. -
rawset(int, LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Set a value in a table without metatag processing. -
rawset(int, String) - -Method in class org.luaj.vm2.LuaValue -
Set a value in a table without metatag processing. -
rawset(String, LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Set a value in a table without metatag processing. -
rawset(String, double) - -Method in class org.luaj.vm2.LuaValue -
Set a value in a table without metatag processing. -
rawset(String, int) - -Method in class org.luaj.vm2.LuaValue -
Set a value in a table without metatag processing. -
rawset(String, String) - -Method in class org.luaj.vm2.LuaValue -
Set a value in a table without metatag processing. -
rawset(int, LuaValue) - -Method in class org.luaj.vm2.WeakTable -
  -
rawset(LuaValue, LuaValue) - -Method in class org.luaj.vm2.WeakTable -
  -
rawsetlist(int, Varargs) - -Method in class org.luaj.vm2.LuaValue -
Set list values in a table without invoking metatag processing -
read() - -Method in class org.luaj.vm2.lib.IoLib.File -
  -
read(byte[], int, int) - -Method in class org.luaj.vm2.lib.IoLib.File -
  -
remaining() - -Method in class org.luaj.vm2.lib.IoLib.File -
  -
remove(String) - -Method in class org.luaj.vm2.lib.jse.JseOsLib -
  -
remove(String) - -Method in class org.luaj.vm2.lib.OsLib -
Deletes the file or directory with the given name. -
remove(int) - -Method in class org.luaj.vm2.LuaTable -
Remove the element at a position in a list-table -
rename(String, String) - -Method in class org.luaj.vm2.lib.jse.JseOsLib -
  -
rename(String, String) - -Method in class org.luaj.vm2.lib.OsLib -
Renames file or directory named oldname to newname. -
require(LuaValue) - -Method in class org.luaj.vm2.lib.PackageLib -
require (modname) - - Loads the given module. -
ResourceFinder - Interface in org.luaj.vm2.lib
Interface for opening application resource files such as scripts sources.
resume(Varargs) - -Method in class org.luaj.vm2.LuaThread -
Start or resume this thread -
RKASK(int) - -Static method in class org.luaj.vm2.Lua -
code a constant index as a RK value -
-
-

-S

-
-
s_metatable - -Static variable in class org.luaj.vm2.LuaBoolean -
Shared static metatable for boolean values represented in lua. -
s_metatable - -Static variable in class org.luaj.vm2.LuaFunction -
Shared static metatable for all functions and closures. -
s_metatable - -Static variable in class org.luaj.vm2.LuaNil -
  -
s_metatable - -Static variable in class org.luaj.vm2.LuaNumber -
Shared static metatable for all number values represented in lua. -
s_metatable - -Static variable in class org.luaj.vm2.LuaString -
The singleton instance representing lua true -
s_metatable - -Static variable in class org.luaj.vm2.LuaThread -
  -
scannumber(int) - -Method in class org.luaj.vm2.LuaString -
Convert to a number in a base, or return Double.NaN if not a number. -
seek(String, int) - -Method in class org.luaj.vm2.lib.IoLib.File -
  -
set(int, LuaValue) - -Method in class org.luaj.vm2.LuaTable -
  -
set(LuaValue, LuaValue) - -Method in class org.luaj.vm2.LuaTable -
caller must ensure key is not nil -
set(LuaValue, LuaValue) - -Method in class org.luaj.vm2.LuaUserdata -
  -
set(LuaValue, LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Set a value in a table without metatag processing using NEWINDEX. -
set(int, LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Set a value in a table without metatag processing using NEWINDEX. -
set(int, String) - -Method in class org.luaj.vm2.LuaValue -
Set a value in a table without metatag processing using NEWINDEX. -
set(String, LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Set a value in a table without metatag processing using NEWINDEX. -
set(String, double) - -Method in class org.luaj.vm2.LuaValue -
Set a value in a table without metatag processing using NEWINDEX. -
set(String, int) - -Method in class org.luaj.vm2.LuaValue -
Set a value in a table without metatag processing using NEWINDEX. -
set(String, String) - -Method in class org.luaj.vm2.LuaValue -
Set a value in a table without metatag processing using NEWINDEX. -
setErrorFunc(LuaValue) - -Static method in class org.luaj.vm2.LuaThread -
Replace the error function of the currently running thread. -
setfenv(LuaValue) - -Method in class org.luaj.vm2.LuaFunction -
  -
setfenv(LuaValue) - -Method in class org.luaj.vm2.LuaThread -
  -
setfenv(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Set the environment on an object. -
setGlobals(LuaValue) - -Static method in class org.luaj.vm2.LuaThread -
Set the globals of the current thread. -
setIsLoaded(String, LuaTable) - -Method in class org.luaj.vm2.lib.PackageLib -
Allow packages to mark themselves as loaded -
setlocale(String, String) - -Method in class org.luaj.vm2.lib.OsLib -
Sets the current locale of the program. -
setLuaPath(String) - -Method in class org.luaj.vm2.lib.PackageLib -
  -
setmetatable(LuaValue) - -Method in class org.luaj.vm2.LuaTable -
  -
setmetatable(LuaValue) - -Method in class org.luaj.vm2.LuaUserdata -
  -
setmetatable(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Set the metatable for this LuaValue -
settable(LuaValue, LuaValue, LuaValue) - -Static method in class org.luaj.vm2.LuaValue -
Perform field assignment including metatag processing. -
setUpvalue(int, LuaValue) - -Method in class org.luaj.vm2.LuaClosure -
  -
setvalue(LuaValue) - -Method in class org.luaj.vm2.Buffer -
Set buffer contents as a LuaValue -
setValue(LuaValue) - -Method in class org.luaj.vm2.UpValue -
Set the value of the upvalue -
setvbuf(String, int) - -Method in class org.luaj.vm2.lib.IoLib.File -
  -
SIZE_A - -Static variable in class org.luaj.vm2.Lua -
  -
SIZE_B - -Static variable in class org.luaj.vm2.Lua -
  -
SIZE_Bx - -Static variable in class org.luaj.vm2.Lua -
  -
SIZE_C - -Static variable in class org.luaj.vm2.Lua -
  -
SIZE_OP - -Static variable in class org.luaj.vm2.Lua -
  -
sort(LuaValue) - -Method in class org.luaj.vm2.LuaTable -
Sort the table using a comparator. -
sort(LuaValue) - -Method in class org.luaj.vm2.WeakTable -
  -
source - -Variable in class org.luaj.vm2.Prototype -
  -
SOURCE_BINARY_STRING - -Static variable in class org.luaj.vm2.LoadState -
Name for compiled chunks -
sourceshort(Prototype) - -Static method in class org.luaj.vm2.lib.DebugLib -
  -
standardGlobals() - -Static method in class org.luaj.vm2.lib.jme.JmePlatform -
Create a standard set of globals for JME including all the libraries. -
standardGlobals() - -Static method in class org.luaj.vm2.lib.jse.JsePlatform -
Create a standard set of globals for JSE including all the libraries. -
startpc - -Variable in class org.luaj.vm2.LocVars -
The instruction offset when the variable comes into scope -
STDERR - -Variable in class org.luaj.vm2.lib.BaseLib -
  -
STDIN - -Variable in class org.luaj.vm2.lib.BaseLib -
  -
STDIN - -Variable in class org.luaj.vm2.lib.PackageLib -
  -
STDOUT - -Variable in class org.luaj.vm2.lib.BaseLib -
  -
STDOUT - -Variable in class org.luaj.vm2.lib.PackageLib -
  -
strcmp(LuaString) - -Method in class org.luaj.vm2.LuaDouble -
  -
strcmp(LuaString) - -Method in class org.luaj.vm2.LuaInteger -
  -
strcmp(LuaValue) - -Method in class org.luaj.vm2.LuaString -
  -
strcmp(LuaString) - -Method in class org.luaj.vm2.LuaString -
  -
strcmp(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Perform string comparison with another value - of any type - using string comparison based on byte values. -
strcmp(LuaString) - -Method in class org.luaj.vm2.LuaValue -
Perform string comparison with another value - known to be a LuaString - using string comparison based on byte values. -
StringLib - Class in org.luaj.vm2.lib
Subclass of LibFunction which implements the lua standard string - library.
StringLib() - -Constructor for class org.luaj.vm2.lib.StringLib -
  -
strongkey() - -Method in class org.luaj.vm2.LuaValue -
Return the key part of this value if it is a weak table entry, or NIL if it was weak and is no longer referenced. -
strongvalue() - -Method in class org.luaj.vm2.LuaValue -
Return this value as a strong reference, or NIL if it was weak and is no longer referenced. -
strvalue() - -Method in class org.luaj.vm2.LuaDouble -
  -
strvalue() - -Method in class org.luaj.vm2.LuaInteger -
  -
strvalue() - -Method in class org.luaj.vm2.LuaString -
  -
strvalue() - -Method in class org.luaj.vm2.LuaValue -
Convert this value to a string if it is a LuaString or LuaNumber, - or throw a LuaError if it is not -
sub(LuaValue) - -Method in class org.luaj.vm2.LuaDouble -
  -
sub(double) - -Method in class org.luaj.vm2.LuaDouble -
  -
sub(int) - -Method in class org.luaj.vm2.LuaDouble -
  -
sub(LuaValue) - -Method in class org.luaj.vm2.LuaInteger -
  -
sub(double) - -Method in class org.luaj.vm2.LuaInteger -
  -
sub(int) - -Method in class org.luaj.vm2.LuaInteger -
  -
sub(LuaValue) - -Method in class org.luaj.vm2.LuaString -
  -
sub(double) - -Method in class org.luaj.vm2.LuaString -
  -
sub(int) - -Method in class org.luaj.vm2.LuaString -
  -
SUB - -Static variable in class org.luaj.vm2.LuaValue -
LuaString constant with value "__sub" for use as metatag -
sub(LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Subtract: Perform numeric subtract operation with another value - of unknown type, - including metatag processing. -
sub(double) - -Method in class org.luaj.vm2.LuaValue -
Subtract: Perform numeric subtract operation with another value - of double type with metatag processing -
sub(int) - -Method in class org.luaj.vm2.LuaValue -
Subtract: Perform numeric subtract operation with another value - of int type with metatag processing -
subargs(int) - -Method in class org.luaj.vm2.Varargs -
Create a Varargs instance containing arguments starting at index start -
subFrom(double) - -Method in class org.luaj.vm2.LuaDouble -
  -
subFrom(double) - -Method in class org.luaj.vm2.LuaInteger -
  -
subFrom(int) - -Method in class org.luaj.vm2.LuaInteger -
  -
subFrom(double) - -Method in class org.luaj.vm2.LuaString -
  -
subFrom(double) - -Method in class org.luaj.vm2.LuaValue -
Reverse-subtract: Perform numeric subtract operation from an int value - with metatag processing -
subFrom(int) - -Method in class org.luaj.vm2.LuaValue -
Reverse-subtract: Perform numeric subtract operation from a double value - without metatag processing -
substring(int, int) - -Method in class org.luaj.vm2.LuaString -
  -
-
-

-T

-
-
TableLib - Class in org.luaj.vm2.lib
Subclass of LibFunction which implements the lua standard table - library.
TableLib() - -Constructor for class org.luaj.vm2.lib.TableLib -
  -
tableOf() - -Static method in class org.luaj.vm2.LuaValue -
Construct an empty LuaTable. -
tableOf(Varargs, int) - -Static method in class org.luaj.vm2.LuaValue -
Construct a LuaTable initialized with supplied array values. -
tableOf(int, int) - -Static method in class org.luaj.vm2.LuaValue -
Construct an empty LuaTable preallocated to hold array and hashed elements -
tableOf(LuaValue[]) - -Static method in class org.luaj.vm2.LuaValue -
Construct a LuaTable initialized with supplied named values. -
tableOf(LuaValue[], LuaValue[]) - -Static method in class org.luaj.vm2.LuaValue -
Construct a LuaTable initialized with supplied named values and sequential elements. -
tableOf(LuaValue[], LuaValue[], Varargs) - -Static method in class org.luaj.vm2.LuaValue -
Construct a LuaTable initialized with supplied named values and sequential elements in an array part and as varargs. -
tailcallOf(LuaValue, Varargs) - -Static method in class org.luaj.vm2.LuaValue -
Construct a TailcallVarargs around a function and arguments. -
TailcallVarargs - Class in org.luaj.vm2
Subclass of Varargs that represents a lua tail call - in a Java library function execution environment.
TailcallVarargs(LuaValue, Varargs) - -Constructor for class org.luaj.vm2.TailcallVarargs -
  -
TailcallVarargs(LuaValue, LuaValue, Varargs) - -Constructor for class org.luaj.vm2.TailcallVarargs -
  -
TBOOLEAN - -Static variable in class org.luaj.vm2.LuaValue -
Type enumeration constant for lua booleans -
testAMode(int) - -Static method in class org.luaj.vm2.Lua -
  -
testfor_b(LuaValue, LuaValue) - -Method in class org.luaj.vm2.LuaValue -
Perform end-condition test in for-loop processing. -
testTMode(int) - -Static method in class org.luaj.vm2.Lua -
  -
TFUNCTION - -Static variable in class org.luaj.vm2.LuaValue -
Type enumeration constant for lua functions -
ThreeArgFunction - Class in org.luaj.vm2.lib
Abstract base class for Java function implementations that take two arguments and - return one value.
ThreeArgFunction() - -Constructor for class org.luaj.vm2.lib.ThreeArgFunction -
Default constructor -
ThreeArgFunction(LuaValue) - -Constructor for class org.luaj.vm2.lib.ThreeArgFunction -
Constructor with specific environment -
time(LuaTable) - -Method in class org.luaj.vm2.lib.OsLib -
Returns the current time when called without arguments, - or a time representing the date and time specified by the given table. -
TINT - -Static variable in class org.luaj.vm2.LuaValue -
Type enumeration constant for lua numbers that are ints, for compatibility with lua 5.1 number patch only -
TLIGHTUSERDATA - -Static variable in class org.luaj.vm2.LuaValue -
Type enumeration constant for lua light userdata, for compatibility with C-based lua only -
TMP_PREFIX - -Static variable in class org.luaj.vm2.lib.OsLib -
  -
TMP_SUFFIX - -Static variable in class org.luaj.vm2.lib.OsLib -
  -
tmpFile() - -Method in class org.luaj.vm2.lib.IoLib -
Open a temporary file. -
tmpFile() - -Method in class org.luaj.vm2.lib.jme.JmeIoLib -
  -
tmpFile() - -Method in class org.luaj.vm2.lib.jse.JseIoLib -
  -
tmpname() - -Method in class org.luaj.vm2.lib.jse.JseOsLib -
  -
tmpname() - -Method in class org.luaj.vm2.lib.OsLib -
Returns a string with a file name that can be used for a temporary file. -
TNIL - -Static variable in class org.luaj.vm2.LuaValue -
Type enumeration constant for lua nil -
TNONE - -Static variable in class org.luaj.vm2.LuaValue -
Type enumeration constant for lua values that have no type, for example weak table entries -
TNUMBER - -Static variable in class org.luaj.vm2.LuaValue -
Type enumeration constant for lua numbers -
toboolean() - -Method in class org.luaj.vm2.LuaBoolean -
  -
toboolean() - -Method in class org.luaj.vm2.LuaNil -
  -
toboolean() - -Method in class org.luaj.vm2.LuaValue -
Convert to boolean false if LuaValue.NIL or FALSE, true if anything else -
toboolean(int) - -Method in class org.luaj.vm2.Varargs -
Convert argument i to java boolean based on lua rules for boolean evaluation. -
tobyte() - -Method in class org.luaj.vm2.LuaDouble -
  -
tobyte() - -Method in class org.luaj.vm2.LuaInteger -
  -
tobyte() - -Method in class org.luaj.vm2.LuaString -
  -
tobyte() - -Method in class org.luaj.vm2.LuaValue -
Convert to byte if numeric, or 0 if not. -
tobyte(int) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a java byte value, discarding any fractional part and truncating, - or 0 if not a number. -
tochar() - -Method in class org.luaj.vm2.LuaDouble -
  -
tochar() - -Method in class org.luaj.vm2.LuaInteger -
  -
tochar() - -Method in class org.luaj.vm2.LuaString -
  -
tochar() - -Method in class org.luaj.vm2.LuaValue -
Convert to char if numeric, or 0 if not. -
tochar(int) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a java char value, discarding any fractional part and truncating, - or 0 if not a number. -
toClassname(String) - -Static method in class org.luaj.vm2.lib.PackageLib -
Convert lua filename to valid class name -
todouble() - -Method in class org.luaj.vm2.LuaDouble -
  -
todouble() - -Method in class org.luaj.vm2.LuaInteger -
  -
todouble() - -Method in class org.luaj.vm2.LuaString -
  -
todouble() - -Method in class org.luaj.vm2.LuaValue -
Convert to double if numeric, or 0 if not. -
todouble(int) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a java double value or 0 if not a number. -
tofloat() - -Method in class org.luaj.vm2.LuaDouble -
  -
tofloat() - -Method in class org.luaj.vm2.LuaInteger -
  -
tofloat() - -Method in class org.luaj.vm2.LuaString -
  -
tofloat() - -Method in class org.luaj.vm2.LuaValue -
Convert to float if numeric, or 0 if not. -
tofloat(int) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a java float value, discarding excess fractional part and truncating, - or 0 if not a number. -
toInputStream() - -Method in class org.luaj.vm2.LuaString -
Convert value to an input stream. -
toint() - -Method in class org.luaj.vm2.LuaDouble -
  -
toint() - -Method in class org.luaj.vm2.LuaInteger -
  -
toint() - -Method in class org.luaj.vm2.LuaString -
  -
toint() - -Method in class org.luaj.vm2.LuaValue -
Convert to int if numeric, or 0 if not. -
toint(int) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a java int value, discarding any fractional part and truncating, - or 0 if not a number. -
tojstring() - -Method in class org.luaj.vm2.Buffer -
Convert the buffer to a Java String -
tojstring() - -Method in class org.luaj.vm2.lib.IoLib.File -
  -
tojstring() - -Method in class org.luaj.vm2.lib.LibFunction -
  -
tojstring() - -Method in class org.luaj.vm2.lib.PackageLib -
  -
tojstring() - -Method in class org.luaj.vm2.LocVars -
  -
tojstring() - -Method in class org.luaj.vm2.LuaBoolean -
  -
tojstring() - -Method in class org.luaj.vm2.LuaDouble -
  -
tojstring() - -Method in class org.luaj.vm2.LuaInteger -
  -
tojstring() - -Method in class org.luaj.vm2.LuaNil -
  -
tojstring() - -Method in class org.luaj.vm2.LuaString -
  -
tojstring() - -Method in class org.luaj.vm2.LuaUserdata -
  -
tojstring() - -Method in class org.luaj.vm2.LuaValue -
Convert to human readable String for any type. -
tojstring() - -Method in class org.luaj.vm2.UpValue -
Convert this upvalue to a Java String -
tojstring(int) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a java String based on the type of the argument. -
tojstring() - -Method in class org.luaj.vm2.Varargs -
Convert the list of varargs values to a human readable java String. -
tolong() - -Method in class org.luaj.vm2.LuaDouble -
  -
tolong() - -Method in class org.luaj.vm2.LuaInteger -
  -
tolong() - -Method in class org.luaj.vm2.LuaString -
  -
tolong() - -Method in class org.luaj.vm2.LuaValue -
Convert to long if numeric, or 0 if not. -
tolong(int) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a java long value, discarding any fractional part and truncating, - or 0 if not a number. -
tonumber() - -Method in class org.luaj.vm2.LuaDouble -
  -
tonumber() - -Method in class org.luaj.vm2.LuaNumber -
  -
tonumber() - -Method in class org.luaj.vm2.LuaString -
  -
tonumber(int) - -Method in class org.luaj.vm2.LuaString -
convert to a number using a supplied base, or NIL if it can't be converted -
tonumber() - -Method in class org.luaj.vm2.LuaValue -
Conditionally convert to lua number without throwing errors. -
toshort() - -Method in class org.luaj.vm2.LuaDouble -
  -
toshort() - -Method in class org.luaj.vm2.LuaInteger -
  -
toshort() - -Method in class org.luaj.vm2.LuaString -
  -
toshort() - -Method in class org.luaj.vm2.LuaValue -
Convert to short if numeric, or 0 if not. -
toshort(int) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a java short value, discarding any fractional part and truncating, - or 0 if not a number. -
tostring() - -Method in class org.luaj.vm2.Buffer -
Convert the buffer to a LuaString -
toString() - -Method in class org.luaj.vm2.Buffer -
Convert the buffer to a Java String -
tostring() - -Method in class org.luaj.vm2.LuaDouble -
  -
tostring() - -Method in class org.luaj.vm2.LuaInteger -
  -
tostring() - -Method in class org.luaj.vm2.LuaString -
  -
TOSTRING - -Static variable in class org.luaj.vm2.LuaValue -
LuaString constant with value "__tostring" for use as metatag -
toString() - -Method in class org.luaj.vm2.LuaValue -
Convert the value to a human readable string using LuaValue.tojstring() -
tostring() - -Method in class org.luaj.vm2.LuaValue -
Conditionally convert to lua string without throwing errors. -
toString() - -Method in class org.luaj.vm2.Prototype -
  -
toString() - -Method in class org.luaj.vm2.Varargs -
Convert the value or values to a java String using Varargs.tojstring() -
touserdata() - -Method in class org.luaj.vm2.LuaUserdata -
  -
touserdata(Class) - -Method in class org.luaj.vm2.LuaUserdata -
  -
touserdata() - -Method in class org.luaj.vm2.LuaValue -
Convert to userdata instance, or null. -
touserdata(Class) - -Method in class org.luaj.vm2.LuaValue -
Convert to userdata instance if specific type, or null. -
touserdata(int) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a java Object if a userdata, or null. -
touserdata(int, Class) - -Method in class org.luaj.vm2.Varargs -
Return argument i as a java Object if it is a userdata whose instance Class c or a subclass, or null. -
TRACE - -Static variable in class org.luaj.vm2.lib.DebugLib -
  -
traceback(int) - -Static method in class org.luaj.vm2.lib.DebugLib -
Get a traceback as a string for the current thread -
traceback(LuaThread, int) - -Static method in class org.luaj.vm2.lib.DebugLib -
Get a traceback for a particular thread. -
TRUE - -Static variable in class org.luaj.vm2.LuaValue -
LuaBoolean constant corresponding to lua true -
TSTRING - -Static variable in class org.luaj.vm2.LuaValue -
Type enumeration constant for lua strings -
TTABLE - -Static variable in class org.luaj.vm2.LuaValue -
Type enumeration constant for lua tables -
TTHREAD - -Static variable in class org.luaj.vm2.LuaValue -
Type enumeration constant for lua threads -
TUSERDATA - -Static variable in class org.luaj.vm2.LuaValue -
Type enumeration constant for lua userdatas -
TVALUE - -Static variable in class org.luaj.vm2.LuaValue -
Type enumeration constant for unknown values, for compatibility with C-based lua only -
TwoArgFunction - Class in org.luaj.vm2.lib
Abstract base class for Java function implementations that take two arguments and - return one value.
TwoArgFunction() - -Constructor for class org.luaj.vm2.lib.TwoArgFunction -
Default constructor -
TwoArgFunction(LuaValue) - -Constructor for class org.luaj.vm2.lib.TwoArgFunction -
Constructor with specific environment -
type() - -Method in class org.luaj.vm2.lib.IoLib.File -
  -
type() - -Method in class org.luaj.vm2.LuaBoolean -
  -
type() - -Method in class org.luaj.vm2.LuaFunction -
  -
type() - -Method in class org.luaj.vm2.LuaNil -
  -
type() - -Method in class org.luaj.vm2.LuaNumber -
  -
type() - -Method in class org.luaj.vm2.LuaString -
  -
type() - -Method in class org.luaj.vm2.LuaTable -
  -
type() - -Method in class org.luaj.vm2.LuaThread -
  -
type() - -Method in class org.luaj.vm2.LuaUserdata -
  -
type() - -Method in class org.luaj.vm2.LuaValue -
Get the enumeration value for the type of this value. -
type(int) - -Method in class org.luaj.vm2.Varargs -
Gets the type of argument i -
TYPE_NAMES - -Static variable in class org.luaj.vm2.LuaValue -
String array constant containing names of each of the lua value types -
typename() - -Method in class org.luaj.vm2.lib.IoLib.File -
  -
typename() - -Method in class org.luaj.vm2.LuaBoolean -
  -
typename() - -Method in class org.luaj.vm2.LuaFunction -
  -
typename() - -Method in class org.luaj.vm2.LuaNil -
  -
typename() - -Method in class org.luaj.vm2.LuaNumber -
  -
typename() - -Method in class org.luaj.vm2.LuaString -
  -
typename() - -Method in class org.luaj.vm2.LuaTable -
  -
typename() - -Method in class org.luaj.vm2.LuaThread -
  -
typename() - -Method in class org.luaj.vm2.LuaUserdata -
  -
typename() - -Method in class org.luaj.vm2.LuaValue -
Get the String name of the type of this value. -
typerror(String) - -Method in class org.luaj.vm2.LuaValue -
Throw a LuaError indicating an invalid type was supplied to a function -
-
-

-U

-
-
unimplemented(String) - -Method in class org.luaj.vm2.LuaValue -
Throw a LuaError indicating an operation is not implemented -
UNM - -Static variable in class org.luaj.vm2.LuaValue -
LuaString constant with value "__unm" for use as metatag -
UpValue - Class in org.luaj.vm2
Upvalue used with Closure formulation
UpValue(LuaValue[], int) - -Constructor for class org.luaj.vm2.UpValue -
Create an upvalue relative to a stack -
upValues - -Variable in class org.luaj.vm2.LuaClosure -
  -
upvalues - -Variable in class org.luaj.vm2.Prototype -
  -
userdata() - -Method in class org.luaj.vm2.LuaUserdata -
  -
userdataOf(Object) - -Static method in class org.luaj.vm2.LuaValue -
Construct a LuaUserdata for an object. -
userdataOf(Object, LuaValue) - -Static method in class org.luaj.vm2.LuaValue -
Construct a LuaUserdata for an object with a user supplied metatable. -
-
-

-V

-
-
v - -Variable in class org.luaj.vm2.LuaBoolean -
The value of the boolean -
v - -Variable in class org.luaj.vm2.LuaInteger -
The value being held by this instance. -
value() - -Method in class org.luaj.vm2.Buffer -
Get buffer contents as a LuaValue -
valueOf(double) - -Static method in class org.luaj.vm2.LuaDouble -
  -
valueOf(int) - -Static method in class org.luaj.vm2.LuaInteger -
  -
valueOf(long) - -Static method in class org.luaj.vm2.LuaInteger -
Return a LuaNumber that represents the value provided -
valueOf(String) - -Static method in class org.luaj.vm2.LuaString -
Get a LuaString instance whose bytes match - the supplied Java String using the UTF8 encoding. -
valueOf(byte[], int, int) - -Static method in class org.luaj.vm2.LuaString -
Construct a LuaString around a byte array without copying the contents. -
valueOf(char[]) - -Static method in class org.luaj.vm2.LuaString -
Construct a LuaString using the supplied characters as byte values. -
valueOf(byte[]) - -Static method in class org.luaj.vm2.LuaString -
Construct a LuaString around a byte array without copying the contents. -
valueOf(boolean) - -Static method in class org.luaj.vm2.LuaValue -
Convert java boolean to a LuaValue. -
valueOf(int) - -Static method in class org.luaj.vm2.LuaValue -
Convert java int to a LuaValue. -
valueOf(double) - -Static method in class org.luaj.vm2.LuaValue -
Convert java double to a LuaValue. -
valueOf(String) - -Static method in class org.luaj.vm2.LuaValue -
Convert java string to a LuaValue. -
valueOf(byte[]) - -Static method in class org.luaj.vm2.LuaValue -
Convert bytes in an array to a LuaValue. -
valueOf(byte[], int, int) - -Static method in class org.luaj.vm2.LuaValue -
Convert bytes in an array to a LuaValue. -
VARARG_HASARG - -Static variable in class org.luaj.vm2.Lua -
masks for new-style vararg -
VARARG_ISVARARG - -Static variable in class org.luaj.vm2.Lua -
  -
VARARG_NEEDSARG - -Static variable in class org.luaj.vm2.Lua -
  -
VarArgFunction - Class in org.luaj.vm2.lib
Abstract base class for Java function implementations that takes varaiable arguments and - returns multiple return values.
VarArgFunction() - -Constructor for class org.luaj.vm2.lib.VarArgFunction -
  -
VarArgFunction(LuaValue) - -Constructor for class org.luaj.vm2.lib.VarArgFunction -
  -
Varargs - Class in org.luaj.vm2
Class to encapsulate varargs values, either as part of a variable argument list, or multiple return values.
Varargs() - -Constructor for class org.luaj.vm2.Varargs -
  -
varargsOf(LuaValue[]) - -Static method in class org.luaj.vm2.LuaValue -
Construct a Varargs around an array of LuaValues. -
varargsOf(LuaValue[], Varargs) - -Static method in class org.luaj.vm2.LuaValue -
Construct a Varargs around an array of LuaValues. -
varargsOf(LuaValue[], int, int) - -Static method in class org.luaj.vm2.LuaValue -
Construct a Varargs around an array of LuaValues. -
varargsOf(LuaValue[], int, int, Varargs) - -Static method in class org.luaj.vm2.LuaValue -
Construct a Varargs around an array of LuaValues. -
varargsOf(LuaValue, Varargs) - -Static method in class org.luaj.vm2.LuaValue -
Construct a Varargs around a set of 2 or more LuaValues. -
varargsOf(LuaValue, LuaValue, Varargs) - -Static method in class org.luaj.vm2.LuaValue -
Construct a Varargs around a set of 3 or more LuaValues. -
varname - -Variable in class org.luaj.vm2.LocVars -
The local variable name -
-
-

-W

-
-
waitFor() - -Method in class org.luaj.vm2.lib.jse.JseProcess -
Wait for the process to complete, and all pending output to finish. -
WeakTable - Class in org.luaj.vm2
Subclass of LuaTable that provides weak key and weak value semantics.
WeakTable(boolean, boolean) - -Constructor for class org.luaj.vm2.WeakTable -
Construct a table with weak keys, weak values, or both -
WeakTable(boolean, boolean, int, int) - -Constructor for class org.luaj.vm2.WeakTable -
Construct a table with weak keys, weak values, or both, and an initial capacity -
WeakTable(boolean, boolean, LuaTable) - -Constructor for class org.luaj.vm2.WeakTable -
Construct a table with weak keys, weak values, or both, and a source of initial data -
wrapStdin() - -Method in class org.luaj.vm2.lib.IoLib -
Wrap the standard input. -
wrapStdin() - -Method in class org.luaj.vm2.lib.jme.JmeIoLib -
  -
wrapStdin() - -Method in class org.luaj.vm2.lib.jse.JseIoLib -
  -
wrapStdout() - -Method in class org.luaj.vm2.lib.IoLib -
Wrap the standard output. -
wrapStdout() - -Method in class org.luaj.vm2.lib.jme.JmeIoLib -
  -
wrapStdout() - -Method in class org.luaj.vm2.lib.jse.JseIoLib -
  -
write(LuaString) - -Method in class org.luaj.vm2.lib.IoLib.File -
  -
write(DataOutputStream, int, int) - -Method in class org.luaj.vm2.LuaString -
  -
-
-

-Y

-
-
yield(Varargs) - -Static method in class org.luaj.vm2.LuaThread -
Yield the current thread with arguments -
-
-

-Z

-
-
ZERO - -Static variable in class org.luaj.vm2.LuaValue -
LuaValue number constant equal to 0 -
ZeroArgFunction - Class in org.luaj.vm2.lib
Abstract base class for Java function implementations that take no arguments and - return one value.
ZeroArgFunction() - -Constructor for class org.luaj.vm2.lib.ZeroArgFunction -
Default constructor -
ZeroArgFunction(LuaValue) - -Constructor for class org.luaj.vm2.lib.ZeroArgFunction -
Constructor with specific environment -
-
-

-_

-
-
_assert(boolean) - -Static method in class org.luaj.vm2.compiler.LuaC -
  -
_file_close(LuaValue) - -Method in class org.luaj.vm2.lib.IoLib -
  -
_file_flush(LuaValue) - -Method in class org.luaj.vm2.lib.IoLib -
  -
_file_lines(LuaValue) - -Method in class org.luaj.vm2.lib.IoLib -
  -
_file_read(LuaValue, Varargs) - -Method in class org.luaj.vm2.lib.IoLib -
  -
_file_seek(LuaValue, String, int) - -Method in class org.luaj.vm2.lib.IoLib -
  -
_file_setvbuf(LuaValue, String, int) - -Method in class org.luaj.vm2.lib.IoLib -
  -
_file_write(LuaValue, Varargs) - -Method in class org.luaj.vm2.lib.IoLib -
  -
_getinfo(Varargs, LuaValue) - -Static method in class org.luaj.vm2.lib.DebugLib -
  -
_io_close(LuaValue) - -Method in class org.luaj.vm2.lib.IoLib -
  -
_io_flush() - -Method in class org.luaj.vm2.lib.IoLib -
  -
_io_index(LuaValue) - -Method in class org.luaj.vm2.lib.IoLib -
  -
_io_input(LuaValue) - -Method in class org.luaj.vm2.lib.IoLib -
  -
_io_lines(String) - -Method in class org.luaj.vm2.lib.IoLib -
  -
_io_open(String, String) - -Method in class org.luaj.vm2.lib.IoLib -
  -
_io_output(LuaValue) - -Method in class org.luaj.vm2.lib.IoLib -
  -
_io_popen(String, String) - -Method in class org.luaj.vm2.lib.IoLib -
  -
_io_read(Varargs) - -Method in class org.luaj.vm2.lib.IoLib -
  -
_io_tmpfile() - -Method in class org.luaj.vm2.lib.IoLib -
  -
_io_type(LuaValue) - -Method in class org.luaj.vm2.lib.IoLib -
  -
_io_write(Varargs) - -Method in class org.luaj.vm2.lib.IoLib -
  -
_lines_iter(LuaValue) - -Method in class org.luaj.vm2.lib.IoLib -
  -
_VERSION - -Static variable in class org.luaj.vm2.Lua -
version is supplied by ant build task -
-
-A B C D E F G H I J K L M N O P R S T U V W Y Z _ - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/index.html b/luaj-2.0.3/docs/api/index.html deleted file mode 100644 index 5e95b4563..000000000 --- a/luaj-2.0.3/docs/api/index.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - -Luaj API - - - - - - - - - - - -<H2> -Frame Alert</H2> - -<P> -This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. -<BR> -Link to<A HREF="overview-summary.html">Non-frame version.</A> - - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/Buffer.html b/luaj-2.0.3/docs/api/org/luaj/vm2/Buffer.html deleted file mode 100644 index d288b6995..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/Buffer.html +++ /dev/null @@ -1,602 +0,0 @@ - - - - - - -Buffer (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2 -
-Class Buffer

-
-java.lang.Object
-  extended by org.luaj.vm2.Buffer
-
-
-
-
public final class Buffer
extends java.lang.Object
- - -

-String buffer for use in string library methods, optimized for production - of StrValue instances. -

- The buffer can begin initially as a wrapped LuaValue - and only when concatenation actually occurs are the bytes first copied. -

- To convert back to a LuaValue again, - the function value() is used. -

- -

-

-
See Also:
LuaValue, -LuaValue.buffer(), -LuaString
-
- -

- - - - - - - - - - - - - - - - - -
-Constructor Summary
Buffer() - -
-          Create buffer with default capacity
Buffer(int initialCapacity) - -
-          Create buffer with specified initial capacity
Buffer(LuaValue value) - -
-          Create buffer with specified initial value
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
- Bufferappend(byte b) - -
-          Append a single byte to the buffer.
- Bufferappend(LuaString str) - -
-          Append a LuaString to the buffer.
- Bufferappend(LuaValue val) - -
-          Append a LuaValue to the buffer.
- Bufferappend(java.lang.String str) - -
-          Append a Java String to the buffer.
- BufferconcatTo(LuaNumber lhs) - -
-          Concatenate this buffer onto a LuaNumber
- BufferconcatTo(LuaString lhs) - -
-          Concatenate this buffer onto a LuaString
- BufferconcatTo(LuaValue lhs) - -
-          Concatenate this buffer onto a LuaValue
- voidmakeroom(int nbefore, - int nafter) - -
-          Ensure there is enough room before and after the bytes.
- Bufferprepend(LuaString s) - -
-          Concatenate bytes from a LuaString onto the front of this buffer
- Buffersetvalue(LuaValue value) - -
-          Set buffer contents as a LuaValue
- java.lang.Stringtojstring() - -
-          Convert the buffer to a Java String
- LuaStringtostring() - -
-          Convert the buffer to a LuaString
- java.lang.StringtoString() - -
-          Convert the buffer to a Java String
- LuaValuevalue() - -
-          Get buffer contents as a LuaValue
- - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Constructor Detail
- -

-Buffer

-
-public Buffer()
-
-
Create buffer with default capacity -

-

-
See Also:
DEFAULT_CAPACITY
-
-
- -

-Buffer

-
-public Buffer(int initialCapacity)
-
-
Create buffer with specified initial capacity -

-

-
Parameters:
initialCapacity - the initial capacity
-
-
- -

-Buffer

-
-public Buffer(LuaValue value)
-
-
Create buffer with specified initial value -

-

-
Parameters:
value - the initial value
-
- - - - - - - - -
-Method Detail
- -

-value

-
-public LuaValue value()
-
-
Get buffer contents as a LuaValue -

-

- -
Returns:
value as a LuaValue, converting as necessary
-
-
-
- -

-setvalue

-
-public Buffer setvalue(LuaValue value)
-
-
Set buffer contents as a LuaValue -

-

-
Parameters:
value - value to set
-
-
-
- -

-tostring

-
-public final LuaString tostring()
-
-
Convert the buffer to a LuaString -

-

- -
Returns:
the value as a LuaString
-
-
-
- -

-tojstring

-
-public java.lang.String tojstring()
-
-
Convert the buffer to a Java String -

-

- -
Returns:
the value as a Java String
-
-
-
- -

-toString

-
-public java.lang.String toString()
-
-
Convert the buffer to a Java String -

-

-
Overrides:
toString in class java.lang.Object
-
-
- -
Returns:
the value as a Java String
-
-
-
- -

-append

-
-public final Buffer append(byte b)
-
-
Append a single byte to the buffer. -

-

- -
Returns:
this to allow call chaining
-
-
-
- -

-append

-
-public final Buffer append(LuaValue val)
-
-
Append a LuaValue to the buffer. -

-

- -
Returns:
this to allow call chaining
-
-
-
- -

-append

-
-public final Buffer append(LuaString str)
-
-
Append a LuaString to the buffer. -

-

- -
Returns:
this to allow call chaining
-
-
-
- -

-append

-
-public final Buffer append(java.lang.String str)
-
-
Append a Java String to the buffer. - The Java string will be converted to bytes using the UTF8 encoding. -

-

- -
Returns:
this to allow call chaining
See Also:
LuaString.encodeToUtf8(char[], byte[], int)
-
-
-
- -

-concatTo

-
-public Buffer concatTo(LuaValue lhs)
-
-
Concatenate this buffer onto a LuaValue -

-

-
Parameters:
lhs - the left-hand-side value onto which we are concatenating this -
Returns:
Buffer for use in call chaining.
-
-
-
- -

-concatTo

-
-public Buffer concatTo(LuaString lhs)
-
-
Concatenate this buffer onto a LuaString -

-

-
Parameters:
lhs - the left-hand-side value onto which we are concatenating this -
Returns:
Buffer for use in call chaining.
-
-
-
- -

-concatTo

-
-public Buffer concatTo(LuaNumber lhs)
-
-
Concatenate this buffer onto a LuaNumber -

- The LuaNumber will be converted to a string before concatenating. -

-

-
Parameters:
lhs - the left-hand-side value onto which we are concatenating this -
Returns:
Buffer for use in call chaining.
-
-
-
- -

-prepend

-
-public Buffer prepend(LuaString s)
-
-
Concatenate bytes from a LuaString onto the front of this buffer -

-

-
Parameters:
s - the left-hand-side value which we will concatenate onto the front of this -
Returns:
Buffer for use in call chaining.
-
-
-
- -

-makeroom

-
-public final void makeroom(int nbefore,
-                           int nafter)
-
-
Ensure there is enough room before and after the bytes. -

-

-
Parameters:
nbefore - number of unused bytes which must precede the data after this completes
nafter - number of unused bytes which must follow the data after this completes
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/LoadState.LuaCompiler.html b/luaj-2.0.3/docs/api/org/luaj/vm2/LoadState.LuaCompiler.html deleted file mode 100644 index 33ace8345..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/LoadState.LuaCompiler.html +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - -LoadState.LuaCompiler (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2 -
-Interface LoadState.LuaCompiler

-
-
All Known Implementing Classes:
LuaC, LuaJC
-
-
-
Enclosing class:
LoadState
-
-
-
-
public static interface LoadState.LuaCompiler
- - -

-Interface for the compiler, if it is installed. -

- See the LuaClosure documentation for examples of how to use the compiler. -

- -

-

-
See Also:
LuaClosure, -load(InputStream, String, LuaValue)
-
- -

- - - - - - - - - - - - -
-Method Summary
- LuaFunctionload(java.io.InputStream stream, - java.lang.String filename, - LuaValue env) - -
-          Load into a Closure or LuaFunction from a Stream and initializes the environment
-  -

- - - - - - - - -
-Method Detail
- -

-load

-
-LuaFunction load(java.io.InputStream stream,
-                 java.lang.String filename,
-                 LuaValue env)
-                 throws java.io.IOException
-
-
Load into a Closure or LuaFunction from a Stream and initializes the environment -

-

- -
Throws: -
java.io.IOException
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/LoadState.html b/luaj-2.0.3/docs/api/org/luaj/vm2/LoadState.html deleted file mode 100644 index 38f59df02..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/LoadState.html +++ /dev/null @@ -1,821 +0,0 @@ - - - - - - -LoadState (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2 -
-Class LoadState

-
-java.lang.Object
-  extended by org.luaj.vm2.LoadState
-
-
-
-
public class LoadState
extends java.lang.Object
- - -

-Class to manage loading of Prototype instances. -

- The LoadState class exposes one main function, - namely load(InputStream, String, LuaValue), - to be used to load code from a particular input stream. -

- A simple pattern for loading and executing code is -

 LuaValue _G = JsePlatform.standardGlobals();
- LoadState.load( new FileInputStream("main.lua"), "main.lua", _G ).call();
-  
- This should work regardless of which LoadState.LuaCompiler - has been installed. -

- - Prior to loading code, a compiler should be installed. -

- By default, when using JsePlatform or - to construct globals, the LuaC compiler is installed. -

- To override the default compiler with, say, the LuaJC - lua-to-java bytecode compiler, install it before loading, - for example: -

 LuaValue _G = JsePlatform.standardGlobals();
- LuaJC.install();
- LoadState.load( new FileInputStream("main.lua"), "main.lua", _G ).call();
-  
-

- -

-

-
See Also:
LoadState.LuaCompiler, -LuaClosure, -LuaFunction, -compiler, -load(InputStream, String, LuaValue), -LuaC, -LuaJC
-
- -

- - - - - - - - - - - -
-Nested Class Summary
-static interfaceLoadState.LuaCompiler - -
-          Interface for the compiler, if it is installed.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Field Summary
-static LoadState.LuaCompilercompiler - -
-          Compiler instance, if installed
- java.io.DataInputStreamis - -
-          input stream from which we are loading
-static intLUA_TBOOLEAN - -
-           
-static intLUA_TFUNCTION - -
-           
-static intLUA_TINT - -
-           
-static intLUA_TLIGHTUSERDATA - -
-           
-static intLUA_TNIL - -
-           
-static intLUA_TNONE - -
-           
-static intLUA_TNUMBER - -
-           
-static intLUA_TSTRING - -
-           
-static intLUA_TTABLE - -
-           
-static intLUA_TTHREAD - -
-           
-static intLUA_TUSERDATA - -
-           
-static intLUA_TVALUE - -
-           
-static intLUAC_FORMAT - -
-          for header of binary files -- this is the official format
-static intLUAC_HEADERSIZE - -
-          size of header of binary files
-static intLUAC_VERSION - -
-          for header of binary files -- this is Lua 5.1
-static intNUMBER_FORMAT_FLOATS_OR_DOUBLES - -
-          format corresponding to non-number-patched lua, all numbers are floats or doubles
-static intNUMBER_FORMAT_INTS_ONLY - -
-          format corresponding to non-number-patched lua, all numbers are ints
-static intNUMBER_FORMAT_NUM_PATCH_INT32 - -
-          format corresponding to number-patched lua, all numbers are 32-bit (4 byte) ints
-static java.lang.StringSOURCE_BINARY_STRING - -
-          Name for compiled chunks
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
-static java.lang.StringgetSourceName(java.lang.String name) - -
-          Construct a source name from a supplied chunk name
-static LuaFunctionload(java.io.InputStream stream, - java.lang.String name, - LuaValue env) - -
-          Load lua in either binary or text form from an input stream.
-static PrototypeloadBinaryChunk(int firstByte, - java.io.InputStream stream, - java.lang.String name) - -
-          Load lua thought to be a binary chunk from its first byte from an input stream.
- PrototypeloadFunction(LuaString p) - -
-          Load a function prototype from the input stream
- voidloadHeader() - -
-          Load the lua chunk header values.
-static LuaValuelongBitsToLuaNumber(long bits) - -
-          Convert bits in a long value to a LuaValue.
- - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-  -

- - - - - - - - -
-Field Detail
- -

-NUMBER_FORMAT_FLOATS_OR_DOUBLES

-
-public static final int NUMBER_FORMAT_FLOATS_OR_DOUBLES
-
-
format corresponding to non-number-patched lua, all numbers are floats or doubles -

-

-
See Also:
Constant Field Values
-
-
- -

-NUMBER_FORMAT_INTS_ONLY

-
-public static final int NUMBER_FORMAT_INTS_ONLY
-
-
format corresponding to non-number-patched lua, all numbers are ints -

-

-
See Also:
Constant Field Values
-
-
- -

-NUMBER_FORMAT_NUM_PATCH_INT32

-
-public static final int NUMBER_FORMAT_NUM_PATCH_INT32
-
-
format corresponding to number-patched lua, all numbers are 32-bit (4 byte) ints -

-

-
See Also:
Constant Field Values
-
-
- -

-LUA_TINT

-
-public static final int LUA_TINT
-
-
-
See Also:
Constant Field Values
-
-
- -

-LUA_TNONE

-
-public static final int LUA_TNONE
-
-
-
See Also:
Constant Field Values
-
-
- -

-LUA_TNIL

-
-public static final int LUA_TNIL
-
-
-
See Also:
Constant Field Values
-
-
- -

-LUA_TBOOLEAN

-
-public static final int LUA_TBOOLEAN
-
-
-
See Also:
Constant Field Values
-
-
- -

-LUA_TLIGHTUSERDATA

-
-public static final int LUA_TLIGHTUSERDATA
-
-
-
See Also:
Constant Field Values
-
-
- -

-LUA_TNUMBER

-
-public static final int LUA_TNUMBER
-
-
-
See Also:
Constant Field Values
-
-
- -

-LUA_TSTRING

-
-public static final int LUA_TSTRING
-
-
-
See Also:
Constant Field Values
-
-
- -

-LUA_TTABLE

-
-public static final int LUA_TTABLE
-
-
-
See Also:
Constant Field Values
-
-
- -

-LUA_TFUNCTION

-
-public static final int LUA_TFUNCTION
-
-
-
See Also:
Constant Field Values
-
-
- -

-LUA_TUSERDATA

-
-public static final int LUA_TUSERDATA
-
-
-
See Also:
Constant Field Values
-
-
- -

-LUA_TTHREAD

-
-public static final int LUA_TTHREAD
-
-
-
See Also:
Constant Field Values
-
-
- -

-LUA_TVALUE

-
-public static final int LUA_TVALUE
-
-
-
See Also:
Constant Field Values
-
-
- -

-compiler

-
-public static LoadState.LuaCompiler compiler
-
-
Compiler instance, if installed -

-

-
-
-
- -

-SOURCE_BINARY_STRING

-
-public static final java.lang.String SOURCE_BINARY_STRING
-
-
Name for compiled chunks -

-

-
See Also:
Constant Field Values
-
-
- -

-LUAC_VERSION

-
-public static final int LUAC_VERSION
-
-
for header of binary files -- this is Lua 5.1 -

-

-
See Also:
Constant Field Values
-
-
- -

-LUAC_FORMAT

-
-public static final int LUAC_FORMAT
-
-
for header of binary files -- this is the official format -

-

-
See Also:
Constant Field Values
-
-
- -

-LUAC_HEADERSIZE

-
-public static final int LUAC_HEADERSIZE
-
-
size of header of binary files -

-

-
See Also:
Constant Field Values
-
-
- -

-is

-
-public final java.io.DataInputStream is
-
-
input stream from which we are loading -

-

-
-
- - - - - - - - -
-Method Detail
- -

-longBitsToLuaNumber

-
-public static LuaValue longBitsToLuaNumber(long bits)
-
-
Convert bits in a long value to a LuaValue. -

-

-
Parameters:
bits - long value containing the bits -
Returns:
LuaInteger or LuaDouble whose value corresponds to the bits provided.
-
-
-
- -

-loadFunction

-
-public Prototype loadFunction(LuaString p)
-                       throws java.io.IOException
-
-
Load a function prototype from the input stream -

-

-
Parameters:
p - name of the source -
Returns:
Prototype instance that was loaded -
Throws: -
java.io.IOException
-
-
-
- -

-loadHeader

-
-public void loadHeader()
-                throws java.io.IOException
-
-
Load the lua chunk header values. -

-

- -
Throws: -
java.io.IOException - if an i/o exception occurs.
-
-
-
- -

-load

-
-public static LuaFunction load(java.io.InputStream stream,
-                               java.lang.String name,
-                               LuaValue env)
-                        throws java.io.IOException
-
-
Load lua in either binary or text form from an input stream. -

-

-
Parameters:
firstByte - the first byte of the input stream
stream - InputStream to read, after having read the first byte already
name - Name to apply to the loaded chunk -
Returns:
Prototype that was loaded -
Throws: -
java.lang.IllegalArgumentException - if the signature is bac -
java.io.IOException - if an IOException occurs
-
-
-
- -

-loadBinaryChunk

-
-public static Prototype loadBinaryChunk(int firstByte,
-                                        java.io.InputStream stream,
-                                        java.lang.String name)
-                                 throws java.io.IOException
-
-
Load lua thought to be a binary chunk from its first byte from an input stream. -

-

-
Parameters:
firstByte - the first byte of the input stream
stream - InputStream to read, after having read the first byte already
name - Name to apply to the loaded chunk -
Returns:
Prototype that was loaded -
Throws: -
java.lang.IllegalArgumentException - if the signature is bac -
java.io.IOException - if an IOException occurs
-
-
-
- -

-getSourceName

-
-public static java.lang.String getSourceName(java.lang.String name)
-
-
Construct a source name from a supplied chunk name -

-

-
Parameters:
name - String name that appears in the chunk -
Returns:
source file name
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/LocVars.html b/luaj-2.0.3/docs/api/org/luaj/vm2/LocVars.html deleted file mode 100644 index c018d14de..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/LocVars.html +++ /dev/null @@ -1,342 +0,0 @@ - - - - - - -LocVars (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2 -
-Class LocVars

-
-java.lang.Object
-  extended by org.luaj.vm2.LocVars
-
-
-
-
public class LocVars
extends java.lang.Object
- - -

-Data class to hold debug information relatign to local variables for a Prototype -

- -

-


- -

- - - - - - - - - - - - - - - - - - - -
-Field Summary
- intendpc - -
-          The instruction offset when the variable goes out of scope
- intstartpc - -
-          The instruction offset when the variable comes into scope
- LuaStringvarname - -
-          The local variable name
-  - - - - - - - - - - -
-Constructor Summary
LocVars(LuaString varname, - int startpc, - int endpc) - -
-          Construct a LocVars instance.
-  - - - - - - - - - - - -
-Method Summary
- java.lang.Stringtojstring() - -
-           
- - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-  -

- - - - - - - - -
-Field Detail
- -

-varname

-
-public LuaString varname
-
-
The local variable name -

-

-
-
-
- -

-startpc

-
-public int startpc
-
-
The instruction offset when the variable comes into scope -

-

-
-
-
- -

-endpc

-
-public int endpc
-
-
The instruction offset when the variable goes out of scope -

-

-
-
- - - - - - - - -
-Constructor Detail
- -

-LocVars

-
-public LocVars(LuaString varname,
-               int startpc,
-               int endpc)
-
-
Construct a LocVars instance. -

-

-
Parameters:
varname - The local variable name
startpc - The instruction offset when the variable comes into scope
endpc - The instruction offset when the variable goes out of scope
-
- - - - - - - - -
-Method Detail
- -

-tojstring

-
-public java.lang.String tojstring()
-
-
-
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/Lua.html b/luaj-2.0.3/docs/api/org/luaj/vm2/Lua.html deleted file mode 100644 index 2f048f1ea..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/Lua.html +++ /dev/null @@ -1,2109 +0,0 @@ - - - - - - -Lua (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2 -
-Class Lua

-
-java.lang.Object
-  extended by org.luaj.vm2.Lua
-
-
-
Direct Known Subclasses:
LuaC, Print
-
-
-
-
public class Lua
extends java.lang.Object
- - -

-Constants for lua limits and opcodes. -

- This is a direct translation of C lua distribution header file constants - for bytecode creation and processing. -

- -

-


- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Field Summary
-static java.lang.String_VERSION - -
-          version is supplied by ant build task
-static intBITRK - -
-          this bit 1 means constant (0 means register)
-static intiABC - -
-           
-static intiABx - -
-           
-static intiAsBx - -
-           
-static intLFIELDS_PER_FLUSH - -
-           
-static intLUA_MULTRET - -
-          use return values from previous op
-static int[]luaP_opmodes - -
-           
-static intMASK_A - -
-           
-static intMASK_B - -
-           
-static intMASK_Bx - -
-           
-static intMASK_C - -
-           
-static intMASK_NOT_A - -
-           
-static intMASK_NOT_B - -
-           
-static intMASK_NOT_Bx - -
-           
-static intMASK_NOT_C - -
-           
-static intMASK_NOT_OP - -
-           
-static intMASK_OP - -
-           
-static intMAX_OP - -
-           
-static intMAXARG_A - -
-           
-static intMAXARG_B - -
-           
-static intMAXARG_Bx - -
-           
-static intMAXARG_C - -
-           
-static intMAXARG_sBx - -
-           
-static intMAXINDEXRK - -
-           
-static intNO_REG - -
-          invalid register that fits in 8 bits
-static intNUM_OPCODES - -
-           
-static intOP_ADD - -
-           
-static intOP_AND - -
-           
-static intOP_CALL - -
-           
-static intOP_CLOSE - -
-           
-static intOP_CLOSURE - -
-           
-static intOP_CONCAT - -
-           
-static intOP_DIV - -
-           
-static intOP_EQ - -
-           
-static intOP_FORLOOP - -
-           
-static intOP_FORPREP - -
-           
-static intOP_GE - -
-           
-static intOP_GETGLOBAL - -
-           
-static intOP_GETTABLE - -
-           
-static intOP_GETUPVAL - -
-           
-static intOP_GT - -
-           
-static intOP_JMP - -
-           
-static intOP_LE - -
-           
-static intOP_LEN - -
-           
-static intOP_LOADBOOL - -
-           
-static intOP_LOADK - -
-           
-static intOP_LOADNIL - -
-           
-static intOP_LT - -
-           
-static intOP_MOD - -
-           
-static intOP_MOVE - -
-           
-static intOP_MUL - -
-           
-static intOP_NEQ - -
-           
-static intOP_NEWTABLE - -
-           
-static intOP_NOT - -
-           
-static intOP_OR - -
-           
-static intOP_POW - -
-           
-static intOP_RETURN - -
-           
-static intOP_SELF - -
-           
-static intOP_SETGLOBAL - -
-           
-static intOP_SETLIST - -
-           
-static intOP_SETTABLE - -
-           
-static intOP_SETUPVAL - -
-           
-static intOP_SUB - -
-           
-static intOP_TAILCALL - -
-           
-static intOP_TEST - -
-           
-static intOP_TESTSET - -
-           
-static intOP_TFORLOOP - -
-           
-static intOP_UNM - -
-           
-static intOP_VARARG - -
-           
-static intOpArgK - -
-           
-static intOpArgN - -
-           
-static intOpArgR - -
-           
-static intOpArgU - -
-           
-static intPOS_A - -
-           
-static intPOS_B - -
-           
-static intPOS_Bx - -
-           
-static intPOS_C - -
-           
-static intPOS_OP - -
-           
-static intSIZE_A - -
-           
-static intSIZE_B - -
-           
-static intSIZE_Bx - -
-           
-static intSIZE_C - -
-           
-static intSIZE_OP - -
-           
-static intVARARG_HASARG - -
-          masks for new-style vararg
-static intVARARG_ISVARARG - -
-           
-static intVARARG_NEEDSARG - -
-           
-  - - - - - - - - - - -
-Constructor Summary
Lua() - -
-           
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
-static intGET_OPCODE(int i) - -
-           
-static intGETARG_A(int i) - -
-           
-static intGETARG_B(int i) - -
-           
-static intGETARG_Bx(int i) - -
-           
-static intGETARG_C(int i) - -
-           
-static intGETARG_sBx(int i) - -
-           
-static intgetBMode(int m) - -
-           
-static intgetCMode(int m) - -
-           
-static intgetOpMode(int m) - -
-           
-static intINDEXK(int r) - -
-          gets the index of the constant
-static booleanISK(int x) - -
-          test whether value is a constant
-static intRKASK(int x) - -
-          code a constant index as a RK value
-static booleantestAMode(int m) - -
-           
-static booleantestTMode(int m) - -
-           
- - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-  -

- - - - - - - - -
-Field Detail
- -

-_VERSION

-
-public static final java.lang.String _VERSION
-
-
version is supplied by ant build task -

-

-
See Also:
Constant Field Values
-
-
- -

-LUA_MULTRET

-
-public static final int LUA_MULTRET
-
-
use return values from previous op -

-

-
See Also:
Constant Field Values
-
-
- -

-VARARG_HASARG

-
-public static final int VARARG_HASARG
-
-
masks for new-style vararg -

-

-
See Also:
Constant Field Values
-
-
- -

-VARARG_ISVARARG

-
-public static final int VARARG_ISVARARG
-
-
-
See Also:
Constant Field Values
-
-
- -

-VARARG_NEEDSARG

-
-public static final int VARARG_NEEDSARG
-
-
-
See Also:
Constant Field Values
-
-
- -

-iABC

-
-public static final int iABC
-
-
-
See Also:
Constant Field Values
-
-
- -

-iABx

-
-public static final int iABx
-
-
-
See Also:
Constant Field Values
-
-
- -

-iAsBx

-
-public static final int iAsBx
-
-
-
See Also:
Constant Field Values
-
-
- -

-SIZE_C

-
-public static final int SIZE_C
-
-
-
See Also:
Constant Field Values
-
-
- -

-SIZE_B

-
-public static final int SIZE_B
-
-
-
See Also:
Constant Field Values
-
-
- -

-SIZE_Bx

-
-public static final int SIZE_Bx
-
-
-
See Also:
Constant Field Values
-
-
- -

-SIZE_A

-
-public static final int SIZE_A
-
-
-
See Also:
Constant Field Values
-
-
- -

-SIZE_OP

-
-public static final int SIZE_OP
-
-
-
See Also:
Constant Field Values
-
-
- -

-POS_OP

-
-public static final int POS_OP
-
-
-
See Also:
Constant Field Values
-
-
- -

-POS_A

-
-public static final int POS_A
-
-
-
See Also:
Constant Field Values
-
-
- -

-POS_C

-
-public static final int POS_C
-
-
-
See Also:
Constant Field Values
-
-
- -

-POS_B

-
-public static final int POS_B
-
-
-
See Also:
Constant Field Values
-
-
- -

-POS_Bx

-
-public static final int POS_Bx
-
-
-
See Also:
Constant Field Values
-
-
- -

-MAX_OP

-
-public static final int MAX_OP
-
-
-
See Also:
Constant Field Values
-
-
- -

-MAXARG_A

-
-public static final int MAXARG_A
-
-
-
See Also:
Constant Field Values
-
-
- -

-MAXARG_B

-
-public static final int MAXARG_B
-
-
-
See Also:
Constant Field Values
-
-
- -

-MAXARG_C

-
-public static final int MAXARG_C
-
-
-
See Also:
Constant Field Values
-
-
- -

-MAXARG_Bx

-
-public static final int MAXARG_Bx
-
-
-
See Also:
Constant Field Values
-
-
- -

-MAXARG_sBx

-
-public static final int MAXARG_sBx
-
-
-
See Also:
Constant Field Values
-
-
- -

-MASK_OP

-
-public static final int MASK_OP
-
-
-
See Also:
Constant Field Values
-
-
- -

-MASK_A

-
-public static final int MASK_A
-
-
-
See Also:
Constant Field Values
-
-
- -

-MASK_B

-
-public static final int MASK_B
-
-
-
See Also:
Constant Field Values
-
-
- -

-MASK_C

-
-public static final int MASK_C
-
-
-
See Also:
Constant Field Values
-
-
- -

-MASK_Bx

-
-public static final int MASK_Bx
-
-
-
See Also:
Constant Field Values
-
-
- -

-MASK_NOT_OP

-
-public static final int MASK_NOT_OP
-
-
-
See Also:
Constant Field Values
-
-
- -

-MASK_NOT_A

-
-public static final int MASK_NOT_A
-
-
-
See Also:
Constant Field Values
-
-
- -

-MASK_NOT_B

-
-public static final int MASK_NOT_B
-
-
-
See Also:
Constant Field Values
-
-
- -

-MASK_NOT_C

-
-public static final int MASK_NOT_C
-
-
-
See Also:
Constant Field Values
-
-
- -

-MASK_NOT_Bx

-
-public static final int MASK_NOT_Bx
-
-
-
See Also:
Constant Field Values
-
-
- -

-BITRK

-
-public static final int BITRK
-
-
this bit 1 means constant (0 means register) -

-

-
See Also:
Constant Field Values
-
-
- -

-MAXINDEXRK

-
-public static final int MAXINDEXRK
-
-
-
See Also:
Constant Field Values
-
-
- -

-NO_REG

-
-public static final int NO_REG
-
-
invalid register that fits in 8 bits -

-

-
See Also:
Constant Field Values
-
-
- -

-OP_MOVE

-
-public static final int OP_MOVE
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_LOADK

-
-public static final int OP_LOADK
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_LOADBOOL

-
-public static final int OP_LOADBOOL
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_LOADNIL

-
-public static final int OP_LOADNIL
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_GETUPVAL

-
-public static final int OP_GETUPVAL
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_GETGLOBAL

-
-public static final int OP_GETGLOBAL
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_GETTABLE

-
-public static final int OP_GETTABLE
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_SETGLOBAL

-
-public static final int OP_SETGLOBAL
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_SETUPVAL

-
-public static final int OP_SETUPVAL
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_SETTABLE

-
-public static final int OP_SETTABLE
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_NEWTABLE

-
-public static final int OP_NEWTABLE
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_SELF

-
-public static final int OP_SELF
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_ADD

-
-public static final int OP_ADD
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_SUB

-
-public static final int OP_SUB
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_MUL

-
-public static final int OP_MUL
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_DIV

-
-public static final int OP_DIV
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_MOD

-
-public static final int OP_MOD
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_POW

-
-public static final int OP_POW
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_UNM

-
-public static final int OP_UNM
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_NOT

-
-public static final int OP_NOT
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_LEN

-
-public static final int OP_LEN
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_CONCAT

-
-public static final int OP_CONCAT
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_JMP

-
-public static final int OP_JMP
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_EQ

-
-public static final int OP_EQ
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_LT

-
-public static final int OP_LT
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_LE

-
-public static final int OP_LE
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_TEST

-
-public static final int OP_TEST
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_TESTSET

-
-public static final int OP_TESTSET
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_CALL

-
-public static final int OP_CALL
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_TAILCALL

-
-public static final int OP_TAILCALL
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_RETURN

-
-public static final int OP_RETURN
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_FORLOOP

-
-public static final int OP_FORLOOP
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_FORPREP

-
-public static final int OP_FORPREP
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_TFORLOOP

-
-public static final int OP_TFORLOOP
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_SETLIST

-
-public static final int OP_SETLIST
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_CLOSE

-
-public static final int OP_CLOSE
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_CLOSURE

-
-public static final int OP_CLOSURE
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_VARARG

-
-public static final int OP_VARARG
-
-
-
See Also:
Constant Field Values
-
-
- -

-NUM_OPCODES

-
-public static final int NUM_OPCODES
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_GT

-
-public static final int OP_GT
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_GE

-
-public static final int OP_GE
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_NEQ

-
-public static final int OP_NEQ
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_AND

-
-public static final int OP_AND
-
-
-
See Also:
Constant Field Values
-
-
- -

-OP_OR

-
-public static final int OP_OR
-
-
-
See Also:
Constant Field Values
-
-
- -

-OpArgN

-
-public static final int OpArgN
-
-
-
See Also:
Constant Field Values
-
-
- -

-OpArgU

-
-public static final int OpArgU
-
-
-
See Also:
Constant Field Values
-
-
- -

-OpArgR

-
-public static final int OpArgR
-
-
-
See Also:
Constant Field Values
-
-
- -

-OpArgK

-
-public static final int OpArgK
-
-
-
See Also:
Constant Field Values
-
-
- -

-luaP_opmodes

-
-public static final int[] luaP_opmodes
-
-
-
-
-
- -

-LFIELDS_PER_FLUSH

-
-public static final int LFIELDS_PER_FLUSH
-
-
-
See Also:
Constant Field Values
-
- - - - - - - - -
-Constructor Detail
- -

-Lua

-
-public Lua()
-
-
- - - - - - - - -
-Method Detail
- -

-GET_OPCODE

-
-public static int GET_OPCODE(int i)
-
-
-
-
-
-
- -

-GETARG_A

-
-public static int GETARG_A(int i)
-
-
-
-
-
-
- -

-GETARG_B

-
-public static int GETARG_B(int i)
-
-
-
-
-
-
- -

-GETARG_C

-
-public static int GETARG_C(int i)
-
-
-
-
-
-
- -

-GETARG_Bx

-
-public static int GETARG_Bx(int i)
-
-
-
-
-
-
- -

-GETARG_sBx

-
-public static int GETARG_sBx(int i)
-
-
-
-
-
-
- -

-ISK

-
-public static boolean ISK(int x)
-
-
test whether value is a constant -

-

-
-
-
-
- -

-INDEXK

-
-public static int INDEXK(int r)
-
-
gets the index of the constant -

-

-
-
-
-
- -

-RKASK

-
-public static int RKASK(int x)
-
-
code a constant index as a RK value -

-

-
-
-
-
- -

-getOpMode

-
-public static int getOpMode(int m)
-
-
-
-
-
-
- -

-getBMode

-
-public static int getBMode(int m)
-
-
-
-
-
-
- -

-getCMode

-
-public static int getCMode(int m)
-
-
-
-
-
-
- -

-testAMode

-
-public static boolean testAMode(int m)
-
-
-
-
-
-
- -

-testTMode

-
-public static boolean testTMode(int m)
-
-
-
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/LuaBoolean.html b/luaj-2.0.3/docs/api/org/luaj/vm2/LuaBoolean.html deleted file mode 100644 index cbb6dbdd8..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/LuaBoolean.html +++ /dev/null @@ -1,601 +0,0 @@ - - - - - - -LuaBoolean (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2 -
-Class LuaBoolean

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.LuaBoolean
-
-
-
-
public final class LuaBoolean
extends LuaValue
- - -

-Extension of LuaValue which can hold a Java boolean as its value. -

- These instance are not instantiated directly by clients. - Instead, there are exactly twon instances of this class, - LuaValue.TRUE and LuaValue.FALSE - representing the lua values true and false. - The function LuaValue.valueOf(boolean) will always - return one of these two values. -

- Any LuaValue can be converted to its equivalent - boolean representation using LuaValue.toboolean() -

-

- -

-

-
See Also:
LuaValue, -LuaValue.valueOf(boolean), -LuaValue.TRUE, -LuaValue.FALSE
-
- -

- - - - - - - - - - - - - - - -
-Field Summary
-static LuaValues_metatable - -
-          Shared static metatable for boolean values represented in lua.
- booleanv - -
-          The value of the boolean
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
- booleanbooleanValue() - -
-          Return the boolean value for this boolean
- booleancheckboolean() - -
-          Check that the value is a LuaBoolean, - or throw LuaError if not
- LuaValuegetmetatable() - -
-          Get the metatable for this LuaValue
- booleanisboolean() - -
-          Check if this is a boolean
- LuaValuenot() - -
-          Unary not: return inverse boolean value (~this) as defined by lua not operator
- booleanoptboolean(boolean defval) - -
-          Check that optional argument is a boolean and return its boolean value
- booleantoboolean() - -
-          Convert to boolean false if LuaValue.NIL or FALSE, true if anything else
- java.lang.Stringtojstring() - -
-          Convert to human readable String for any type.
- inttype() - -
-          Get the enumeration value for the type of this value.
- java.lang.Stringtypename() - -
-          Get the String name of the type of this value.
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
add, add, add, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, call, call, call, call, callmt, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checkmetatag, checknotnil, checknumber, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalidkey, compareerror, compareerror, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, div, div, div, divInto, eq_b, eq, eqmtcall, equals, error, get, get, get, getfenv, getn, gettable, gt_b, gt_b, gt_b, gt, gt, gt, gteq_b, gteq_b, gteq_b, gteq, gteq, gteq, illegal, inext, invoke, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isclosure, isfunction, isint, isinttype, islong, isnil, isnumber, isstring, istable, isthread, isuserdata, isuserdata, isweaknil, len, lenerror, length, listOf, listOf, load, lt_b, lt_b, lt_b, lt, lt, lt, lteq_b, lteq_b, lteq_b, lteq, lteq, lteq, metatag, method, method, method, method, method, method, mod, mod, mod, modFrom, mul, mul, mul, narg, neg, neq_b, neq, next, onInvoke, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, or, pow, pow, pow, powWith, powWith, presize, raweq, raweq, raweq, raweq, raweq, rawget, rawget, rawget, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setfenv, setmetatable, settable, strcmp, strcmp, strongkey, strongvalue, strvalue, sub, sub, sub, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, tobyte, tochar, todouble, tofloat, toint, tolong, tonumber, toshort, tostring, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Field Detail
- -

-s_metatable

-
-public static LuaValue s_metatable
-
-
Shared static metatable for boolean values represented in lua. -

-

-
-
-
- -

-v

-
-public final boolean v
-
-
The value of the boolean -

-

-
-
- - - - - - - - -
-Method Detail
- -

-type

-
-public int type()
-
-
Description copied from class: LuaValue
-
Get the enumeration value for the type of this value. -

-

-
Specified by:
type in class LuaValue
-
-
- -
Returns:
value for this type, one of - TNIL, - TBOOLEAN, - TNUMBER, - TSTRING, - TTABLE, - TFUNCTION, - TUSERDATA, - TTHREAD
See Also:
LuaValue.typename()
-
-
-
- -

-typename

-
-public java.lang.String typename()
-
-
Description copied from class: LuaValue
-
Get the String name of the type of this value. -

-

-

-
Specified by:
typename in class LuaValue
-
-
- -
Returns:
name from type name list LuaValue.TYPE_NAMES - corresponding to the type of this value: - "nil", "boolean", "number", "string", - "table", "function", "userdata", "thread"
See Also:
LuaValue.type()
-
-
-
- -

-isboolean

-
-public boolean isboolean()
-
-
Description copied from class: LuaValue
-
Check if this is a boolean -

-

-
Overrides:
isboolean in class LuaValue
-
-
- -
Returns:
true if this is a boolean, otherwise false
See Also:
LuaValue.isboolean(), -LuaValue.toboolean(), -LuaValue.checkboolean(), -LuaValue.optboolean(boolean), -#TOBOLEAN
-
-
-
- -

-not

-
-public LuaValue not()
-
-
Description copied from class: LuaValue
-
Unary not: return inverse boolean value (~this) as defined by lua not operator -

-

-
Overrides:
not in class LuaValue
-
-
- -
Returns:
TRUE if NIL or FALSE, otherwise FALSE
-
-
-
- -

-booleanValue

-
-public boolean booleanValue()
-
-
Return the boolean value for this boolean -

-

- -
Returns:
value as a Java boolean
-
-
-
- -

-toboolean

-
-public boolean toboolean()
-
-
Description copied from class: LuaValue
-
Convert to boolean false if LuaValue.NIL or FALSE, true if anything else -

-

-
Overrides:
toboolean in class LuaValue
-
-
- -
Returns:
Value cast to byte if number or string convertible to number, otherwise 0
See Also:
LuaValue.optboolean(boolean), -LuaValue.checkboolean(), -LuaValue.isboolean(), -TBOOLEAN
-
-
-
- -

-tojstring

-
-public java.lang.String tojstring()
-
-
Description copied from class: LuaValue
-
Convert to human readable String for any type. -

-

-
Overrides:
tojstring in class LuaValue
-
-
- -
Returns:
String for use by human readers based on type.
See Also:
LuaValue.tostring(), -LuaValue.optjstring(String), -LuaValue.checkjstring(), -LuaValue.isstring(), -TSTRING
-
-
-
- -

-optboolean

-
-public boolean optboolean(boolean defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a boolean and return its boolean value -

-

-
Overrides:
optboolean in class LuaValue
-
-
-
Parameters:
defval - boolean value to return if this is nil or none -
Returns:
this cast to boolean if a , - defval if nil or none, - throws LuaError otherwise
See Also:
LuaValue.checkboolean(), -LuaValue.isboolean(), -LuaValue.TBOOLEAN
-
-
-
- -

-checkboolean

-
-public boolean checkboolean()
-
-
Description copied from class: LuaValue
-
Check that the value is a LuaBoolean, - or throw LuaError if not -

-

-
Overrides:
checkboolean in class LuaValue
-
-
- -
Returns:
boolean value for this if it is a LuaBoolean
See Also:
LuaValue.optboolean(boolean), -LuaValue.TBOOLEAN
-
-
-
- -

-getmetatable

-
-public LuaValue getmetatable()
-
-
Description copied from class: LuaValue
-
Get the metatable for this LuaValue -

- For LuaTable and LuaUserdata instances, - the metatable returned is this instance metatable. - For all other types, the class metatable value will be returned. -

-

-
Overrides:
getmetatable in class LuaValue
-
-
- -
Returns:
metatable, or null if it there is none
See Also:
s_metatable, -LuaNumber.s_metatable, -LuaNil.s_metatable, -LuaFunction.s_metatable, -LuaThread.s_metatable
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/LuaClosure.html b/luaj-2.0.3/docs/api/org/luaj/vm2/LuaClosure.html deleted file mode 100644 index 6331e3fe1..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/LuaClosure.html +++ /dev/null @@ -1,857 +0,0 @@ - - - - - - -LuaClosure (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2 -
-Class LuaClosure

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.LuaFunction
-              extended by org.luaj.vm2.LuaClosure
-
-
-
-
public class LuaClosure
extends LuaFunction
- - -

-Extension of LuaFunction which executes lua bytecode. -

- A LuaClosure is a combination of a Prototype - and a LuaValue to use as an environment for execution. -

- There are three main ways LuaClosure instances are created: -

-

- To construct it directly, the Prototype is typically created via a compiler such as LuaC: -

 InputStream is = new ByteArrayInputStream("print('hello,world').getBytes());
- Prototype p = LuaC.instance.compile(is, "script");
- LuaValue _G = JsePlatform.standardGlobals()
- LuaClosure f = new LuaClosure(p, _G);
- 
-

- To construct it indirectly, the LuaC compiler may be used, - which implements the LoadState.LuaCompiler interface: -

 LuaFunction f = LuaC.instance.load(is, "script", _G);
- 
-

- Typically, a closure that has just been loaded needs to be initialized by executing it, - and its return value can be saved if needed: -

 LuaValue r = f.call();
- _G.set( "mypkg", r ) 
- 
-

- In the preceding, the loaded value is typed as LuaFunction - to allow for the possibility of other compilers such as LuaJC - producing LuaFunction directly without - creating a Prototype or LuaClosure. -

- Since a LuaClosure is a LuaFunction which is a LuaValue, - all the value operations can be used directly such as: -

-

- -

-

-
See Also:
LuaValue, -LuaFunction, -LuaValue.isclosure(), -LuaValue.checkclosure(), -LuaValue.optclosure(LuaClosure), -LoadState, -LoadState.compiler
-
- -

- - - - - - - - - - - - - - - -
-Field Summary
- Prototypep - -
-           
- UpValue[]upValues - -
-           
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaFunction
env, s_metatable
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - - - - - - -
-Constructor Summary
-protected LuaClosure(int nupvalues, - LuaValue env) - -
-           
- LuaClosure(Prototype p, - LuaValue env) - -
-          Supply the initial environment
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
- LuaValuecall() - -
-          Call this with 0 arguments, including metatag processing, - and return only the first return value.
- LuaValuecall(LuaValue arg) - -
-          Call this with 1 argument, including metatag processing, - and return only the first return value.
- LuaValuecall(LuaValue arg1, - LuaValue arg2) - -
-          Call this with 2 arguments, including metatag processing, - and return only the first return value.
- LuaValuecall(LuaValue arg1, - LuaValue arg2, - LuaValue arg3) - -
-          Call this with 3 arguments, including metatag processing, - and return only the first return value.
- LuaClosurecheckclosure() - -
-          Check that the value is a LuaClosure , - or throw LuaError if not
-protected  Varargsexecute(LuaValue[] stack, - Varargs varargs) - -
-           
- LuaValuegetmetatable() - -
-          Get the metatable for this LuaValue
-protected  LuaValuegetUpvalue(int i) - -
-           
- Varargsinvoke(Varargs varargs) - -
-          Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs.
- booleanisclosure() - -
-          Check if this is a function that is a closure, - meaning interprets lua bytecode for its execution
- VarargsonInvoke(Varargs varargs) - -
-          Callback used during tail call processing to invoke the function once.
- LuaClosureoptclosure(LuaClosure defval) - -
-          Check that optional argument is a closure and return as LuaClosure
-protected  voidsetUpvalue(int i, - LuaValue v) - -
-           
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaFunction
checkfunction, getfenv, isfunction, optfunction, setfenv, type, typename
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
add, add, add, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, callmt, checkboolean, checkdouble, checkint, checkinteger, checkjstring, checklong, checkmetatag, checknotnil, checknumber, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalidkey, compareerror, compareerror, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, div, div, div, divInto, eq_b, eq, eqmtcall, equals, error, get, get, get, getn, gettable, gt_b, gt_b, gt_b, gt, gt, gt, gteq_b, gteq_b, gteq_b, gteq, gteq, gteq, illegal, inext, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isint, isinttype, islong, isnil, isnumber, isstring, istable, isthread, isuserdata, isuserdata, isweaknil, len, lenerror, length, listOf, listOf, load, lt_b, lt_b, lt_b, lt, lt, lt, lteq_b, lteq_b, lteq_b, lteq, lteq, lteq, metatag, method, method, method, method, method, method, mod, mod, mod, modFrom, mul, mul, mul, narg, neg, neq_b, neq, next, not, optboolean, optdouble, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, or, pow, pow, pow, powWith, powWith, presize, raweq, raweq, raweq, raweq, raweq, rawget, rawget, rawget, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setmetatable, settable, strcmp, strcmp, strongkey, strongvalue, strvalue, sub, sub, sub, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, tonumber, toshort, tostring, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Field Detail
- -

-p

-
-public final Prototype p
-
-
-
-
-
- -

-upValues

-
-public final UpValue[] upValues
-
-
-
-
- - - - - - - - -
-Constructor Detail
- -

-LuaClosure

-
-public LuaClosure(Prototype p,
-                  LuaValue env)
-
-
Supply the initial environment -

-

-
- -

-LuaClosure

-
-protected LuaClosure(int nupvalues,
-                     LuaValue env)
-
-
- - - - - - - - -
-Method Detail
- -

-isclosure

-
-public boolean isclosure()
-
-
Description copied from class: LuaValue
-
Check if this is a function that is a closure, - meaning interprets lua bytecode for its execution -

-

-
Overrides:
isclosure in class LuaValue
-
-
- -
Returns:
true if this is a closure, otherwise false
See Also:
LuaValue.isfunction(), -LuaValue.checkclosure(), -LuaValue.optclosure(LuaClosure), -LuaValue.TFUNCTION
-
-
-
- -

-optclosure

-
-public LuaClosure optclosure(LuaClosure defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a closure and return as LuaClosure -

- A LuaClosure is a that executes lua byteccode. -

-

-
Overrides:
optclosure in class LuaValue
-
-
-
Parameters:
defval - LuaClosure to return if this is nil or none -
Returns:
this cast to LuaClosure if a function, - defval if nil or none, - throws LuaError otherwise
See Also:
LuaValue.checkclosure(), -LuaValue.isclosure(), -LuaValue.TFUNCTION
-
-
-
- -

-checkclosure

-
-public LuaClosure checkclosure()
-
-
Description copied from class: LuaValue
-
Check that the value is a LuaClosure , - or throw LuaError if not -

- LuaClosure is a subclass of that interprets lua bytecode. -

-

-
Overrides:
checkclosure in class LuaValue
-
-
- -
Returns:
this cast as LuaClosure
See Also:
LuaValue.checkfunction(), -LuaValue.optclosure(LuaClosure), -LuaValue.isclosure(), -LuaValue.TFUNCTION
-
-
-
- -

-getmetatable

-
-public LuaValue getmetatable()
-
-
Description copied from class: LuaValue
-
Get the metatable for this LuaValue -

- For LuaTable and LuaUserdata instances, - the metatable returned is this instance metatable. - For all other types, the class metatable value will be returned. -

-

-
Overrides:
getmetatable in class LuaFunction
-
-
- -
Returns:
metatable, or null if it there is none
See Also:
LuaBoolean.s_metatable, -LuaNumber.s_metatable, -LuaNil.s_metatable, -LuaFunction.s_metatable, -LuaThread.s_metatable
-
-
-
- -

-call

-
-public final LuaValue call()
-
-
Description copied from class: LuaValue
-
Call this with 0 arguments, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use LuaValue.invoke() instead. -

- To call this as a method call, use LuaValue.method(LuaValue) instead. -

-

-
Overrides:
call in class LuaValue
-
-
- -
Returns:
First return value (this()), or NIL if there were none.
See Also:
LuaValue.call(LuaValue), -LuaValue.call(LuaValue,LuaValue), -LuaValue.call(LuaValue, LuaValue, LuaValue), -LuaValue.invoke(), -LuaValue.method(String), -LuaValue.method(LuaValue)
-
-
-
- -

-call

-
-public final LuaValue call(LuaValue arg)
-
-
Description copied from class: LuaValue
-
Call this with 1 argument, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use LuaValue.invoke() instead. -

- To call this as a method call, use LuaValue.method(LuaValue) instead. -

-

-
Overrides:
call in class LuaValue
-
-
-
Parameters:
arg - First argument to supply to the called function -
Returns:
First return value (this(arg)), or NIL if there were none.
See Also:
LuaValue.call(), -LuaValue.call(LuaValue,LuaValue), -LuaValue.call(LuaValue, LuaValue, LuaValue), -#invoke(LuaValue), -LuaValue.method(String,LuaValue), -LuaValue.method(LuaValue,LuaValue)
-
-
-
- -

-call

-
-public final LuaValue call(LuaValue arg1,
-                           LuaValue arg2)
-
-
Description copied from class: LuaValue
-
Call this with 2 arguments, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use LuaValue.invoke() instead. -

- To call this as a method call, use LuaValue.method(LuaValue) instead. -

-

-
Overrides:
call in class LuaValue
-
-
-
Parameters:
arg1 - First argument to supply to the called function
arg2 - Second argument to supply to the called function -
Returns:
First return value (this(arg1,arg2)), or NIL if there were none.
See Also:
LuaValue.call(), -LuaValue.call(LuaValue), -LuaValue.call(LuaValue, LuaValue, LuaValue), -#invoke(LuaValue,LuaValue), -LuaValue.method(String,LuaValue,LuaValue), -LuaValue.method(LuaValue,LuaValue,LuaValue)
-
-
-
- -

-call

-
-public final LuaValue call(LuaValue arg1,
-                           LuaValue arg2,
-                           LuaValue arg3)
-
-
Description copied from class: LuaValue
-
Call this with 3 arguments, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use LuaValue.invoke() instead. -

- To call this as a method call, use LuaValue.method(LuaValue) instead. -

-

-
Overrides:
call in class LuaValue
-
-
-
Parameters:
arg1 - First argument to supply to the called function
arg2 - Second argument to supply to the called function
arg3 - Second argument to supply to the called function -
Returns:
First return value (this(arg1,arg2,arg3)), or NIL if there were none.
See Also:
LuaValue.call(), -LuaValue.call(LuaValue), -LuaValue.call(LuaValue, LuaValue), -#invoke(LuaValue,LuaValue, LuaValue), -LuaValue.invokemethod(String,Varargs), -LuaValue.invokemethod(LuaValue,Varargs)
-
-
-
- -

-invoke

-
-public final Varargs invoke(Varargs varargs)
-
-
Description copied from class: LuaValue
-
Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs. -

- If this is a LuaFunction, call it, and return all values. - Otherwise, look for the CALL metatag and call that. -

- To get a particular return value, us Varargs.arg(int) -

- To call this as a method call, use LuaValue.invokemethod(LuaValue) instead. -

-

-
Overrides:
invoke in class LuaValue
-
-
-
Parameters:
varargs - Varargs containing the arguments to supply to the called function -
Returns:
All return values as a Varargs instance.
See Also:
LuaValue.varargsOf(LuaValue[]), -LuaValue.call(LuaValue), -LuaValue.invoke(), -LuaValue.invoke(LuaValue,Varargs), -LuaValue.invokemethod(String,Varargs), -LuaValue.invokemethod(LuaValue,Varargs)
-
-
-
- -

-onInvoke

-
-public Varargs onInvoke(Varargs varargs)
-
-
Description copied from class: LuaValue
-
Callback used during tail call processing to invoke the function once. -

- This may return a TailcallVarargs to be evaluated by the client. -

- This should not be called directly, instead use on of the call invocation functions. -

-

-
Overrides:
onInvoke in class LuaValue
-
-
-
Parameters:
varargs - the arguments to the call invocation. -
Returns:
Varargs the return values, possible a TailcallVarargs.
See Also:
LuaValue.call(), -LuaValue.invoke(), -LuaValue.method(LuaValue), -LuaValue.invokemethod(LuaValue)
-
-
-
- -

-execute

-
-protected Varargs execute(LuaValue[] stack,
-                          Varargs varargs)
-
-
-
-
-
-
- -

-getUpvalue

-
-protected LuaValue getUpvalue(int i)
-
-
-
-
-
-
- -

-setUpvalue

-
-protected void setUpvalue(int i,
-                          LuaValue v)
-
-
-
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/LuaDouble.html b/luaj-2.0.3/docs/api/org/luaj/vm2/LuaDouble.html deleted file mode 100644 index 11a9f134b..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/LuaDouble.html +++ /dev/null @@ -1,3317 +0,0 @@ - - - - - - -LuaDouble (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2 -
-Class LuaDouble

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.LuaNumber
-              extended by org.luaj.vm2.LuaDouble
-
-
-
-
public class LuaDouble
extends LuaNumber
- - -

-Extension of LuaNumber which can hold a Java double as its value. -

- These instance are not instantiated directly by clients, but indirectly - via the static functions LuaValue.valueOf(int) or LuaValue.valueOf(double) - functions. This ensures that values which can be represented as int - are wrapped in LuaInteger instead of LuaDouble. -

- Almost all API's implemented in LuaDouble are defined and documented in LuaValue. -

- However the constants NAN, POSINF, NEGINF, - JSTR_NAN, JSTR_POSINF, and JSTR_NEGINF may be useful - when dealing with Nan or Infinite values. -

- LuaDouble also defines functions for handling the unique math rules of lua devision and modulo in -

-

-

- -

-

-
See Also:
LuaValue, -LuaNumber, -LuaInteger, -LuaValue.valueOf(int), -LuaValue.valueOf(double)
-
- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Field Summary
-static java.lang.StringJSTR_NAN - -
-          Constant String representation for NaN (not a number), "nan"
-static java.lang.StringJSTR_NEGINF - -
-          Constant String representation for negative infinity, "-inf"
-static java.lang.StringJSTR_POSINF - -
-          Constant String representation for positive infinity, "inf"
-static LuaDoubleNAN - -
-          Constant LuaDouble representing NaN (not a number)
-static LuaDoubleNEGINF - -
-          Constant LuaDouble representing negative infinity
-static LuaDoublePOSINF - -
-          Constant LuaDouble representing positive infinity
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaNumber
s_metatable
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
- LuaValueadd(double lhs) - -
-          Add: Perform numeric add operation with another value - of double type with metatag processing
- LuaValueadd(LuaValue rhs) - -
-          Add: Perform numeric add operation with another value - including metatag processing.
- doublecheckdouble() - -
-          Check that the value is numeric and return the value as a double, - or throw LuaError if not numeric
- intcheckint() - -
-          Check that the value is numeric, and convert and cast value to int, or throw LuaError if not numeric
- LuaIntegercheckinteger() - -
-          Check that the value is numeric, and convert and cast value to int, or throw LuaError if not numeric
- java.lang.Stringcheckjstring() - -
-          Convert this value to a Java String.
- longchecklong() - -
-          Check that the value is numeric, and convert and cast value to long, or throw LuaError if not numeric
- LuaNumberchecknumber() - -
-          Check that the value is numeric, and return as a LuaNumber if so, or throw LuaError
- LuaStringcheckstring() - -
-          Check that this is a lua string, or throw LuaError if it is not.
- LuaValuecheckvalidkey() - -
-          Check that this is a valid key in a table index operation, or throw LuaError if not
-static doubleddiv_d(double lhs, - double rhs) - -
-          Divide two double numbers according to lua math, and return a double result.
-static LuaValueddiv(double lhs, - double rhs) - -
-          Divide two double numbers according to lua math, and return a LuaValue result.
- LuaValuediv(double rhs) - -
-          Divide: Perform numeric divide operation by another value - of double type without metatag processing
- LuaValuediv(int rhs) - -
-          Divide: Perform numeric divide operation by another value - of int type without metatag processing
- LuaValuediv(LuaValue rhs) - -
-          Divide: Perform numeric divide operation by another value - of unknown type, - including metatag processing.
- LuaValuedivInto(double lhs) - -
-          Reverse-divide: Perform numeric divide operation into another value - with metatag processing
-static doubledmod_d(double lhs, - double rhs) - -
-          Take modulo for double numbers according to lua math, and return a double result.
-static LuaValuedmod(double lhs, - double rhs) - -
-          Take modulo double numbers according to lua math, and return a LuaValue result.
- booleaneq_b(LuaValue val) - -
-          Equals: Perform equality comparison with another value - including metatag processing using EQ, - and return java boolean
- LuaValueeq(LuaValue val) - -
-          Equals: Perform equality comparison with another value - including metatag processing using EQ.
- booleanequals(java.lang.Object o) - -
-           
- booleangt_b(double rhs) - -
-          Greater than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean.
- booleangt_b(int rhs) - -
-          Greater than: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean.
- booleangt_b(LuaValue rhs) - -
-          Greater than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean.
- LuaValuegt(double rhs) - -
-          Greater than: Perform numeric comparison with another value - of double type, - including metatag processing, and returning LuaValue.
- LuaValuegt(int rhs) - -
-          Greater than: Perform numeric comparison with another value - of int type, - including metatag processing, and returning LuaValue.
- LuaValuegt(LuaValue rhs) - -
-          Greater than: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue.
- booleangteq_b(double rhs) - -
-          Greater than or equals: Perform numeric comparison with another value - of double type, - including metatag processing, - and returning java boolean.
- booleangteq_b(int rhs) - -
-          Greater than or equals: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean.
- booleangteq_b(LuaValue rhs) - -
-          Greater than or equals: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean.
- LuaValuegteq(double rhs) - -
-          Greater than or equals: Perform numeric comparison with another value - of double type, - including metatag processing, and returning LuaValue.
- LuaValuegteq(int rhs) - -
-          Greater than or equals: Perform numeric comparison with another value - of int type, - including metatag processing, and returning LuaValue.
- LuaValuegteq(LuaValue rhs) - -
-          Greater than or equals: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue.
- inthashCode() - -
-           
- booleanislong() - -
-          Check if this is a number and is representable by java long - without rounding or truncation
- booleanisnumber() - -
-          Check if this is a number
- booleanisstring() - -
-          Check if this is a string
- booleanlt_b(double rhs) - -
-          Less than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean.
- booleanlt_b(int rhs) - -
-          Less than: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean.
- booleanlt_b(LuaValue rhs) - -
-          Less than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean.
- LuaValuelt(double rhs) - -
-          Less than: Perform numeric comparison with another value - of double type, - including metatag processing, and returning LuaValue.
- LuaValuelt(int rhs) - -
-          Less than: Perform numeric comparison with another value - of int type, - including metatag processing, and returning LuaValue.
- LuaValuelt(LuaValue rhs) - -
-          Less than: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue.
- booleanlteq_b(double rhs) - -
-          Less than or equals: Perform numeric comparison with another value - of double type, - including metatag processing, - and returning java boolean.
- booleanlteq_b(int rhs) - -
-          Less than or equals: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean.
- booleanlteq_b(LuaValue rhs) - -
-          Less than or equals: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean.
- LuaValuelteq(double rhs) - -
-          Less than or equals: Perform numeric comparison with another value - of double type, - including metatag processing, and returning LuaValue.
- LuaValuelteq(int rhs) - -
-          Less than or equals: Perform numeric comparison with another value - of int type, - including metatag processing, and returning LuaValue.
- LuaValuelteq(LuaValue rhs) - -
-          Less than or equals: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue.
- LuaValuemod(double rhs) - -
-          Modulo: Perform numeric modulo operation with another value - of double type without metatag processing
- LuaValuemod(int rhs) - -
-          Modulo: Perform numeric modulo operation with another value - of int type without metatag processing
- LuaValuemod(LuaValue rhs) - -
-          Modulo: Perform numeric modulo operation with another value - of unknown type, - including metatag processing.
- LuaValuemodFrom(double lhs) - -
-          Reverse-modulo: Perform numeric modulo operation from another value - with metatag processing
- LuaValuemul(double lhs) - -
-          Multiply: Perform numeric multiply operation with another value - of double type with metatag processing
- LuaValuemul(int lhs) - -
-          Multiply: Perform numeric multiply operation with another value - of int type with metatag processing
- LuaValuemul(LuaValue rhs) - -
-          Multiply: Perform numeric multiply operation with another value - of unknown type, - including metatag processing.
- LuaValueneg() - -
-          Unary minus: return negative value (-this) as defined by lua unary minus operator
- doubleoptdouble(double defval) - -
-          Check that optional argument is a number or string convertible to number and return as double
- intoptint(int defval) - -
-          Check that optional argument is a number or string convertible to number and return as int
- LuaIntegeroptinteger(LuaInteger defval) - -
-          Check that optional argument is a number or string convertible to number and return as LuaInteger
- java.lang.Stringoptjstring(java.lang.String defval) - -
-          Check that optional argument is a string or number and return as Java String
- longoptlong(long defval) - -
-          Check that optional argument is a number or string convertible to number and return as long
- LuaNumberoptnumber(LuaNumber defval) - -
-          Check that optional argument is a number or string convertible to number and return as LuaNumber
- LuaStringoptstring(LuaString defval) - -
-          Check that optional argument is a string or number and return as LuaString
- LuaValuepow(double rhs) - -
-          Raise to power: Raise this value to a power - of double type with metatag processing
- LuaValuepow(int rhs) - -
-          Raise to power: Raise this value to a power - of int type with metatag processing
- LuaValuepow(LuaValue rhs) - -
-          Raise to power: Raise this value to a power - including metatag processing.
- LuaValuepowWith(double lhs) - -
-          Reverse-raise to power: Raise another value of double type to this power - with metatag processing
- LuaValuepowWith(int lhs) - -
-          Reverse-raise to power: Raise another value of double type to this power - with metatag processing
- booleanraweq(double val) - -
-          Equals: Perform direct equality comparison with a double value - without metatag processing.
- booleanraweq(int val) - -
-          Equals: Perform direct equality comparison with a int value - without metatag processing.
- booleanraweq(LuaValue val) - -
-          Equals: Perform direct equality comparison with another value - without metatag processing.
- intstrcmp(LuaString rhs) - -
-          Perform string comparison with another value - known to be a LuaString - using string comparison based on byte values.
- LuaStringstrvalue() - -
-          Convert this value to a string if it is a LuaString or LuaNumber, - or throw a LuaError if it is not
- LuaValuesub(double rhs) - -
-          Subtract: Perform numeric subtract operation with another value - of double type with metatag processing
- LuaValuesub(int rhs) - -
-          Subtract: Perform numeric subtract operation with another value - of int type with metatag processing
- LuaValuesub(LuaValue rhs) - -
-          Subtract: Perform numeric subtract operation with another value - of unknown type, - including metatag processing.
- LuaValuesubFrom(double lhs) - -
-          Reverse-subtract: Perform numeric subtract operation from an int value - with metatag processing
- bytetobyte() - -
-          Convert to byte if numeric, or 0 if not.
- chartochar() - -
-          Convert to char if numeric, or 0 if not.
- doubletodouble() - -
-          Convert to double if numeric, or 0 if not.
- floattofloat() - -
-          Convert to float if numeric, or 0 if not.
- inttoint() - -
-          Convert to int if numeric, or 0 if not.
- java.lang.Stringtojstring() - -
-          Convert to human readable String for any type.
- longtolong() - -
-          Convert to long if numeric, or 0 if not.
- LuaValuetonumber() - -
-          Conditionally convert to lua number without throwing errors.
- shorttoshort() - -
-          Convert to short if numeric, or 0 if not.
- LuaValuetostring() - -
-          Conditionally convert to lua string without throwing errors.
-static LuaNumbervalueOf(double d) - -
-           
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaNumber
checknumber, concat, concat, concatTo, concatTo, getmetatable, type, typename
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
add, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, call, call, call, call, callmt, checkboolean, checkclosure, checkfunction, checkmetatag, checknotnil, checktable, checkthread, checkuserdata, checkuserdata, compareerror, compareerror, comparemt, concatmt, concatTo, eqmtcall, error, get, get, get, getfenv, getn, gettable, illegal, inext, invoke, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isfunction, isint, isinttype, isnil, istable, isthread, isuserdata, isuserdata, isweaknil, len, lenerror, length, listOf, listOf, load, metatag, method, method, method, method, method, method, narg, neq_b, neq, next, not, onInvoke, optboolean, optclosure, optfunction, opttable, optthread, optuserdata, optuserdata, optvalue, or, presize, raweq, raweq, rawget, rawget, rawget, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setfenv, setmetatable, settable, strcmp, strongkey, strongvalue, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Field Detail
- -

-NAN

-
-public static final LuaDouble NAN
-
-
Constant LuaDouble representing NaN (not a number) -

-

-
-
-
- -

-POSINF

-
-public static final LuaDouble POSINF
-
-
Constant LuaDouble representing positive infinity -

-

-
-
-
- -

-NEGINF

-
-public static final LuaDouble NEGINF
-
-
Constant LuaDouble representing negative infinity -

-

-
-
-
- -

-JSTR_NAN

-
-public static final java.lang.String JSTR_NAN
-
-
Constant String representation for NaN (not a number), "nan" -

-

-
See Also:
Constant Field Values
-
-
- -

-JSTR_POSINF

-
-public static final java.lang.String JSTR_POSINF
-
-
Constant String representation for positive infinity, "inf" -

-

-
See Also:
Constant Field Values
-
-
- -

-JSTR_NEGINF

-
-public static final java.lang.String JSTR_NEGINF
-
-
Constant String representation for negative infinity, "-inf" -

-

-
See Also:
Constant Field Values
-
- - - - - - - - -
-Method Detail
- -

-valueOf

-
-public static LuaNumber valueOf(double d)
-
-
-
-
-
-
- -

-hashCode

-
-public int hashCode()
-
-
-
Overrides:
hashCode in class java.lang.Object
-
-
-
-
-
-
- -

-islong

-
-public boolean islong()
-
-
Description copied from class: LuaValue
-
Check if this is a number and is representable by java long - without rounding or truncation -

-

-
Overrides:
islong in class LuaValue
-
-
- -
Returns:
true if this is a number - meaning derives from LuaNumber - or derives from LuaString and is convertible to a number, - and can be represented by long, - otherwise false
See Also:
LuaValue.tonumber(), -LuaValue.checklong(), -LuaValue.optlong(long), -LuaValue.TNUMBER
-
-
-
- -

-tobyte

-
-public byte tobyte()
-
-
Description copied from class: LuaValue
-
Convert to byte if numeric, or 0 if not. -

-

-
Overrides:
tobyte in class LuaValue
-
-
- -
Returns:
Value cast to byte if number or string convertible to number, otherwise 0
See Also:
LuaValue.toint(), -LuaValue.todouble(), -#optbyte(byte), -LuaValue.checknumber(), -LuaValue.isnumber(), -TNUMBER
-
-
-
- -

-tochar

-
-public char tochar()
-
-
Description copied from class: LuaValue
-
Convert to char if numeric, or 0 if not. -

-

-
Overrides:
tochar in class LuaValue
-
-
- -
Returns:
Value cast to char if number or string convertible to number, otherwise 0
See Also:
LuaValue.toint(), -LuaValue.todouble(), -#optchar(char), -LuaValue.checknumber(), -LuaValue.isnumber(), -TNUMBER
-
-
-
- -

-todouble

-
-public double todouble()
-
-
Description copied from class: LuaValue
-
Convert to double if numeric, or 0 if not. -

-

-
Overrides:
todouble in class LuaValue
-
-
- -
Returns:
Value cast to double if number or string convertible to number, otherwise 0
See Also:
LuaValue.toint(), -LuaValue.tobyte(), -LuaValue.tochar(), -LuaValue.toshort(), -LuaValue.tolong(), -LuaValue.tofloat(), -LuaValue.optdouble(double), -LuaValue.checknumber(), -LuaValue.isnumber(), -TNUMBER
-
-
-
- -

-tofloat

-
-public float tofloat()
-
-
Description copied from class: LuaValue
-
Convert to float if numeric, or 0 if not. -

-

-
Overrides:
tofloat in class LuaValue
-
-
- -
Returns:
Value cast to float if number or string convertible to number, otherwise 0
See Also:
LuaValue.toint(), -LuaValue.todouble(), -#optfloat(float), -LuaValue.checknumber(), -LuaValue.isnumber(), -TNUMBER
-
-
-
- -

-toint

-
-public int toint()
-
-
Description copied from class: LuaValue
-
Convert to int if numeric, or 0 if not. -

-

-
Overrides:
toint in class LuaValue
-
-
- -
Returns:
Value cast to int if number or string convertible to number, otherwise 0
See Also:
LuaValue.tobyte(), -LuaValue.tochar(), -LuaValue.toshort(), -LuaValue.tolong(), -LuaValue.tofloat(), -LuaValue.todouble(), -LuaValue.optint(int), -LuaValue.checknumber(), -LuaValue.isnumber(), -TNUMBER
-
-
-
- -

-tolong

-
-public long tolong()
-
-
Description copied from class: LuaValue
-
Convert to long if numeric, or 0 if not. -

-

-
Overrides:
tolong in class LuaValue
-
-
- -
Returns:
Value cast to long if number or string convertible to number, otherwise 0
See Also:
LuaValue.isint(), -LuaValue.isinttype(), -LuaValue.toint(), -LuaValue.todouble(), -LuaValue.optlong(long), -LuaValue.checknumber(), -LuaValue.isnumber(), -TNUMBER
-
-
-
- -

-toshort

-
-public short toshort()
-
-
Description copied from class: LuaValue
-
Convert to short if numeric, or 0 if not. -

-

-
Overrides:
toshort in class LuaValue
-
-
- -
Returns:
Value cast to short if number or string convertible to number, otherwise 0
See Also:
LuaValue.toint(), -LuaValue.todouble(), -#optshort(short), -LuaValue.checknumber(), -LuaValue.isnumber(), -TNUMBER
-
-
-
- -

-optdouble

-
-public double optdouble(double defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a number or string convertible to number and return as double -

-

-
Overrides:
optdouble in class LuaValue
-
-
-
Parameters:
defval - double to return if this is nil or none -
Returns:
this cast to double if numeric, - defval if nil or none, - throws LuaError otherwise
See Also:
LuaValue.optint(int), -LuaValue.optinteger(LuaInteger), -LuaValue.checkdouble(), -LuaValue.todouble(), -LuaValue.tonumber(), -LuaValue.isnumber(), -LuaValue.TNUMBER
-
-
-
- -

-optint

-
-public int optint(int defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a number or string convertible to number and return as int -

-

-
Overrides:
optint in class LuaValue
-
-
-
Parameters:
defval - int to return if this is nil or none -
Returns:
this cast to int if numeric, - defval if nil or none, - throws LuaError otherwise
See Also:
LuaValue.optdouble(double), -LuaValue.optlong(long), -LuaValue.optinteger(LuaInteger), -LuaValue.checkint(), -LuaValue.toint(), -LuaValue.tonumber(), -LuaValue.isnumber(), -LuaValue.TNUMBER
-
-
-
- -

-optinteger

-
-public LuaInteger optinteger(LuaInteger defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a number or string convertible to number and return as LuaInteger -

-

-
Overrides:
optinteger in class LuaValue
-
-
-
Parameters:
defval - LuaInteger to return if this is nil or none -
Returns:
this converted and wrapped in LuaInteger if numeric, - defval if nil or none, - throws LuaError otherwise
See Also:
LuaValue.optdouble(double), -LuaValue.optint(int), -LuaValue.checkint(), -LuaValue.toint(), -LuaValue.tonumber(), -LuaValue.isnumber(), -LuaValue.TNUMBER
-
-
-
- -

-optlong

-
-public long optlong(long defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a number or string convertible to number and return as long -

-

-
Overrides:
optlong in class LuaValue
-
-
-
Parameters:
defval - long to return if this is nil or none -
Returns:
this cast to long if numeric, - defval if nil or none, - throws LuaError otherwise
See Also:
LuaValue.optdouble(double), -LuaValue.optint(int), -LuaValue.checkint(), -LuaValue.toint(), -LuaValue.tonumber(), -LuaValue.isnumber(), -LuaValue.TNUMBER
-
-
-
- -

-checkinteger

-
-public LuaInteger checkinteger()
-
-
Description copied from class: LuaValue
-
Check that the value is numeric, and convert and cast value to int, or throw LuaError if not numeric -

- Values that are LuaNumber will be cast to int and may lose precision. - Values that are LuaString that can be converted to a number will be converted, - then cast to int, so may also lose precision. -

-

-
Overrides:
checkinteger in class LuaValue
-
-
- -
Returns:
value cast to a int and wrapped in LuaInteger if numeric
See Also:
LuaValue.checkint(), -LuaValue.checklong(), -LuaValue.checkdouble(), -LuaValue.optinteger(LuaInteger), -LuaValue.TNUMBER
-
-
-
- -

-neg

-
-public LuaValue neg()
-
-
Description copied from class: LuaValue
-
Unary minus: return negative value (-this) as defined by lua unary minus operator -

-

-
Overrides:
neg in class LuaValue
-
-
- -
Returns:
boolean inverse as LuaBoolean if boolean or nil, - numeric inverse as if numeric, - or metatag processing result if UNM metatag is defined
-
-
-
- -

-equals

-
-public boolean equals(java.lang.Object o)
-
-
-
Overrides:
equals in class LuaValue
-
-
-
-
-
-
- -

-eq

-
-public LuaValue eq(LuaValue val)
-
-
Description copied from class: LuaValue
-
Equals: Perform equality comparison with another value - including metatag processing using EQ. -

-

-
Overrides:
eq in class LuaValue
-
-
-
Parameters:
val - The value to compare with. -
Returns:
TRUE if values are comparable and (this == rhs), - FALSE if comparable but not equal, - LuaValue if metatag processing occurs.
See Also:
LuaValue.eq_b(LuaValue), -LuaValue.raweq(LuaValue), -LuaValue.neq(LuaValue), -LuaValue.eqmtcall(LuaValue, LuaValue, LuaValue, LuaValue), -LuaValue.EQ
-
-
-
- -

-eq_b

-
-public boolean eq_b(LuaValue val)
-
-
Description copied from class: LuaValue
-
Equals: Perform equality comparison with another value - including metatag processing using EQ, - and return java boolean -

-

-
Overrides:
eq_b in class LuaValue
-
-
-
Parameters:
val - The value to compare with. -
Returns:
true if values are comparable and (this == rhs), - false if comparable but not equal, - result converted to java boolean if metatag processing occurs.
See Also:
LuaValue.eq(LuaValue), -LuaValue.raweq(LuaValue), -LuaValue.neq_b(LuaValue), -LuaValue.eqmtcall(LuaValue, LuaValue, LuaValue, LuaValue), -LuaValue.EQ
-
-
-
- -

-raweq

-
-public boolean raweq(LuaValue val)
-
-
Description copied from class: LuaValue
-
Equals: Perform direct equality comparison with another value - without metatag processing. -

-

-
Overrides:
raweq in class LuaValue
-
-
-
Parameters:
val - The value to compare with. -
Returns:
true if (this == rhs), false otherwise
See Also:
LuaValue.eq(LuaValue), -LuaValue.raweq(LuaUserdata), -LuaValue.raweq(LuaString), -LuaValue.raweq(double), -LuaValue.raweq(int), -LuaValue.EQ
-
-
-
- -

-raweq

-
-public boolean raweq(double val)
-
-
Description copied from class: LuaValue
-
Equals: Perform direct equality comparison with a double value - without metatag processing. -

-

-
Overrides:
raweq in class LuaValue
-
-
-
Parameters:
val - The double value to compare with. -
Returns:
true if this is a LuaNumber - whose value equals val, - otherwise false
-
-
-
- -

-raweq

-
-public boolean raweq(int val)
-
-
Description copied from class: LuaValue
-
Equals: Perform direct equality comparison with a int value - without metatag processing. -

-

-
Overrides:
raweq in class LuaValue
-
-
-
Parameters:
val - The double value to compare with. -
Returns:
true if this is a LuaNumber - whose value equals val, - otherwise false
-
-
-
- -

-add

-
-public LuaValue add(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Add: Perform numeric add operation with another value - including metatag processing. -

- Each operand must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
add in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the add with -
Returns:
value of (this + rhs) if both are numeric, - or LuaValue if metatag processing occurs
See Also:
LuaValue.arithmt(LuaValue, LuaValue)
-
-
-
- -

-add

-
-public LuaValue add(double lhs)
-
-
Description copied from class: LuaValue
-
Add: Perform numeric add operation with another value - of double type with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
add in class LuaValue
-
-
-
Parameters:
lhs - The right-hand-side value to perform the add with -
Returns:
value of (this + rhs) if this is numeric
See Also:
LuaValue.add(LuaValue)
-
-
-
- -

-sub

-
-public LuaValue sub(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Subtract: Perform numeric subtract operation with another value - of unknown type, - including metatag processing. -

- Each operand must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
sub in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the subtract with -
Returns:
value of (this - rhs) if both are numeric, - or LuaValue if metatag processing occurs
See Also:
LuaValue.arithmt(LuaValue, LuaValue)
-
-
-
- -

-sub

-
-public LuaValue sub(double rhs)
-
-
Description copied from class: LuaValue
-
Subtract: Perform numeric subtract operation with another value - of double type with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
sub in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the subtract with -
Returns:
value of (this - rhs) if this is numeric
See Also:
LuaValue.sub(LuaValue)
-
-
-
- -

-sub

-
-public LuaValue sub(int rhs)
-
-
Description copied from class: LuaValue
-
Subtract: Perform numeric subtract operation with another value - of int type with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
sub in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the subtract with -
Returns:
value of (this - rhs) if this is numeric
See Also:
LuaValue.sub(LuaValue)
-
-
-
- -

-subFrom

-
-public LuaValue subFrom(double lhs)
-
-
Description copied from class: LuaValue
-
Reverse-subtract: Perform numeric subtract operation from an int value - with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
subFrom in class LuaValue
-
-
-
Parameters:
lhs - The left-hand-side value from which to perform the subtraction -
Returns:
value of (lhs - this) if this is numeric
See Also:
LuaValue.sub(LuaValue), -LuaValue.sub(double), -LuaValue.sub(int)
-
-
-
- -

-mul

-
-public LuaValue mul(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Multiply: Perform numeric multiply operation with another value - of unknown type, - including metatag processing. -

- Each operand must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
mul in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the multiply with -
Returns:
value of (this * rhs) if both are numeric, - or LuaValue if metatag processing occurs
See Also:
LuaValue.arithmt(LuaValue, LuaValue)
-
-
-
- -

-mul

-
-public LuaValue mul(double lhs)
-
-
Description copied from class: LuaValue
-
Multiply: Perform numeric multiply operation with another value - of double type with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
mul in class LuaValue
-
-
-
Parameters:
lhs - The right-hand-side value to perform the multiply with -
Returns:
value of (this * rhs) if this is numeric
See Also:
LuaValue.mul(LuaValue)
-
-
-
- -

-mul

-
-public LuaValue mul(int lhs)
-
-
Description copied from class: LuaValue
-
Multiply: Perform numeric multiply operation with another value - of int type with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
mul in class LuaValue
-
-
-
Parameters:
lhs - The right-hand-side value to perform the multiply with -
Returns:
value of (this * rhs) if this is numeric
See Also:
LuaValue.mul(LuaValue)
-
-
-
- -

-pow

-
-public LuaValue pow(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Raise to power: Raise this value to a power - including metatag processing. -

- Each operand must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
pow in class LuaValue
-
-
-
Parameters:
rhs - The power to raise this value to -
Returns:
value of (this ^ rhs) if both are numeric, - or LuaValue if metatag processing occurs
See Also:
LuaValue.arithmt(LuaValue, LuaValue)
-
-
-
- -

-pow

-
-public LuaValue pow(double rhs)
-
-
Description copied from class: LuaValue
-
Raise to power: Raise this value to a power - of double type with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
pow in class LuaValue
-
-
-
Parameters:
rhs - The power to raise this value to -
Returns:
value of (this ^ rhs) if this is numeric
See Also:
LuaValue.pow(LuaValue)
-
-
-
- -

-pow

-
-public LuaValue pow(int rhs)
-
-
Description copied from class: LuaValue
-
Raise to power: Raise this value to a power - of int type with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
pow in class LuaValue
-
-
-
Parameters:
rhs - The power to raise this value to -
Returns:
value of (this ^ rhs) if this is numeric
See Also:
LuaValue.pow(LuaValue)
-
-
-
- -

-powWith

-
-public LuaValue powWith(double lhs)
-
-
Description copied from class: LuaValue
-
Reverse-raise to power: Raise another value of double type to this power - with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
powWith in class LuaValue
-
-
-
Parameters:
lhs - The left-hand-side value which will be raised to this power -
Returns:
value of (lhs ^ this) if this is numeric
See Also:
LuaValue.pow(LuaValue), -LuaValue.pow(double), -LuaValue.pow(int)
-
-
-
- -

-powWith

-
-public LuaValue powWith(int lhs)
-
-
Description copied from class: LuaValue
-
Reverse-raise to power: Raise another value of double type to this power - with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
powWith in class LuaValue
-
-
-
Parameters:
lhs - The left-hand-side value which will be raised to this power -
Returns:
value of (lhs ^ this) if this is numeric
See Also:
LuaValue.pow(LuaValue), -LuaValue.pow(double), -LuaValue.pow(int)
-
-
-
- -

-div

-
-public LuaValue div(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Divide: Perform numeric divide operation by another value - of unknown type, - including metatag processing. -

- Each operand must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
div in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the divulo with -
Returns:
value of (this / rhs) if both are numeric, - or LuaValue if metatag processing occurs
See Also:
LuaValue.arithmt(LuaValue, LuaValue)
-
-
-
- -

-div

-
-public LuaValue div(double rhs)
-
-
Description copied from class: LuaValue
-
Divide: Perform numeric divide operation by another value - of double type without metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

- For metatag processing LuaValue.div(LuaValue) must be used -

-

-
Overrides:
div in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the divulo with -
Returns:
value of (this / rhs) if this is numeric
See Also:
LuaValue.div(LuaValue)
-
-
-
- -

-div

-
-public LuaValue div(int rhs)
-
-
Description copied from class: LuaValue
-
Divide: Perform numeric divide operation by another value - of int type without metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

- For metatag processing LuaValue.div(LuaValue) must be used -

-

-
Overrides:
div in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the divulo with -
Returns:
value of (this / rhs) if this is numeric
See Also:
LuaValue.div(LuaValue)
-
-
-
- -

-divInto

-
-public LuaValue divInto(double lhs)
-
-
Description copied from class: LuaValue
-
Reverse-divide: Perform numeric divide operation into another value - with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
divInto in class LuaValue
-
-
-
Parameters:
lhs - The left-hand-side value which will be divided by this -
Returns:
value of (lhs / this) if this is numeric
See Also:
LuaValue.div(LuaValue), -LuaValue.div(double), -LuaValue.div(int)
-
-
-
- -

-mod

-
-public LuaValue mod(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Modulo: Perform numeric modulo operation with another value - of unknown type, - including metatag processing. -

- Each operand must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
mod in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the modulo with -
Returns:
value of (this % rhs) if both are numeric, - or LuaValue if metatag processing occurs
See Also:
LuaValue.arithmt(LuaValue, LuaValue)
-
-
-
- -

-mod

-
-public LuaValue mod(double rhs)
-
-
Description copied from class: LuaValue
-
Modulo: Perform numeric modulo operation with another value - of double type without metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

- For metatag processing LuaValue.mod(LuaValue) must be used -

-

-
Overrides:
mod in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the modulo with -
Returns:
value of (this % rhs) if this is numeric
See Also:
LuaValue.mod(LuaValue)
-
-
-
- -

-mod

-
-public LuaValue mod(int rhs)
-
-
Description copied from class: LuaValue
-
Modulo: Perform numeric modulo operation with another value - of int type without metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

- For metatag processing LuaValue.mod(LuaValue) must be used -

-

-
Overrides:
mod in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the modulo with -
Returns:
value of (this % rhs) if this is numeric
See Also:
LuaValue.mod(LuaValue)
-
-
-
- -

-modFrom

-
-public LuaValue modFrom(double lhs)
-
-
Description copied from class: LuaValue
-
Reverse-modulo: Perform numeric modulo operation from another value - with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
modFrom in class LuaValue
-
-
-
Parameters:
lhs - The left-hand-side value which will be modulo'ed by this -
Returns:
value of (lhs % this) if this is numeric
See Also:
LuaValue.mod(LuaValue), -LuaValue.mod(double), -LuaValue.mod(int)
-
-
-
- -

-ddiv

-
-public static LuaValue ddiv(double lhs,
-                            double rhs)
-
-
Divide two double numbers according to lua math, and return a LuaValue result. -

-

-
Parameters:
lhs - Left-hand-side of the division.
rhs - Right-hand-side of the division. -
Returns:
LuaValue for the result of the division, - taking into account positive and negiative infinity, and Nan
See Also:
ddiv_d(double, double)
-
-
-
- -

-ddiv_d

-
-public static double ddiv_d(double lhs,
-                            double rhs)
-
-
Divide two double numbers according to lua math, and return a double result. -

-

-
Parameters:
lhs - Left-hand-side of the division.
rhs - Right-hand-side of the division. -
Returns:
Value of the division, taking into account positive and negative infinity, and Nan
See Also:
ddiv(double, double)
-
-
-
- -

-dmod

-
-public static LuaValue dmod(double lhs,
-                            double rhs)
-
-
Take modulo double numbers according to lua math, and return a LuaValue result. -

-

-
Parameters:
lhs - Left-hand-side of the modulo.
rhs - Right-hand-side of the modulo. -
Returns:
LuaValue for the result of the modulo, - using lua's rules for modulo
See Also:
dmod_d(double, double)
-
-
-
- -

-dmod_d

-
-public static double dmod_d(double lhs,
-                            double rhs)
-
-
Take modulo for double numbers according to lua math, and return a double result. -

-

-
Parameters:
lhs - Left-hand-side of the modulo.
rhs - Right-hand-side of the modulo. -
Returns:
double value for the result of the modulo, - using lua's rules for modulo
See Also:
dmod(double, double)
-
-
-
- -

-lt

-
-public LuaValue lt(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Less than: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Overrides:
lt in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this < rhs), FALSE if not, - or LuaValue if metatag processing occurs
See Also:
LuaValue.gteq_b(LuaValue), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-lt

-
-public LuaValue lt(double rhs)
-
-
Description copied from class: LuaValue
-
Less than: Perform numeric comparison with another value - of double type, - including metatag processing, and returning LuaValue. -

- To be comparable, this must derive from LuaNumber. -

-

-
Overrides:
lt in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this < rhs), FALSE if not, - or LuaValue if metatag processing occurs
See Also:
LuaValue.gteq_b(double), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-lt

-
-public LuaValue lt(int rhs)
-
-
Description copied from class: LuaValue
-
Less than: Perform numeric comparison with another value - of int type, - including metatag processing, and returning LuaValue. -

- To be comparable, this must derive from LuaNumber. -

-

-
Overrides:
lt in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this < rhs), FALSE if not, - or LuaValue if metatag processing occurs
See Also:
LuaValue.gteq_b(int), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-lt_b

-
-public boolean lt_b(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Less than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Overrides:
lt_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this < rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(LuaValue), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-lt_b

-
-public boolean lt_b(int rhs)
-
-
Description copied from class: LuaValue
-
Less than: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean. -

- To be comparable, this must derive from LuaNumber. -

-

-
Overrides:
lt_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this < rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(int), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-lt_b

-
-public boolean lt_b(double rhs)
-
-
Description copied from class: LuaValue
-
Less than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Overrides:
lt_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this < rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(LuaValue), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-lteq

-
-public LuaValue lteq(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Less than or equals: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Overrides:
lteq in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this <= rhs), FALSE if not, - or LuaValue if metatag processing occurs
See Also:
LuaValue.gteq_b(LuaValue), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-lteq

-
-public LuaValue lteq(double rhs)
-
-
Description copied from class: LuaValue
-
Less than or equals: Perform numeric comparison with another value - of double type, - including metatag processing, and returning LuaValue. -

- To be comparable, this must derive from LuaNumber. -

-

-
Overrides:
lteq in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this <= rhs), FALSE if not, - or LuaValue if metatag processing occurs
See Also:
LuaValue.gteq_b(double), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-lteq

-
-public LuaValue lteq(int rhs)
-
-
Description copied from class: LuaValue
-
Less than or equals: Perform numeric comparison with another value - of int type, - including metatag processing, and returning LuaValue. -

- To be comparable, this must derive from LuaNumber. -

-

-
Overrides:
lteq in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this <= rhs), FALSE if not, - or LuaValue if metatag processing occurs
See Also:
LuaValue.gteq_b(int), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-lteq_b

-
-public boolean lteq_b(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Less than or equals: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Overrides:
lteq_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this <= rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(LuaValue), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-lteq_b

-
-public boolean lteq_b(int rhs)
-
-
Description copied from class: LuaValue
-
Less than or equals: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean. -

- To be comparable, this must derive from LuaNumber. -

-

-
Overrides:
lteq_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this <= rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(int), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-lteq_b

-
-public boolean lteq_b(double rhs)
-
-
Description copied from class: LuaValue
-
Less than or equals: Perform numeric comparison with another value - of double type, - including metatag processing, - and returning java boolean. -

- To be comparable, this must derive from LuaNumber. -

-

-
Overrides:
lteq_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this <= rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(double), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-gt

-
-public LuaValue gt(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Greater than: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Overrides:
gt in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this > rhs), FALSE if not, - or LuaValue if metatag processing occurs
See Also:
LuaValue.gteq_b(LuaValue), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-gt

-
-public LuaValue gt(double rhs)
-
-
Description copied from class: LuaValue
-
Greater than: Perform numeric comparison with another value - of double type, - including metatag processing, and returning LuaValue. -

- To be comparable, this must derive from LuaNumber. -

-

-
Overrides:
gt in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this > rhs), FALSE if not, - or LuaValue if metatag processing occurs
See Also:
LuaValue.gteq_b(double), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-gt

-
-public LuaValue gt(int rhs)
-
-
Description copied from class: LuaValue
-
Greater than: Perform numeric comparison with another value - of int type, - including metatag processing, and returning LuaValue. -

- To be comparable, this must derive from LuaNumber. -

-

-
Overrides:
gt in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this > rhs), FALSE if not, - or LuaValue if metatag processing occurs
See Also:
LuaValue.gteq_b(int), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-gt_b

-
-public boolean gt_b(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Greater than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Overrides:
gt_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this > rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(LuaValue), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-gt_b

-
-public boolean gt_b(int rhs)
-
-
Description copied from class: LuaValue
-
Greater than: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean. -

- To be comparable, this must derive from LuaNumber. -

-

-
Overrides:
gt_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this > rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(int), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-gt_b

-
-public boolean gt_b(double rhs)
-
-
Description copied from class: LuaValue
-
Greater than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Overrides:
gt_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this > rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(LuaValue), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-gteq

-
-public LuaValue gteq(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Greater than or equals: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Overrides:
gteq in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this >= rhs), FALSE if not, - or LuaValue if metatag processing occurs
See Also:
LuaValue.gteq_b(LuaValue), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-gteq

-
-public LuaValue gteq(double rhs)
-
-
Description copied from class: LuaValue
-
Greater than or equals: Perform numeric comparison with another value - of double type, - including metatag processing, and returning LuaValue. -

- To be comparable, this must derive from LuaNumber. -

-

-
Overrides:
gteq in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this >= rhs), FALSE if not, - or LuaValue if metatag processing occurs
See Also:
LuaValue.gteq_b(double), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-gteq

-
-public LuaValue gteq(int rhs)
-
-
Description copied from class: LuaValue
-
Greater than or equals: Perform numeric comparison with another value - of int type, - including metatag processing, and returning LuaValue. -

- To be comparable, this must derive from LuaNumber. -

-

-
Overrides:
gteq in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this >= rhs), FALSE if not, - or LuaValue if metatag processing occurs
See Also:
LuaValue.gteq_b(int), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-gteq_b

-
-public boolean gteq_b(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Greater than or equals: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Overrides:
gteq_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this >= rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(LuaValue), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-gteq_b

-
-public boolean gteq_b(int rhs)
-
-
Description copied from class: LuaValue
-
Greater than or equals: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean. -

- To be comparable, this must derive from LuaNumber. -

-

-
Overrides:
gteq_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this >= rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(int), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-gteq_b

-
-public boolean gteq_b(double rhs)
-
-
Description copied from class: LuaValue
-
Greater than or equals: Perform numeric comparison with another value - of double type, - including metatag processing, - and returning java boolean. -

- To be comparable, this must derive from LuaNumber. -

-

-
Overrides:
gteq_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this >= rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(double), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-strcmp

-
-public int strcmp(LuaString rhs)
-
-
Description copied from class: LuaValue
-
Perform string comparison with another value - known to be a LuaString - using string comparison based on byte values. -

- Only strings can be compared, meaning - each operand must derive from LuaString. -

-

-
Overrides:
strcmp in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with
-
-
-
- -

-tojstring

-
-public java.lang.String tojstring()
-
-
Description copied from class: LuaValue
-
Convert to human readable String for any type. -

-

-
Overrides:
tojstring in class LuaValue
-
-
- -
Returns:
String for use by human readers based on type.
See Also:
LuaValue.tostring(), -LuaValue.optjstring(String), -LuaValue.checkjstring(), -LuaValue.isstring(), -TSTRING
-
-
-
- -

-strvalue

-
-public LuaString strvalue()
-
-
Description copied from class: LuaValue
-
Convert this value to a string if it is a LuaString or LuaNumber, - or throw a LuaError if it is not -

-

-
Overrides:
strvalue in class LuaValue
-
-
- -
Returns:
LuaString corresponding to the value if a string or number
-
-
-
- -

-optstring

-
-public LuaString optstring(LuaString defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a string or number and return as LuaString -

-

-
Overrides:
optstring in class LuaValue
-
-
-
Parameters:
defval - LuaString to return if this is nil or none -
Returns:
this converted to LuaString if a string or number, - defval if nil or none, - throws LuaError if some other type
See Also:
LuaValue.tojstring(), -LuaValue.optjstring(String), -LuaValue.checkstring(), -LuaValue.toString(), -LuaValue.TSTRING
-
-
-
- -

-tostring

-
-public LuaValue tostring()
-
-
Description copied from class: LuaValue
-
Conditionally convert to lua string without throwing errors. -

- In lua all numbers are strings, so this function will return - the LuaValue this if it is a string or number, - and NIL for all other cases. -

- This allows values to be tested for their "string-ness" without - the penalty of throwing exceptions. -

-

-
Overrides:
tostring in class LuaValue
-
-
- -
Returns:
this if it is a LuaString or LuaNumber, - otherwise NIL
See Also:
LuaValue.tonumber(), -LuaValue.tojstring(), -LuaValue.optstring(LuaString), -LuaValue.checkstring(), -LuaValue.toString()
-
-
-
- -

-optjstring

-
-public java.lang.String optjstring(java.lang.String defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a string or number and return as Java String -

-

-
Overrides:
optjstring in class LuaValue
-
-
-
Parameters:
defval - LuaString to return if this is nil or none -
Returns:
this converted to String if a string or number, - defval if nil or none, - throws LuaError if some other type
See Also:
LuaValue.tojstring(), -LuaValue.optstring(LuaString), -LuaValue.checkjstring(), -LuaValue.toString(), -LuaValue.TSTRING
-
-
-
- -

-optnumber

-
-public LuaNumber optnumber(LuaNumber defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a number or string convertible to number and return as LuaNumber -

-

-
Overrides:
optnumber in class LuaNumber
-
-
-
Parameters:
defval - LuaNumber to return if this is nil or none -
Returns:
this cast to LuaNumber if numeric, - defval if nil or none, - throws LuaError otherwise
See Also:
LuaValue.optdouble(double), -LuaValue.optlong(long), -LuaValue.optint(int), -LuaValue.checkint(), -LuaValue.toint(), -LuaValue.tonumber(), -LuaValue.isnumber(), -LuaValue.TNUMBER
-
-
-
- -

-isnumber

-
-public boolean isnumber()
-
-
Description copied from class: LuaValue
-
Check if this is a number -

-

-
Overrides:
isnumber in class LuaNumber
-
-
- -
Returns:
true if this is a number, - meaning derives from LuaNumber - or derives from LuaString and is convertible to a number, - otherwise false
See Also:
LuaValue.tonumber(), -LuaValue.checknumber(), -LuaValue.optnumber(LuaNumber), -LuaValue.TNUMBER
-
-
-
- -

-isstring

-
-public boolean isstring()
-
-
Description copied from class: LuaValue
-
Check if this is a string -

-

-
Overrides:
isstring in class LuaNumber
-
-
- -
Returns:
true if this is a string, - meaning derives from LuaString or LuaNumber, - otherwise false
See Also:
LuaValue.tostring(), -LuaValue.checkstring(), -LuaValue.optstring(LuaString), -LuaValue.TSTRING
-
-
-
- -

-tonumber

-
-public LuaValue tonumber()
-
-
Description copied from class: LuaValue
-
Conditionally convert to lua number without throwing errors. -

- In lua all numbers are strings, but not all strings are numbers. - This function will return - the LuaValue this if it is a number - or a string convertible to a number, - and NIL for all other cases. -

- This allows values to be tested for their "numeric-ness" without - the penalty of throwing exceptions, - nor the cost of converting the type and creating storage for it. -

-

-
Overrides:
tonumber in class LuaNumber
-
-
- -
Returns:
this if it is a LuaNumber - or LuaString that can be converted to a number, - otherwise LuaValue.NIL
See Also:
LuaValue.tostring(), -LuaValue.optnumber(LuaNumber), -LuaValue.checknumber(), -LuaValue.toint(), -LuaValue.todouble()
-
-
-
- -

-checkint

-
-public int checkint()
-
-
Description copied from class: LuaValue
-
Check that the value is numeric, and convert and cast value to int, or throw LuaError if not numeric -

- Values that are LuaNumber will be cast to int and may lose precision. - Values that are LuaString that can be converted to a number will be converted, - then cast to int, so may also lose precision. -

-

-
Overrides:
checkint in class LuaValue
-
-
- -
Returns:
value cast to a int if numeric
See Also:
LuaValue.checkinteger(), -LuaValue.checklong(), -LuaValue.checkdouble(), -LuaValue.optint(int), -LuaValue.TNUMBER
-
-
-
- -

-checklong

-
-public long checklong()
-
-
Description copied from class: LuaValue
-
Check that the value is numeric, and convert and cast value to long, or throw LuaError if not numeric -

- Values that are LuaNumber will be cast to long and may lose precision. - Values that are LuaString that can be converted to a number will be converted, - then cast to long, so may also lose precision. -

-

-
Overrides:
checklong in class LuaValue
-
-
- -
Returns:
value cast to a long if numeric
See Also:
LuaValue.checkint(), -LuaValue.checkinteger(), -LuaValue.checkdouble(), -LuaValue.optlong(long), -LuaValue.TNUMBER
-
-
-
- -

-checknumber

-
-public LuaNumber checknumber()
-
-
Description copied from class: LuaValue
-
Check that the value is numeric, and return as a LuaNumber if so, or throw LuaError -

- Values that are LuaString that can be converted to a number will be converted and returned. -

-

-
Overrides:
checknumber in class LuaNumber
-
-
- -
Returns:
value as a LuaNumber if numeric
See Also:
LuaValue.checkint(), -LuaValue.checkinteger(), -LuaValue.checkdouble(), -LuaValue.checklong(), -LuaValue.optnumber(LuaNumber), -LuaValue.TNUMBER
-
-
-
- -

-checkdouble

-
-public double checkdouble()
-
-
Description copied from class: LuaValue
-
Check that the value is numeric and return the value as a double, - or throw LuaError if not numeric -

- Values that are LuaNumber and values that are LuaString - that can be converted to a number will be converted to double. -

-

-
Overrides:
checkdouble in class LuaValue
-
-
- -
Returns:
value cast to a double if numeric
See Also:
LuaValue.checkint(), -LuaValue.checkinteger(), -LuaValue.checklong(), -LuaValue.optdouble(double), -LuaValue.TNUMBER
-
-
-
- -

-checkjstring

-
-public java.lang.String checkjstring()
-
-
Description copied from class: LuaValue
-
Convert this value to a Java String. -

- The string representations here will roughly match what is produced by the - C lua distribution, however hash codes have no relationship, - and there may be differences in number formatting. -

-

-
Overrides:
checkjstring in class LuaValue
-
-
- -
Returns:
String representation of the value
See Also:
LuaValue.checkstring(), -LuaValue.optjstring(String), -LuaValue.tojstring(), -LuaValue.isstring(), -LuaValue.TSTRING
-
-
-
- -

-checkstring

-
-public LuaString checkstring()
-
-
Description copied from class: LuaValue
-
Check that this is a lua string, or throw LuaError if it is not. -

- In lua all numbers are strings, so this will succeed for - anything that derives from LuaString or LuaNumber. - Numbers will be converted to LuaString. -

-

-
Overrides:
checkstring in class LuaValue
-
-
- -
Returns:
LuaString representation of the value if it is a LuaString or LuaNumber
See Also:
LuaValue.checkjstring(), -LuaValue.optstring(LuaString), -LuaValue.tostring(), -LuaValue.isstring(), -LuaValue.TSTRING
-
-
-
- -

-checkvalidkey

-
-public LuaValue checkvalidkey()
-
-
Description copied from class: LuaValue
-
Check that this is a valid key in a table index operation, or throw LuaError if not -

-

-
Overrides:
checkvalidkey in class LuaValue
-
-
- -
Returns:
this if valid as a table key
See Also:
LuaValue.isnil(), -LuaValue.isinttype()
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/LuaError.html b/luaj-2.0.3/docs/api/org/luaj/vm2/LuaError.html deleted file mode 100644 index 44c731c63..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/LuaError.html +++ /dev/null @@ -1,355 +0,0 @@ - - - - - - -LuaError (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2 -
-Class LuaError

-
-java.lang.Object
-  extended by java.lang.Throwable
-      extended by java.lang.Exception
-          extended by java.lang.RuntimeException
-              extended by org.luaj.vm2.LuaError
-
-
-
All Implemented Interfaces:
java.io.Serializable
-
-
-
-
public class LuaError
extends java.lang.RuntimeException
- - -

-RuntimeException that is thrown and caught in response to a lua error. -

- LuaError is used wherever a lua call to error() - would be used within a script. -

- Since it is an unchecked exception inheriting from RuntimeException, - Java method signatures do notdeclare this exception, althoug it can - be thrown on almost any luaj Java operation. - This is analagous to the fact that any lua script can throw a lua error at any time. -

-

- -

-

-
See Also:
Serialized Form
-
- -

- - - - - - - - - - - - - - - - - -
-Constructor Summary
LuaError(java.lang.String message) - -
-          Construct a LuaError with a specific message.
LuaError(java.lang.String message, - int level) - -
-          Construct a LuaError with a message, and level to draw line number information from.
LuaError(java.lang.Throwable cause) - -
-          Construct LuaError when a program exception occurs.
-  - - - - - - - - - - - - - - - -
-Method Summary
- java.lang.ThrowablegetCause() - -
-          Get the cause, if any.
- voidprintStackTrace() - -
-          Print the message and stack trace
- - - - - - - -
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, setStackTrace, toString
- - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Constructor Detail
- -

-LuaError

-
-public LuaError(java.lang.Throwable cause)
-
-
Construct LuaError when a program exception occurs. -

- All errors generated from lua code should throw LuaError(String) instead. -

-

-
Parameters:
cause - the Throwable that caused the error, if known.
-
-
- -

-LuaError

-
-public LuaError(java.lang.String message)
-
-
Construct a LuaError with a specific message. -

-

-
Parameters:
message - message to supply
-
-
- -

-LuaError

-
-public LuaError(java.lang.String message,
-                int level)
-
-
Construct a LuaError with a message, and level to draw line number information from. -

-

-
Parameters:
message - message to supply
level - where to supply line info from in call stack
-
- - - - - - - - -
-Method Detail
- -

-printStackTrace

-
-public void printStackTrace()
-
-
Print the message and stack trace -

-

-
Overrides:
printStackTrace in class java.lang.Throwable
-
-
-
-
-
-
- -

-getCause

-
-public java.lang.Throwable getCause()
-
-
Get the cause, if any. -

-

-
Overrides:
getCause in class java.lang.Throwable
-
-
-
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/LuaFunction.html b/luaj-2.0.3/docs/api/org/luaj/vm2/LuaFunction.html deleted file mode 100644 index 878143d4b..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/LuaFunction.html +++ /dev/null @@ -1,598 +0,0 @@ - - - - - - -LuaFunction (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2 -
-Class LuaFunction

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.LuaFunction
-
-
-
Direct Known Subclasses:
LibFunction, LuaClosure
-
-
-
-
public abstract class LuaFunction
extends LuaValue
- - -

-Base class for functions implemented in Java. -

- Direct subclass include LibFunction which is the base class for - all built-in library functions coded in Java, - and LuaClosure, which represents a lua closure - whose bytecode is interpreted when the function is invoked. -

- -

-

-
See Also:
LuaValue, -LibFunction, -LuaClosure
-
- -

- - - - - - - - - - - - - - - -
-Field Summary
-protected  LuaValueenv - -
-           
-static LuaValues_metatable - -
-          Shared static metatable for all functions and closures.
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - - - - -
-Constructor Summary
LuaFunction() - -
-           
LuaFunction(LuaValue env) - -
-           
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
- LuaValuecheckfunction() - -
-          Check that the value is a function , or throw LuaError if not
- LuaValuegetfenv() - -
-          Get the environemnt for an instance.
- LuaValuegetmetatable() - -
-          Get the metatable for this LuaValue
- booleanisfunction() - -
-          Check if this is a function
- LuaFunctionoptfunction(LuaFunction defval) - -
-          Check that optional argument is a function and return as LuaFunction
- voidsetfenv(LuaValue env) - -
-          Set the environment on an object.
- inttype() - -
-          Get the enumeration value for the type of this value.
- java.lang.Stringtypename() - -
-          Get the String name of the type of this value.
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
add, add, add, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, call, call, call, call, callmt, checkboolean, checkclosure, checkdouble, checkint, checkinteger, checkjstring, checklong, checkmetatag, checknotnil, checknumber, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalidkey, compareerror, compareerror, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, div, div, div, divInto, eq_b, eq, eqmtcall, equals, error, get, get, get, getn, gettable, gt_b, gt_b, gt_b, gt, gt, gt, gteq_b, gteq_b, gteq_b, gteq, gteq, gteq, illegal, inext, invoke, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isint, isinttype, islong, isnil, isnumber, isstring, istable, isthread, isuserdata, isuserdata, isweaknil, len, lenerror, length, listOf, listOf, load, lt_b, lt_b, lt_b, lt, lt, lt, lteq_b, lteq_b, lteq_b, lteq, lteq, lteq, metatag, method, method, method, method, method, method, mod, mod, mod, modFrom, mul, mul, mul, narg, neg, neq_b, neq, next, not, onInvoke, optboolean, optclosure, optdouble, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, or, pow, pow, pow, powWith, powWith, presize, raweq, raweq, raweq, raweq, raweq, rawget, rawget, rawget, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setmetatable, settable, strcmp, strcmp, strongkey, strongvalue, strvalue, sub, sub, sub, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, tonumber, toshort, tostring, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Field Detail
- -

-s_metatable

-
-public static LuaValue s_metatable
-
-
Shared static metatable for all functions and closures. -

-

-
-
-
- -

-env

-
-protected LuaValue env
-
-
-
-
- - - - - - - - -
-Constructor Detail
- -

-LuaFunction

-
-public LuaFunction()
-
-
-
- -

-LuaFunction

-
-public LuaFunction(LuaValue env)
-
-
- - - - - - - - -
-Method Detail
- -

-type

-
-public int type()
-
-
Description copied from class: LuaValue
-
Get the enumeration value for the type of this value. -

-

-
Specified by:
type in class LuaValue
-
-
- -
Returns:
value for this type, one of - TNIL, - TBOOLEAN, - TNUMBER, - TSTRING, - TTABLE, - TFUNCTION, - TUSERDATA, - TTHREAD
See Also:
LuaValue.typename()
-
-
-
- -

-typename

-
-public java.lang.String typename()
-
-
Description copied from class: LuaValue
-
Get the String name of the type of this value. -

-

-

-
Specified by:
typename in class LuaValue
-
-
- -
Returns:
name from type name list LuaValue.TYPE_NAMES - corresponding to the type of this value: - "nil", "boolean", "number", "string", - "table", "function", "userdata", "thread"
See Also:
LuaValue.type()
-
-
-
- -

-isfunction

-
-public boolean isfunction()
-
-
Description copied from class: LuaValue
-
Check if this is a function -

-

-
Overrides:
isfunction in class LuaValue
-
-
- -
Returns:
true if this is a function, otherwise false
See Also:
LuaValue.isclosure(), -LuaValue.checkfunction(), -#optfunciton(LuaFunction), -LuaValue.TFUNCTION
-
-
-
- -

-checkfunction

-
-public LuaValue checkfunction()
-
-
Description copied from class: LuaValue
-
Check that the value is a function , or throw LuaError if not -

- A function is considered anything whose LuaValue.type() returns TFUNCTION. - In practice it will be either a built-in Java function, typically deriving from - LuaFunction or a LuaClosure which represents lua source compiled - into lua bytecode. -

-

-
Overrides:
checkfunction in class LuaValue
-
-
- -
Returns:
this if if a lua function or closure
See Also:
LuaValue.checkclosure()
-
-
-
- -

-optfunction

-
-public LuaFunction optfunction(LuaFunction defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a function and return as LuaFunction -

- A LuaFunction may either be a Java function that implements - functionality directly in Java, - or a LuaClosure - which is a LuaFunction that executes lua bytecode. -

-

-
Overrides:
optfunction in class LuaValue
-
-
-
Parameters:
defval - LuaFunction to return if this is nil or none -
Returns:
this cast to LuaFunction if a function, - defval if nil or none, - throws LuaError otherwise
See Also:
LuaValue.checkfunction(), -LuaValue.isfunction(), -LuaValue.TFUNCTION
-
-
-
- -

-getmetatable

-
-public LuaValue getmetatable()
-
-
Description copied from class: LuaValue
-
Get the metatable for this LuaValue -

- For LuaTable and LuaUserdata instances, - the metatable returned is this instance metatable. - For all other types, the class metatable value will be returned. -

-

-
Overrides:
getmetatable in class LuaValue
-
-
- -
Returns:
metatable, or null if it there is none
See Also:
LuaBoolean.s_metatable, -LuaNumber.s_metatable, -LuaNil.s_metatable, -s_metatable, -LuaThread.s_metatable
-
-
-
- -

-getfenv

-
-public LuaValue getfenv()
-
-
Description copied from class: LuaValue
-
Get the environemnt for an instance. -

-

-
Overrides:
getfenv in class LuaValue
-
-
- -
Returns:
LuaValue currently set as the instances environent.
-
-
-
- -

-setfenv

-
-public void setfenv(LuaValue env)
-
-
Description copied from class: LuaValue
-
Set the environment on an object. -

- Typically the environment is created once per application via a platform - helper method such as JsePlatform.standardGlobals() - However, any object can serve as an environment if it contains suitable metatag - values to implement LuaValue.get(LuaValue) to provide the environment values. -

-

-
Overrides:
setfenv in class LuaValue
-
-
-
Parameters:
env - LuaValue (typically a LuaTable) containing the environment.
See Also:
JmePlatform, -JsePlatform
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/LuaInteger.html b/luaj-2.0.3/docs/api/org/luaj/vm2/LuaInteger.html deleted file mode 100644 index c2f9d5b7a..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/LuaInteger.html +++ /dev/null @@ -1,3095 +0,0 @@ - - - - - - -LuaInteger (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2 -
-Class LuaInteger

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.LuaNumber
-              extended by org.luaj.vm2.LuaInteger
-
-
-
-
public class LuaInteger
extends LuaNumber
- - -

-Extension of LuaNumber which can hold a Java int as its value. -

- These instance are not instantiated directly by clients, but indirectly - via the static functions LuaValue.valueOf(int) or LuaValue.valueOf(double) - functions. This ensures that policies regarding pooling of instances are - encapsulated. -

- There are no API's specific to LuaInteger that are useful beyond what is already - exposed in LuaValue. -

- -

-

-
See Also:
LuaValue, -LuaNumber, -LuaDouble, -LuaValue.valueOf(int), -LuaValue.valueOf(double)
-
- -

- - - - - - - - - - - -
-Field Summary
- intv - -
-          The value being held by this instance.
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaNumber
s_metatable
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
- LuaValueadd(double lhs) - -
-          Add: Perform numeric add operation with another value - of double type with metatag processing
- LuaValueadd(int lhs) - -
-          Add: Perform numeric add operation with another value - of int type with metatag processing
- LuaValueadd(LuaValue rhs) - -
-          Add: Perform numeric add operation with another value - including metatag processing.
- doublecheckdouble() - -
-          Check that the value is numeric and return the value as a double, - or throw LuaError if not numeric
- intcheckint() - -
-          Check that the value is numeric, and convert and cast value to int, or throw LuaError if not numeric
- LuaIntegercheckinteger() - -
-          Check that the value is numeric, and convert and cast value to int, or throw LuaError if not numeric
- java.lang.Stringcheckjstring() - -
-          Convert this value to a Java String.
- longchecklong() - -
-          Check that the value is numeric, and convert and cast value to long, or throw LuaError if not numeric
- LuaStringcheckstring() - -
-          Check that this is a lua string, or throw LuaError if it is not.
- LuaValuediv(double rhs) - -
-          Divide: Perform numeric divide operation by another value - of double type without metatag processing
- LuaValuediv(int rhs) - -
-          Divide: Perform numeric divide operation by another value - of int type without metatag processing
- LuaValuediv(LuaValue rhs) - -
-          Divide: Perform numeric divide operation by another value - of unknown type, - including metatag processing.
- LuaValuedivInto(double lhs) - -
-          Reverse-divide: Perform numeric divide operation into another value - with metatag processing
- booleaneq_b(LuaValue val) - -
-          Equals: Perform equality comparison with another value - including metatag processing using EQ, - and return java boolean
- LuaValueeq(LuaValue val) - -
-          Equals: Perform equality comparison with another value - including metatag processing using EQ.
- booleanequals(java.lang.Object o) - -
-           
- booleangt_b(double rhs) - -
-          Greater than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean.
- booleangt_b(int rhs) - -
-          Greater than: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean.
- booleangt_b(LuaValue rhs) - -
-          Greater than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean.
- LuaValuegt(double rhs) - -
-          Greater than: Perform numeric comparison with another value - of double type, - including metatag processing, and returning LuaValue.
- LuaValuegt(int rhs) - -
-          Greater than: Perform numeric comparison with another value - of int type, - including metatag processing, and returning LuaValue.
- LuaValuegt(LuaValue rhs) - -
-          Greater than: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue.
- booleangteq_b(double rhs) - -
-          Greater than or equals: Perform numeric comparison with another value - of double type, - including metatag processing, - and returning java boolean.
- booleangteq_b(int rhs) - -
-          Greater than or equals: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean.
- booleangteq_b(LuaValue rhs) - -
-          Greater than or equals: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean.
- LuaValuegteq(double rhs) - -
-          Greater than or equals: Perform numeric comparison with another value - of double type, - including metatag processing, and returning LuaValue.
- LuaValuegteq(int rhs) - -
-          Greater than or equals: Perform numeric comparison with another value - of int type, - including metatag processing, and returning LuaValue.
- LuaValuegteq(LuaValue rhs) - -
-          Greater than or equals: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue.
- inthashCode() - -
-           
- booleanisint() - -
-          Check if this is a number and is representable by java int - without rounding or truncation
- booleanisinttype() - -
-          Check if this is a LuaInteger
- booleanislong() - -
-          Check if this is a number and is representable by java long - without rounding or truncation
- booleanisstring() - -
-          Check if this is a string
- booleanlt_b(double rhs) - -
-          Less than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean.
- booleanlt_b(int rhs) - -
-          Less than: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean.
- booleanlt_b(LuaValue rhs) - -
-          Less than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean.
- LuaValuelt(double rhs) - -
-          Less than: Perform numeric comparison with another value - of double type, - including metatag processing, and returning LuaValue.
- LuaValuelt(int rhs) - -
-          Less than: Perform numeric comparison with another value - of int type, - including metatag processing, and returning LuaValue.
- LuaValuelt(LuaValue rhs) - -
-          Less than: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue.
- booleanlteq_b(double rhs) - -
-          Less than or equals: Perform numeric comparison with another value - of double type, - including metatag processing, - and returning java boolean.
- booleanlteq_b(int rhs) - -
-          Less than or equals: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean.
- booleanlteq_b(LuaValue rhs) - -
-          Less than or equals: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean.
- LuaValuelteq(double rhs) - -
-          Less than or equals: Perform numeric comparison with another value - of double type, - including metatag processing, and returning LuaValue.
- LuaValuelteq(int rhs) - -
-          Less than or equals: Perform numeric comparison with another value - of int type, - including metatag processing, and returning LuaValue.
- LuaValuelteq(LuaValue rhs) - -
-          Less than or equals: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue.
- LuaValuemod(double rhs) - -
-          Modulo: Perform numeric modulo operation with another value - of double type without metatag processing
- LuaValuemod(int rhs) - -
-          Modulo: Perform numeric modulo operation with another value - of int type without metatag processing
- LuaValuemod(LuaValue rhs) - -
-          Modulo: Perform numeric modulo operation with another value - of unknown type, - including metatag processing.
- LuaValuemodFrom(double lhs) - -
-          Reverse-modulo: Perform numeric modulo operation from another value - with metatag processing
- LuaValuemul(double lhs) - -
-          Multiply: Perform numeric multiply operation with another value - of double type with metatag processing
- LuaValuemul(int lhs) - -
-          Multiply: Perform numeric multiply operation with another value - of int type with metatag processing
- LuaValuemul(LuaValue rhs) - -
-          Multiply: Perform numeric multiply operation with another value - of unknown type, - including metatag processing.
- LuaValueneg() - -
-          Unary minus: return negative value (-this) as defined by lua unary minus operator
- doubleoptdouble(double defval) - -
-          Check that optional argument is a number or string convertible to number and return as double
- intoptint(int defval) - -
-          Check that optional argument is a number or string convertible to number and return as int
- LuaIntegeroptinteger(LuaInteger defval) - -
-          Check that optional argument is a number or string convertible to number and return as LuaInteger
- java.lang.Stringoptjstring(java.lang.String defval) - -
-          Check that optional argument is a string or number and return as Java String
- longoptlong(long defval) - -
-          Check that optional argument is a number or string convertible to number and return as long
- LuaStringoptstring(LuaString defval) - -
-          Check that optional argument is a string or number and return as LuaString
- LuaValuepow(double rhs) - -
-          Raise to power: Raise this value to a power - of double type with metatag processing
- LuaValuepow(int rhs) - -
-          Raise to power: Raise this value to a power - of int type with metatag processing
- LuaValuepow(LuaValue rhs) - -
-          Raise to power: Raise this value to a power - including metatag processing.
- LuaValuepowWith(double lhs) - -
-          Reverse-raise to power: Raise another value of double type to this power - with metatag processing
- LuaValuepowWith(int lhs) - -
-          Reverse-raise to power: Raise another value of double type to this power - with metatag processing
- booleanraweq(double val) - -
-          Equals: Perform direct equality comparison with a double value - without metatag processing.
- booleanraweq(int val) - -
-          Equals: Perform direct equality comparison with a int value - without metatag processing.
- booleanraweq(LuaValue val) - -
-          Equals: Perform direct equality comparison with another value - without metatag processing.
- intstrcmp(LuaString rhs) - -
-          Perform string comparison with another value - known to be a LuaString - using string comparison based on byte values.
- LuaStringstrvalue() - -
-          Convert this value to a string if it is a LuaString or LuaNumber, - or throw a LuaError if it is not
- LuaValuesub(double rhs) - -
-          Subtract: Perform numeric subtract operation with another value - of double type with metatag processing
- LuaValuesub(int rhs) - -
-          Subtract: Perform numeric subtract operation with another value - of int type with metatag processing
- LuaValuesub(LuaValue rhs) - -
-          Subtract: Perform numeric subtract operation with another value - of unknown type, - including metatag processing.
- LuaValuesubFrom(double lhs) - -
-          Reverse-subtract: Perform numeric subtract operation from an int value - with metatag processing
- LuaValuesubFrom(int lhs) - -
-          Reverse-subtract: Perform numeric subtract operation from a double value - without metatag processing
- bytetobyte() - -
-          Convert to byte if numeric, or 0 if not.
- chartochar() - -
-          Convert to char if numeric, or 0 if not.
- doubletodouble() - -
-          Convert to double if numeric, or 0 if not.
- floattofloat() - -
-          Convert to float if numeric, or 0 if not.
- inttoint() - -
-          Convert to int if numeric, or 0 if not.
- java.lang.Stringtojstring() - -
-          Convert to human readable String for any type.
- longtolong() - -
-          Convert to long if numeric, or 0 if not.
- shorttoshort() - -
-          Convert to short if numeric, or 0 if not.
- LuaValuetostring() - -
-          Conditionally convert to lua string without throwing errors.
-static LuaIntegervalueOf(int i) - -
-           
-static LuaNumbervalueOf(long l) - -
-          Return a LuaNumber that represents the value provided
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaNumber
checknumber, checknumber, concat, concat, concatTo, concatTo, getmetatable, isnumber, optnumber, tonumber, type, typename
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, call, call, call, call, callmt, checkboolean, checkclosure, checkfunction, checkmetatag, checknotnil, checktable, checkthread, checkuserdata, checkuserdata, checkvalidkey, compareerror, compareerror, comparemt, concatmt, concatTo, eqmtcall, error, get, get, get, getfenv, getn, gettable, illegal, inext, invoke, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isfunction, isnil, istable, isthread, isuserdata, isuserdata, isweaknil, len, lenerror, length, listOf, listOf, load, metatag, method, method, method, method, method, method, narg, neq_b, neq, next, not, onInvoke, optboolean, optclosure, optfunction, opttable, optthread, optuserdata, optuserdata, optvalue, or, presize, raweq, raweq, rawget, rawget, rawget, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setfenv, setmetatable, settable, strcmp, strongkey, strongvalue, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Field Detail
- -

-v

-
-public final int v
-
-
The value being held by this instance. -

-

-
-
- - - - - - - - -
-Method Detail
- -

-valueOf

-
-public static LuaInteger valueOf(int i)
-
-
-
-
-
-
- -

-valueOf

-
-public static LuaNumber valueOf(long l)
-
-
Return a LuaNumber that represents the value provided -

-

-
Parameters:
l - long value to represent. -
Returns:
LuaNumber that is eithe LuaInteger or LuaDouble representing l
See Also:
LuaValue.valueOf(int), -LuaValue.valueOf(double)
-
-
-
- -

-isint

-
-public boolean isint()
-
-
Description copied from class: LuaValue
-
Check if this is a number and is representable by java int - without rounding or truncation -

-

-
Overrides:
isint in class LuaValue
-
-
- -
Returns:
true if this is a number - meaning derives from LuaNumber - or derives from LuaString and is convertible to a number, - and can be represented by int, - otherwise false
See Also:
LuaValue.isinttype(), -LuaValue.islong(), -LuaValue.tonumber(), -LuaValue.checkint(), -LuaValue.optint(int), -LuaValue.TNUMBER
-
-
-
- -

-isinttype

-
-public boolean isinttype()
-
-
Description copied from class: LuaValue
-
Check if this is a LuaInteger -

- No attempt to convert from string will be made by this call. -

-

-
Overrides:
isinttype in class LuaValue
-
-
- -
Returns:
true if this is a LuaInteger, - otherwise false
See Also:
LuaValue.isint(), -LuaValue.isnumber(), -LuaValue.tonumber(), -LuaValue.TNUMBER
-
-
-
- -

-islong

-
-public boolean islong()
-
-
Description copied from class: LuaValue
-
Check if this is a number and is representable by java long - without rounding or truncation -

-

-
Overrides:
islong in class LuaValue
-
-
- -
Returns:
true if this is a number - meaning derives from LuaNumber - or derives from LuaString and is convertible to a number, - and can be represented by long, - otherwise false
See Also:
LuaValue.tonumber(), -LuaValue.checklong(), -LuaValue.optlong(long), -LuaValue.TNUMBER
-
-
-
- -

-tobyte

-
-public byte tobyte()
-
-
Description copied from class: LuaValue
-
Convert to byte if numeric, or 0 if not. -

-

-
Overrides:
tobyte in class LuaValue
-
-
- -
Returns:
Value cast to byte if number or string convertible to number, otherwise 0
See Also:
LuaValue.toint(), -LuaValue.todouble(), -#optbyte(byte), -LuaValue.checknumber(), -LuaValue.isnumber(), -TNUMBER
-
-
-
- -

-tochar

-
-public char tochar()
-
-
Description copied from class: LuaValue
-
Convert to char if numeric, or 0 if not. -

-

-
Overrides:
tochar in class LuaValue
-
-
- -
Returns:
Value cast to char if number or string convertible to number, otherwise 0
See Also:
LuaValue.toint(), -LuaValue.todouble(), -#optchar(char), -LuaValue.checknumber(), -LuaValue.isnumber(), -TNUMBER
-
-
-
- -

-todouble

-
-public double todouble()
-
-
Description copied from class: LuaValue
-
Convert to double if numeric, or 0 if not. -

-

-
Overrides:
todouble in class LuaValue
-
-
- -
Returns:
Value cast to double if number or string convertible to number, otherwise 0
See Also:
LuaValue.toint(), -LuaValue.tobyte(), -LuaValue.tochar(), -LuaValue.toshort(), -LuaValue.tolong(), -LuaValue.tofloat(), -LuaValue.optdouble(double), -LuaValue.checknumber(), -LuaValue.isnumber(), -TNUMBER
-
-
-
- -

-tofloat

-
-public float tofloat()
-
-
Description copied from class: LuaValue
-
Convert to float if numeric, or 0 if not. -

-

-
Overrides:
tofloat in class LuaValue
-
-
- -
Returns:
Value cast to float if number or string convertible to number, otherwise 0
See Also:
LuaValue.toint(), -LuaValue.todouble(), -#optfloat(float), -LuaValue.checknumber(), -LuaValue.isnumber(), -TNUMBER
-
-
-
- -

-toint

-
-public int toint()
-
-
Description copied from class: LuaValue
-
Convert to int if numeric, or 0 if not. -

-

-
Overrides:
toint in class LuaValue
-
-
- -
Returns:
Value cast to int if number or string convertible to number, otherwise 0
See Also:
LuaValue.tobyte(), -LuaValue.tochar(), -LuaValue.toshort(), -LuaValue.tolong(), -LuaValue.tofloat(), -LuaValue.todouble(), -LuaValue.optint(int), -LuaValue.checknumber(), -LuaValue.isnumber(), -TNUMBER
-
-
-
- -

-tolong

-
-public long tolong()
-
-
Description copied from class: LuaValue
-
Convert to long if numeric, or 0 if not. -

-

-
Overrides:
tolong in class LuaValue
-
-
- -
Returns:
Value cast to long if number or string convertible to number, otherwise 0
See Also:
LuaValue.isint(), -LuaValue.isinttype(), -LuaValue.toint(), -LuaValue.todouble(), -LuaValue.optlong(long), -LuaValue.checknumber(), -LuaValue.isnumber(), -TNUMBER
-
-
-
- -

-toshort

-
-public short toshort()
-
-
Description copied from class: LuaValue
-
Convert to short if numeric, or 0 if not. -

-

-
Overrides:
toshort in class LuaValue
-
-
- -
Returns:
Value cast to short if number or string convertible to number, otherwise 0
See Also:
LuaValue.toint(), -LuaValue.todouble(), -#optshort(short), -LuaValue.checknumber(), -LuaValue.isnumber(), -TNUMBER
-
-
-
- -

-optdouble

-
-public double optdouble(double defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a number or string convertible to number and return as double -

-

-
Overrides:
optdouble in class LuaValue
-
-
-
Parameters:
defval - double to return if this is nil or none -
Returns:
this cast to double if numeric, - defval if nil or none, - throws LuaError otherwise
See Also:
LuaValue.optint(int), -LuaValue.optinteger(LuaInteger), -LuaValue.checkdouble(), -LuaValue.todouble(), -LuaValue.tonumber(), -LuaValue.isnumber(), -LuaValue.TNUMBER
-
-
-
- -

-optint

-
-public int optint(int defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a number or string convertible to number and return as int -

-

-
Overrides:
optint in class LuaValue
-
-
-
Parameters:
defval - int to return if this is nil or none -
Returns:
this cast to int if numeric, - defval if nil or none, - throws LuaError otherwise
See Also:
LuaValue.optdouble(double), -LuaValue.optlong(long), -LuaValue.optinteger(LuaInteger), -LuaValue.checkint(), -LuaValue.toint(), -LuaValue.tonumber(), -LuaValue.isnumber(), -LuaValue.TNUMBER
-
-
-
- -

-optinteger

-
-public LuaInteger optinteger(LuaInteger defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a number or string convertible to number and return as LuaInteger -

-

-
Overrides:
optinteger in class LuaValue
-
-
-
Parameters:
defval - LuaInteger to return if this is nil or none -
Returns:
this converted and wrapped in LuaInteger if numeric, - defval if nil or none, - throws LuaError otherwise
See Also:
LuaValue.optdouble(double), -LuaValue.optint(int), -LuaValue.checkint(), -LuaValue.toint(), -LuaValue.tonumber(), -LuaValue.isnumber(), -LuaValue.TNUMBER
-
-
-
- -

-optlong

-
-public long optlong(long defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a number or string convertible to number and return as long -

-

-
Overrides:
optlong in class LuaValue
-
-
-
Parameters:
defval - long to return if this is nil or none -
Returns:
this cast to long if numeric, - defval if nil or none, - throws LuaError otherwise
See Also:
LuaValue.optdouble(double), -LuaValue.optint(int), -LuaValue.checkint(), -LuaValue.toint(), -LuaValue.tonumber(), -LuaValue.isnumber(), -LuaValue.TNUMBER
-
-
-
- -

-tojstring

-
-public java.lang.String tojstring()
-
-
Description copied from class: LuaValue
-
Convert to human readable String for any type. -

-

-
Overrides:
tojstring in class LuaValue
-
-
- -
Returns:
String for use by human readers based on type.
See Also:
LuaValue.tostring(), -LuaValue.optjstring(String), -LuaValue.checkjstring(), -LuaValue.isstring(), -TSTRING
-
-
-
- -

-strvalue

-
-public LuaString strvalue()
-
-
Description copied from class: LuaValue
-
Convert this value to a string if it is a LuaString or LuaNumber, - or throw a LuaError if it is not -

-

-
Overrides:
strvalue in class LuaValue
-
-
- -
Returns:
LuaString corresponding to the value if a string or number
-
-
-
- -

-optstring

-
-public LuaString optstring(LuaString defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a string or number and return as LuaString -

-

-
Overrides:
optstring in class LuaValue
-
-
-
Parameters:
defval - LuaString to return if this is nil or none -
Returns:
this converted to LuaString if a string or number, - defval if nil or none, - throws LuaError if some other type
See Also:
LuaValue.tojstring(), -LuaValue.optjstring(String), -LuaValue.checkstring(), -LuaValue.toString(), -LuaValue.TSTRING
-
-
-
- -

-tostring

-
-public LuaValue tostring()
-
-
Description copied from class: LuaValue
-
Conditionally convert to lua string without throwing errors. -

- In lua all numbers are strings, so this function will return - the LuaValue this if it is a string or number, - and NIL for all other cases. -

- This allows values to be tested for their "string-ness" without - the penalty of throwing exceptions. -

-

-
Overrides:
tostring in class LuaValue
-
-
- -
Returns:
this if it is a LuaString or LuaNumber, - otherwise NIL
See Also:
LuaValue.tonumber(), -LuaValue.tojstring(), -LuaValue.optstring(LuaString), -LuaValue.checkstring(), -LuaValue.toString()
-
-
-
- -

-optjstring

-
-public java.lang.String optjstring(java.lang.String defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a string or number and return as Java String -

-

-
Overrides:
optjstring in class LuaValue
-
-
-
Parameters:
defval - LuaString to return if this is nil or none -
Returns:
this converted to String if a string or number, - defval if nil or none, - throws LuaError if some other type
See Also:
LuaValue.tojstring(), -LuaValue.optstring(LuaString), -LuaValue.checkjstring(), -LuaValue.toString(), -LuaValue.TSTRING
-
-
-
- -

-checkinteger

-
-public LuaInteger checkinteger()
-
-
Description copied from class: LuaValue
-
Check that the value is numeric, and convert and cast value to int, or throw LuaError if not numeric -

- Values that are LuaNumber will be cast to int and may lose precision. - Values that are LuaString that can be converted to a number will be converted, - then cast to int, so may also lose precision. -

-

-
Overrides:
checkinteger in class LuaValue
-
-
- -
Returns:
value cast to a int and wrapped in LuaInteger if numeric
See Also:
LuaValue.checkint(), -LuaValue.checklong(), -LuaValue.checkdouble(), -LuaValue.optinteger(LuaInteger), -LuaValue.TNUMBER
-
-
-
- -

-isstring

-
-public boolean isstring()
-
-
Description copied from class: LuaValue
-
Check if this is a string -

-

-
Overrides:
isstring in class LuaNumber
-
-
- -
Returns:
true if this is a string, - meaning derives from LuaString or LuaNumber, - otherwise false
See Also:
LuaValue.tostring(), -LuaValue.checkstring(), -LuaValue.optstring(LuaString), -LuaValue.TSTRING
-
-
-
- -

-hashCode

-
-public int hashCode()
-
-
-
Overrides:
hashCode in class java.lang.Object
-
-
-
-
-
-
- -

-neg

-
-public LuaValue neg()
-
-
Description copied from class: LuaValue
-
Unary minus: return negative value (-this) as defined by lua unary minus operator -

-

-
Overrides:
neg in class LuaValue
-
-
- -
Returns:
boolean inverse as LuaBoolean if boolean or nil, - numeric inverse as if numeric, - or metatag processing result if UNM metatag is defined
-
-
-
- -

-equals

-
-public boolean equals(java.lang.Object o)
-
-
-
Overrides:
equals in class LuaValue
-
-
-
-
-
-
- -

-eq

-
-public LuaValue eq(LuaValue val)
-
-
Description copied from class: LuaValue
-
Equals: Perform equality comparison with another value - including metatag processing using EQ. -

-

-
Overrides:
eq in class LuaValue
-
-
-
Parameters:
val - The value to compare with. -
Returns:
TRUE if values are comparable and (this == rhs), - FALSE if comparable but not equal, - LuaValue if metatag processing occurs.
See Also:
LuaValue.eq_b(LuaValue), -LuaValue.raweq(LuaValue), -LuaValue.neq(LuaValue), -LuaValue.eqmtcall(LuaValue, LuaValue, LuaValue, LuaValue), -LuaValue.EQ
-
-
-
- -

-eq_b

-
-public boolean eq_b(LuaValue val)
-
-
Description copied from class: LuaValue
-
Equals: Perform equality comparison with another value - including metatag processing using EQ, - and return java boolean -

-

-
Overrides:
eq_b in class LuaValue
-
-
-
Parameters:
val - The value to compare with. -
Returns:
true if values are comparable and (this == rhs), - false if comparable but not equal, - result converted to java boolean if metatag processing occurs.
See Also:
LuaValue.eq(LuaValue), -LuaValue.raweq(LuaValue), -LuaValue.neq_b(LuaValue), -LuaValue.eqmtcall(LuaValue, LuaValue, LuaValue, LuaValue), -LuaValue.EQ
-
-
-
- -

-raweq

-
-public boolean raweq(LuaValue val)
-
-
Description copied from class: LuaValue
-
Equals: Perform direct equality comparison with another value - without metatag processing. -

-

-
Overrides:
raweq in class LuaValue
-
-
-
Parameters:
val - The value to compare with. -
Returns:
true if (this == rhs), false otherwise
See Also:
LuaValue.eq(LuaValue), -LuaValue.raweq(LuaUserdata), -LuaValue.raweq(LuaString), -LuaValue.raweq(double), -LuaValue.raweq(int), -LuaValue.EQ
-
-
-
- -

-raweq

-
-public boolean raweq(double val)
-
-
Description copied from class: LuaValue
-
Equals: Perform direct equality comparison with a double value - without metatag processing. -

-

-
Overrides:
raweq in class LuaValue
-
-
-
Parameters:
val - The double value to compare with. -
Returns:
true if this is a LuaNumber - whose value equals val, - otherwise false
-
-
-
- -

-raweq

-
-public boolean raweq(int val)
-
-
Description copied from class: LuaValue
-
Equals: Perform direct equality comparison with a int value - without metatag processing. -

-

-
Overrides:
raweq in class LuaValue
-
-
-
Parameters:
val - The double value to compare with. -
Returns:
true if this is a LuaNumber - whose value equals val, - otherwise false
-
-
-
- -

-add

-
-public LuaValue add(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Add: Perform numeric add operation with another value - including metatag processing. -

- Each operand must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
add in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the add with -
Returns:
value of (this + rhs) if both are numeric, - or LuaValue if metatag processing occurs
See Also:
LuaValue.arithmt(LuaValue, LuaValue)
-
-
-
- -

-add

-
-public LuaValue add(double lhs)
-
-
Description copied from class: LuaValue
-
Add: Perform numeric add operation with another value - of double type with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
add in class LuaValue
-
-
-
Parameters:
lhs - The right-hand-side value to perform the add with -
Returns:
value of (this + rhs) if this is numeric
See Also:
LuaValue.add(LuaValue)
-
-
-
- -

-add

-
-public LuaValue add(int lhs)
-
-
Description copied from class: LuaValue
-
Add: Perform numeric add operation with another value - of int type with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
add in class LuaValue
-
-
-
Parameters:
lhs - The right-hand-side value to perform the add with -
Returns:
value of (this + rhs) if this is numeric
See Also:
LuaValue.add(LuaValue)
-
-
-
- -

-sub

-
-public LuaValue sub(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Subtract: Perform numeric subtract operation with another value - of unknown type, - including metatag processing. -

- Each operand must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
sub in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the subtract with -
Returns:
value of (this - rhs) if both are numeric, - or LuaValue if metatag processing occurs
See Also:
LuaValue.arithmt(LuaValue, LuaValue)
-
-
-
- -

-sub

-
-public LuaValue sub(double rhs)
-
-
Description copied from class: LuaValue
-
Subtract: Perform numeric subtract operation with another value - of double type with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
sub in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the subtract with -
Returns:
value of (this - rhs) if this is numeric
See Also:
LuaValue.sub(LuaValue)
-
-
-
- -

-sub

-
-public LuaValue sub(int rhs)
-
-
Description copied from class: LuaValue
-
Subtract: Perform numeric subtract operation with another value - of int type with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
sub in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the subtract with -
Returns:
value of (this - rhs) if this is numeric
See Also:
LuaValue.sub(LuaValue)
-
-
-
- -

-subFrom

-
-public LuaValue subFrom(double lhs)
-
-
Description copied from class: LuaValue
-
Reverse-subtract: Perform numeric subtract operation from an int value - with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
subFrom in class LuaValue
-
-
-
Parameters:
lhs - The left-hand-side value from which to perform the subtraction -
Returns:
value of (lhs - this) if this is numeric
See Also:
LuaValue.sub(LuaValue), -LuaValue.sub(double), -LuaValue.sub(int)
-
-
-
- -

-subFrom

-
-public LuaValue subFrom(int lhs)
-
-
Description copied from class: LuaValue
-
Reverse-subtract: Perform numeric subtract operation from a double value - without metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

- For metatag processing LuaValue.sub(LuaValue) must be used -

-

-
Overrides:
subFrom in class LuaValue
-
-
-
Parameters:
lhs - The left-hand-side value from which to perform the subtraction -
Returns:
value of (lhs - this) if this is numeric
See Also:
LuaValue.sub(LuaValue), -LuaValue.sub(double), -LuaValue.sub(int)
-
-
-
- -

-mul

-
-public LuaValue mul(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Multiply: Perform numeric multiply operation with another value - of unknown type, - including metatag processing. -

- Each operand must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
mul in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the multiply with -
Returns:
value of (this * rhs) if both are numeric, - or LuaValue if metatag processing occurs
See Also:
LuaValue.arithmt(LuaValue, LuaValue)
-
-
-
- -

-mul

-
-public LuaValue mul(double lhs)
-
-
Description copied from class: LuaValue
-
Multiply: Perform numeric multiply operation with another value - of double type with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
mul in class LuaValue
-
-
-
Parameters:
lhs - The right-hand-side value to perform the multiply with -
Returns:
value of (this * rhs) if this is numeric
See Also:
LuaValue.mul(LuaValue)
-
-
-
- -

-mul

-
-public LuaValue mul(int lhs)
-
-
Description copied from class: LuaValue
-
Multiply: Perform numeric multiply operation with another value - of int type with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
mul in class LuaValue
-
-
-
Parameters:
lhs - The right-hand-side value to perform the multiply with -
Returns:
value of (this * rhs) if this is numeric
See Also:
LuaValue.mul(LuaValue)
-
-
-
- -

-pow

-
-public LuaValue pow(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Raise to power: Raise this value to a power - including metatag processing. -

- Each operand must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
pow in class LuaValue
-
-
-
Parameters:
rhs - The power to raise this value to -
Returns:
value of (this ^ rhs) if both are numeric, - or LuaValue if metatag processing occurs
See Also:
LuaValue.arithmt(LuaValue, LuaValue)
-
-
-
- -

-pow

-
-public LuaValue pow(double rhs)
-
-
Description copied from class: LuaValue
-
Raise to power: Raise this value to a power - of double type with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
pow in class LuaValue
-
-
-
Parameters:
rhs - The power to raise this value to -
Returns:
value of (this ^ rhs) if this is numeric
See Also:
LuaValue.pow(LuaValue)
-
-
-
- -

-pow

-
-public LuaValue pow(int rhs)
-
-
Description copied from class: LuaValue
-
Raise to power: Raise this value to a power - of int type with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
pow in class LuaValue
-
-
-
Parameters:
rhs - The power to raise this value to -
Returns:
value of (this ^ rhs) if this is numeric
See Also:
LuaValue.pow(LuaValue)
-
-
-
- -

-powWith

-
-public LuaValue powWith(double lhs)
-
-
Description copied from class: LuaValue
-
Reverse-raise to power: Raise another value of double type to this power - with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
powWith in class LuaValue
-
-
-
Parameters:
lhs - The left-hand-side value which will be raised to this power -
Returns:
value of (lhs ^ this) if this is numeric
See Also:
LuaValue.pow(LuaValue), -LuaValue.pow(double), -LuaValue.pow(int)
-
-
-
- -

-powWith

-
-public LuaValue powWith(int lhs)
-
-
Description copied from class: LuaValue
-
Reverse-raise to power: Raise another value of double type to this power - with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
powWith in class LuaValue
-
-
-
Parameters:
lhs - The left-hand-side value which will be raised to this power -
Returns:
value of (lhs ^ this) if this is numeric
See Also:
LuaValue.pow(LuaValue), -LuaValue.pow(double), -LuaValue.pow(int)
-
-
-
- -

-div

-
-public LuaValue div(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Divide: Perform numeric divide operation by another value - of unknown type, - including metatag processing. -

- Each operand must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
div in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the divulo with -
Returns:
value of (this / rhs) if both are numeric, - or LuaValue if metatag processing occurs
See Also:
LuaValue.arithmt(LuaValue, LuaValue)
-
-
-
- -

-div

-
-public LuaValue div(double rhs)
-
-
Description copied from class: LuaValue
-
Divide: Perform numeric divide operation by another value - of double type without metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

- For metatag processing LuaValue.div(LuaValue) must be used -

-

-
Overrides:
div in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the divulo with -
Returns:
value of (this / rhs) if this is numeric
See Also:
LuaValue.div(LuaValue)
-
-
-
- -

-div

-
-public LuaValue div(int rhs)
-
-
Description copied from class: LuaValue
-
Divide: Perform numeric divide operation by another value - of int type without metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

- For metatag processing LuaValue.div(LuaValue) must be used -

-

-
Overrides:
div in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the divulo with -
Returns:
value of (this / rhs) if this is numeric
See Also:
LuaValue.div(LuaValue)
-
-
-
- -

-divInto

-
-public LuaValue divInto(double lhs)
-
-
Description copied from class: LuaValue
-
Reverse-divide: Perform numeric divide operation into another value - with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
divInto in class LuaValue
-
-
-
Parameters:
lhs - The left-hand-side value which will be divided by this -
Returns:
value of (lhs / this) if this is numeric
See Also:
LuaValue.div(LuaValue), -LuaValue.div(double), -LuaValue.div(int)
-
-
-
- -

-mod

-
-public LuaValue mod(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Modulo: Perform numeric modulo operation with another value - of unknown type, - including metatag processing. -

- Each operand must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
mod in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the modulo with -
Returns:
value of (this % rhs) if both are numeric, - or LuaValue if metatag processing occurs
See Also:
LuaValue.arithmt(LuaValue, LuaValue)
-
-
-
- -

-mod

-
-public LuaValue mod(double rhs)
-
-
Description copied from class: LuaValue
-
Modulo: Perform numeric modulo operation with another value - of double type without metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

- For metatag processing LuaValue.mod(LuaValue) must be used -

-

-
Overrides:
mod in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the modulo with -
Returns:
value of (this % rhs) if this is numeric
See Also:
LuaValue.mod(LuaValue)
-
-
-
- -

-mod

-
-public LuaValue mod(int rhs)
-
-
Description copied from class: LuaValue
-
Modulo: Perform numeric modulo operation with another value - of int type without metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

- For metatag processing LuaValue.mod(LuaValue) must be used -

-

-
Overrides:
mod in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the modulo with -
Returns:
value of (this % rhs) if this is numeric
See Also:
LuaValue.mod(LuaValue)
-
-
-
- -

-modFrom

-
-public LuaValue modFrom(double lhs)
-
-
Description copied from class: LuaValue
-
Reverse-modulo: Perform numeric modulo operation from another value - with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
modFrom in class LuaValue
-
-
-
Parameters:
lhs - The left-hand-side value which will be modulo'ed by this -
Returns:
value of (lhs % this) if this is numeric
See Also:
LuaValue.mod(LuaValue), -LuaValue.mod(double), -LuaValue.mod(int)
-
-
-
- -

-lt

-
-public LuaValue lt(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Less than: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Overrides:
lt in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this < rhs), FALSE if not, - or LuaValue if metatag processing occurs
See Also:
LuaValue.gteq_b(LuaValue), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-lt

-
-public LuaValue lt(double rhs)
-
-
Description copied from class: LuaValue
-
Less than: Perform numeric comparison with another value - of double type, - including metatag processing, and returning LuaValue. -

- To be comparable, this must derive from LuaNumber. -

-

-
Overrides:
lt in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this < rhs), FALSE if not, - or LuaValue if metatag processing occurs
See Also:
LuaValue.gteq_b(double), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-lt

-
-public LuaValue lt(int rhs)
-
-
Description copied from class: LuaValue
-
Less than: Perform numeric comparison with another value - of int type, - including metatag processing, and returning LuaValue. -

- To be comparable, this must derive from LuaNumber. -

-

-
Overrides:
lt in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this < rhs), FALSE if not, - or LuaValue if metatag processing occurs
See Also:
LuaValue.gteq_b(int), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-lt_b

-
-public boolean lt_b(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Less than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Overrides:
lt_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this < rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(LuaValue), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-lt_b

-
-public boolean lt_b(int rhs)
-
-
Description copied from class: LuaValue
-
Less than: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean. -

- To be comparable, this must derive from LuaNumber. -

-

-
Overrides:
lt_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this < rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(int), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-lt_b

-
-public boolean lt_b(double rhs)
-
-
Description copied from class: LuaValue
-
Less than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Overrides:
lt_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this < rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(LuaValue), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-lteq

-
-public LuaValue lteq(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Less than or equals: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Overrides:
lteq in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this <= rhs), FALSE if not, - or LuaValue if metatag processing occurs
See Also:
LuaValue.gteq_b(LuaValue), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-lteq

-
-public LuaValue lteq(double rhs)
-
-
Description copied from class: LuaValue
-
Less than or equals: Perform numeric comparison with another value - of double type, - including metatag processing, and returning LuaValue. -

- To be comparable, this must derive from LuaNumber. -

-

-
Overrides:
lteq in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this <= rhs), FALSE if not, - or LuaValue if metatag processing occurs
See Also:
LuaValue.gteq_b(double), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-lteq

-
-public LuaValue lteq(int rhs)
-
-
Description copied from class: LuaValue
-
Less than or equals: Perform numeric comparison with another value - of int type, - including metatag processing, and returning LuaValue. -

- To be comparable, this must derive from LuaNumber. -

-

-
Overrides:
lteq in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this <= rhs), FALSE if not, - or LuaValue if metatag processing occurs
See Also:
LuaValue.gteq_b(int), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-lteq_b

-
-public boolean lteq_b(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Less than or equals: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Overrides:
lteq_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this <= rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(LuaValue), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-lteq_b

-
-public boolean lteq_b(int rhs)
-
-
Description copied from class: LuaValue
-
Less than or equals: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean. -

- To be comparable, this must derive from LuaNumber. -

-

-
Overrides:
lteq_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this <= rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(int), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-lteq_b

-
-public boolean lteq_b(double rhs)
-
-
Description copied from class: LuaValue
-
Less than or equals: Perform numeric comparison with another value - of double type, - including metatag processing, - and returning java boolean. -

- To be comparable, this must derive from LuaNumber. -

-

-
Overrides:
lteq_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this <= rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(double), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-gt

-
-public LuaValue gt(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Greater than: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Overrides:
gt in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this > rhs), FALSE if not, - or LuaValue if metatag processing occurs
See Also:
LuaValue.gteq_b(LuaValue), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-gt

-
-public LuaValue gt(double rhs)
-
-
Description copied from class: LuaValue
-
Greater than: Perform numeric comparison with another value - of double type, - including metatag processing, and returning LuaValue. -

- To be comparable, this must derive from LuaNumber. -

-

-
Overrides:
gt in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this > rhs), FALSE if not, - or LuaValue if metatag processing occurs
See Also:
LuaValue.gteq_b(double), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-gt

-
-public LuaValue gt(int rhs)
-
-
Description copied from class: LuaValue
-
Greater than: Perform numeric comparison with another value - of int type, - including metatag processing, and returning LuaValue. -

- To be comparable, this must derive from LuaNumber. -

-

-
Overrides:
gt in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this > rhs), FALSE if not, - or LuaValue if metatag processing occurs
See Also:
LuaValue.gteq_b(int), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-gt_b

-
-public boolean gt_b(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Greater than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Overrides:
gt_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this > rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(LuaValue), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-gt_b

-
-public boolean gt_b(int rhs)
-
-
Description copied from class: LuaValue
-
Greater than: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean. -

- To be comparable, this must derive from LuaNumber. -

-

-
Overrides:
gt_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this > rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(int), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-gt_b

-
-public boolean gt_b(double rhs)
-
-
Description copied from class: LuaValue
-
Greater than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Overrides:
gt_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this > rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(LuaValue), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-gteq

-
-public LuaValue gteq(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Greater than or equals: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Overrides:
gteq in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this >= rhs), FALSE if not, - or LuaValue if metatag processing occurs
See Also:
LuaValue.gteq_b(LuaValue), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-gteq

-
-public LuaValue gteq(double rhs)
-
-
Description copied from class: LuaValue
-
Greater than or equals: Perform numeric comparison with another value - of double type, - including metatag processing, and returning LuaValue. -

- To be comparable, this must derive from LuaNumber. -

-

-
Overrides:
gteq in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this >= rhs), FALSE if not, - or LuaValue if metatag processing occurs
See Also:
LuaValue.gteq_b(double), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-gteq

-
-public LuaValue gteq(int rhs)
-
-
Description copied from class: LuaValue
-
Greater than or equals: Perform numeric comparison with another value - of int type, - including metatag processing, and returning LuaValue. -

- To be comparable, this must derive from LuaNumber. -

-

-
Overrides:
gteq in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this >= rhs), FALSE if not, - or LuaValue if metatag processing occurs
See Also:
LuaValue.gteq_b(int), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-gteq_b

-
-public boolean gteq_b(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Greater than or equals: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Overrides:
gteq_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this >= rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(LuaValue), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-gteq_b

-
-public boolean gteq_b(int rhs)
-
-
Description copied from class: LuaValue
-
Greater than or equals: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean. -

- To be comparable, this must derive from LuaNumber. -

-

-
Overrides:
gteq_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this >= rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(int), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-gteq_b

-
-public boolean gteq_b(double rhs)
-
-
Description copied from class: LuaValue
-
Greater than or equals: Perform numeric comparison with another value - of double type, - including metatag processing, - and returning java boolean. -

- To be comparable, this must derive from LuaNumber. -

-

-
Overrides:
gteq_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this >= rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(double), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-strcmp

-
-public int strcmp(LuaString rhs)
-
-
Description copied from class: LuaValue
-
Perform string comparison with another value - known to be a LuaString - using string comparison based on byte values. -

- Only strings can be compared, meaning - each operand must derive from LuaString. -

-

-
Overrides:
strcmp in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with
-
-
-
- -

-checkint

-
-public int checkint()
-
-
Description copied from class: LuaValue
-
Check that the value is numeric, and convert and cast value to int, or throw LuaError if not numeric -

- Values that are LuaNumber will be cast to int and may lose precision. - Values that are LuaString that can be converted to a number will be converted, - then cast to int, so may also lose precision. -

-

-
Overrides:
checkint in class LuaValue
-
-
- -
Returns:
value cast to a int if numeric
See Also:
LuaValue.checkinteger(), -LuaValue.checklong(), -LuaValue.checkdouble(), -LuaValue.optint(int), -LuaValue.TNUMBER
-
-
-
- -

-checklong

-
-public long checklong()
-
-
Description copied from class: LuaValue
-
Check that the value is numeric, and convert and cast value to long, or throw LuaError if not numeric -

- Values that are LuaNumber will be cast to long and may lose precision. - Values that are LuaString that can be converted to a number will be converted, - then cast to long, so may also lose precision. -

-

-
Overrides:
checklong in class LuaValue
-
-
- -
Returns:
value cast to a long if numeric
See Also:
LuaValue.checkint(), -LuaValue.checkinteger(), -LuaValue.checkdouble(), -LuaValue.optlong(long), -LuaValue.TNUMBER
-
-
-
- -

-checkdouble

-
-public double checkdouble()
-
-
Description copied from class: LuaValue
-
Check that the value is numeric and return the value as a double, - or throw LuaError if not numeric -

- Values that are LuaNumber and values that are LuaString - that can be converted to a number will be converted to double. -

-

-
Overrides:
checkdouble in class LuaValue
-
-
- -
Returns:
value cast to a double if numeric
See Also:
LuaValue.checkint(), -LuaValue.checkinteger(), -LuaValue.checklong(), -LuaValue.optdouble(double), -LuaValue.TNUMBER
-
-
-
- -

-checkjstring

-
-public java.lang.String checkjstring()
-
-
Description copied from class: LuaValue
-
Convert this value to a Java String. -

- The string representations here will roughly match what is produced by the - C lua distribution, however hash codes have no relationship, - and there may be differences in number formatting. -

-

-
Overrides:
checkjstring in class LuaValue
-
-
- -
Returns:
String representation of the value
See Also:
LuaValue.checkstring(), -LuaValue.optjstring(String), -LuaValue.tojstring(), -LuaValue.isstring(), -LuaValue.TSTRING
-
-
-
- -

-checkstring

-
-public LuaString checkstring()
-
-
Description copied from class: LuaValue
-
Check that this is a lua string, or throw LuaError if it is not. -

- In lua all numbers are strings, so this will succeed for - anything that derives from LuaString or LuaNumber. - Numbers will be converted to LuaString. -

-

-
Overrides:
checkstring in class LuaValue
-
-
- -
Returns:
LuaString representation of the value if it is a LuaString or LuaNumber
See Also:
LuaValue.checkjstring(), -LuaValue.optstring(LuaString), -LuaValue.tostring(), -LuaValue.isstring(), -LuaValue.TSTRING
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/LuaNil.html b/luaj-2.0.3/docs/api/org/luaj/vm2/LuaNil.html deleted file mode 100644 index 1c045ac67..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/LuaNil.html +++ /dev/null @@ -1,1063 +0,0 @@ - - - - - - -LuaNil (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2 -
-Class LuaNil

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.LuaNil
-
-
-
-
public class LuaNil
extends LuaValue
- - -

-Class to encapsulate behavior of the singleton instance nil -

- There will be one instance of this class, LuaValue.NIL, - per Java virtual machine. - However, the Varargs instance LuaValue.NONE - which is the empty list, - is also considered treated as a nil value by default. -

- Although it is possible to test for nil using Java == operator, - the recommended approach is to use the method LuaValue.isnil() - instead. By using that any ambiguities between - LuaValue.NIL and LuaValue.NONE are avoided. -

- -

-

-
See Also:
LuaValue, -LuaValue.NIL
-
- -

- - - - - - - - - - - -
-Field Summary
-static LuaValues_metatable - -
-           
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
- LuaValuechecknotnil() - -
-          Check that this is not the value NIL, or throw LuaError if it is
- LuaValuecheckvalidkey() - -
-          Check that this is a valid key in a table index operation, or throw LuaError if not
- booleanequals(java.lang.Object o) - -
-           
- LuaValuegetmetatable() - -
-          Get the metatable for this LuaValue
- booleanisnil() - -
-          Check if this is nil
- LuaValuenot() - -
-          Unary not: return inverse boolean value (~this) as defined by lua not operator
- booleanoptboolean(boolean defval) - -
-          Check that optional argument is a boolean and return its boolean value
- LuaClosureoptclosure(LuaClosure defval) - -
-          Check that optional argument is a closure and return as LuaClosure
- doubleoptdouble(double defval) - -
-          Check that optional argument is a number or string convertible to number and return as double
- LuaFunctionoptfunction(LuaFunction defval) - -
-          Check that optional argument is a function and return as LuaFunction
- intoptint(int defval) - -
-          Check that optional argument is a number or string convertible to number and return as int
- LuaIntegeroptinteger(LuaInteger defval) - -
-          Check that optional argument is a number or string convertible to number and return as LuaInteger
- java.lang.Stringoptjstring(java.lang.String defval) - -
-          Check that optional argument is a string or number and return as Java String
- longoptlong(long defval) - -
-          Check that optional argument is a number or string convertible to number and return as long
- LuaNumberoptnumber(LuaNumber defval) - -
-          Check that optional argument is a number or string convertible to number and return as LuaNumber
- LuaStringoptstring(LuaString defval) - -
-          Check that optional argument is a string or number and return as LuaString
- LuaTableopttable(LuaTable defval) - -
-          Check that optional argument is a table and return as LuaTable
- LuaThreadoptthread(LuaThread defval) - -
-          Check that optional argument is a thread and return as LuaThread
- java.lang.Objectoptuserdata(java.lang.Class c, - java.lang.Object defval) - -
-          Check that optional argument is a userdata whose instance is of a type - and return the Object instance
- java.lang.Objectoptuserdata(java.lang.Object defval) - -
-          Check that optional argument is a userdata and return the Object instance
- LuaValueoptvalue(LuaValue defval) - -
-          Perform argument check that this is not nil or none.
- booleantoboolean() - -
-          Convert to boolean false if LuaValue.NIL or FALSE, true if anything else
- java.lang.Stringtojstring() - -
-          Convert to human readable String for any type.
- inttype() - -
-          Get the enumeration value for the type of this value.
- java.lang.Stringtypename() - -
-          Get the String name of the type of this value.
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
add, add, add, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, call, call, call, call, callmt, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checkmetatag, checknumber, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, compareerror, compareerror, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, div, div, div, divInto, eq_b, eq, eqmtcall, error, get, get, get, getfenv, getn, gettable, gt_b, gt_b, gt_b, gt, gt, gt, gteq_b, gteq_b, gteq_b, gteq, gteq, gteq, illegal, inext, invoke, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isfunction, isint, isinttype, islong, isnumber, isstring, istable, isthread, isuserdata, isuserdata, isweaknil, len, lenerror, length, listOf, listOf, load, lt_b, lt_b, lt_b, lt, lt, lt, lteq_b, lteq_b, lteq_b, lteq, lteq, lteq, metatag, method, method, method, method, method, method, mod, mod, mod, modFrom, mul, mul, mul, narg, neg, neq_b, neq, next, onInvoke, or, pow, pow, pow, powWith, powWith, presize, raweq, raweq, raweq, raweq, raweq, rawget, rawget, rawget, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setfenv, setmetatable, settable, strcmp, strcmp, strongkey, strongvalue, strvalue, sub, sub, sub, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, tobyte, tochar, todouble, tofloat, toint, tolong, tonumber, toshort, tostring, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Field Detail
- -

-s_metatable

-
-public static LuaValue s_metatable
-
-
-
-
- - - - - - - - -
-Method Detail
- -

-type

-
-public int type()
-
-
Description copied from class: LuaValue
-
Get the enumeration value for the type of this value. -

-

-
Specified by:
type in class LuaValue
-
-
- -
Returns:
value for this type, one of - TNIL, - TBOOLEAN, - TNUMBER, - TSTRING, - TTABLE, - TFUNCTION, - TUSERDATA, - TTHREAD
See Also:
LuaValue.typename()
-
-
-
- -

-typename

-
-public java.lang.String typename()
-
-
Description copied from class: LuaValue
-
Get the String name of the type of this value. -

-

-

-
Specified by:
typename in class LuaValue
-
-
- -
Returns:
name from type name list LuaValue.TYPE_NAMES - corresponding to the type of this value: - "nil", "boolean", "number", "string", - "table", "function", "userdata", "thread"
See Also:
LuaValue.type()
-
-
-
- -

-tojstring

-
-public java.lang.String tojstring()
-
-
Description copied from class: LuaValue
-
Convert to human readable String for any type. -

-

-
Overrides:
tojstring in class LuaValue
-
-
- -
Returns:
String for use by human readers based on type.
See Also:
LuaValue.tostring(), -LuaValue.optjstring(String), -LuaValue.checkjstring(), -LuaValue.isstring(), -TSTRING
-
-
-
- -

-not

-
-public LuaValue not()
-
-
Description copied from class: LuaValue
-
Unary not: return inverse boolean value (~this) as defined by lua not operator -

-

-
Overrides:
not in class LuaValue
-
-
- -
Returns:
TRUE if NIL or FALSE, otherwise FALSE
-
-
-
- -

-toboolean

-
-public boolean toboolean()
-
-
Description copied from class: LuaValue
-
Convert to boolean false if LuaValue.NIL or FALSE, true if anything else -

-

-
Overrides:
toboolean in class LuaValue
-
-
- -
Returns:
Value cast to byte if number or string convertible to number, otherwise 0
See Also:
LuaValue.optboolean(boolean), -LuaValue.checkboolean(), -LuaValue.isboolean(), -TBOOLEAN
-
-
-
- -

-isnil

-
-public boolean isnil()
-
-
Description copied from class: LuaValue
-
Check if this is nil -

-

-
Overrides:
isnil in class LuaValue
-
-
- -
Returns:
true if this is nil, otherwise false
See Also:
LuaValue.NIL, -LuaValue.NONE, -LuaValue.checknotnil(), -LuaValue.optvalue(LuaValue), -Varargs.isnoneornil(int), -LuaValue.TNIL, -LuaValue.TNONE
-
-
-
- -

-getmetatable

-
-public LuaValue getmetatable()
-
-
Description copied from class: LuaValue
-
Get the metatable for this LuaValue -

- For LuaTable and LuaUserdata instances, - the metatable returned is this instance metatable. - For all other types, the class metatable value will be returned. -

-

-
Overrides:
getmetatable in class LuaValue
-
-
- -
Returns:
metatable, or null if it there is none
See Also:
LuaBoolean.s_metatable, -LuaNumber.s_metatable, -s_metatable, -LuaFunction.s_metatable, -LuaThread.s_metatable
-
-
-
- -

-equals

-
-public boolean equals(java.lang.Object o)
-
-
-
Overrides:
equals in class LuaValue
-
-
-
-
-
-
- -

-checknotnil

-
-public LuaValue checknotnil()
-
-
Description copied from class: LuaValue
-
Check that this is not the value NIL, or throw LuaError if it is -

-

-
Overrides:
checknotnil in class LuaValue
-
-
- -
Returns:
this if it is not NIL
See Also:
LuaValue.optvalue(LuaValue)
-
-
-
- -

-checkvalidkey

-
-public LuaValue checkvalidkey()
-
-
Description copied from class: LuaValue
-
Check that this is a valid key in a table index operation, or throw LuaError if not -

-

-
Overrides:
checkvalidkey in class LuaValue
-
-
- -
Returns:
this if valid as a table key
See Also:
LuaValue.isnil(), -LuaValue.isinttype()
-
-
-
- -

-optboolean

-
-public boolean optboolean(boolean defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a boolean and return its boolean value -

-

-
Overrides:
optboolean in class LuaValue
-
-
-
Parameters:
defval - boolean value to return if this is nil or none -
Returns:
this cast to boolean if a , - defval if nil or none, - throws LuaError otherwise
See Also:
LuaValue.checkboolean(), -LuaValue.isboolean(), -LuaValue.TBOOLEAN
-
-
-
- -

-optclosure

-
-public LuaClosure optclosure(LuaClosure defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a closure and return as LuaClosure -

- A LuaClosure is a that executes lua byteccode. -

-

-
Overrides:
optclosure in class LuaValue
-
-
-
Parameters:
defval - LuaClosure to return if this is nil or none -
Returns:
this cast to LuaClosure if a function, - defval if nil or none, - throws LuaError otherwise
See Also:
LuaValue.checkclosure(), -LuaValue.isclosure(), -LuaValue.TFUNCTION
-
-
-
- -

-optdouble

-
-public double optdouble(double defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a number or string convertible to number and return as double -

-

-
Overrides:
optdouble in class LuaValue
-
-
-
Parameters:
defval - double to return if this is nil or none -
Returns:
this cast to double if numeric, - defval if nil or none, - throws LuaError otherwise
See Also:
LuaValue.optint(int), -LuaValue.optinteger(LuaInteger), -LuaValue.checkdouble(), -LuaValue.todouble(), -LuaValue.tonumber(), -LuaValue.isnumber(), -LuaValue.TNUMBER
-
-
-
- -

-optfunction

-
-public LuaFunction optfunction(LuaFunction defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a function and return as LuaFunction -

- A LuaFunction may either be a Java function that implements - functionality directly in Java, - or a LuaClosure - which is a LuaFunction that executes lua bytecode. -

-

-
Overrides:
optfunction in class LuaValue
-
-
-
Parameters:
defval - LuaFunction to return if this is nil or none -
Returns:
this cast to LuaFunction if a function, - defval if nil or none, - throws LuaError otherwise
See Also:
LuaValue.checkfunction(), -LuaValue.isfunction(), -LuaValue.TFUNCTION
-
-
-
- -

-optint

-
-public int optint(int defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a number or string convertible to number and return as int -

-

-
Overrides:
optint in class LuaValue
-
-
-
Parameters:
defval - int to return if this is nil or none -
Returns:
this cast to int if numeric, - defval if nil or none, - throws LuaError otherwise
See Also:
LuaValue.optdouble(double), -LuaValue.optlong(long), -LuaValue.optinteger(LuaInteger), -LuaValue.checkint(), -LuaValue.toint(), -LuaValue.tonumber(), -LuaValue.isnumber(), -LuaValue.TNUMBER
-
-
-
- -

-optinteger

-
-public LuaInteger optinteger(LuaInteger defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a number or string convertible to number and return as LuaInteger -

-

-
Overrides:
optinteger in class LuaValue
-
-
-
Parameters:
defval - LuaInteger to return if this is nil or none -
Returns:
this converted and wrapped in LuaInteger if numeric, - defval if nil or none, - throws LuaError otherwise
See Also:
LuaValue.optdouble(double), -LuaValue.optint(int), -LuaValue.checkint(), -LuaValue.toint(), -LuaValue.tonumber(), -LuaValue.isnumber(), -LuaValue.TNUMBER
-
-
-
- -

-optlong

-
-public long optlong(long defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a number or string convertible to number and return as long -

-

-
Overrides:
optlong in class LuaValue
-
-
-
Parameters:
defval - long to return if this is nil or none -
Returns:
this cast to long if numeric, - defval if nil or none, - throws LuaError otherwise
See Also:
LuaValue.optdouble(double), -LuaValue.optint(int), -LuaValue.checkint(), -LuaValue.toint(), -LuaValue.tonumber(), -LuaValue.isnumber(), -LuaValue.TNUMBER
-
-
-
- -

-optnumber

-
-public LuaNumber optnumber(LuaNumber defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a number or string convertible to number and return as LuaNumber -

-

-
Overrides:
optnumber in class LuaValue
-
-
-
Parameters:
defval - LuaNumber to return if this is nil or none -
Returns:
this cast to LuaNumber if numeric, - defval if nil or none, - throws LuaError otherwise
See Also:
LuaValue.optdouble(double), -LuaValue.optlong(long), -LuaValue.optint(int), -LuaValue.checkint(), -LuaValue.toint(), -LuaValue.tonumber(), -LuaValue.isnumber(), -LuaValue.TNUMBER
-
-
-
- -

-opttable

-
-public LuaTable opttable(LuaTable defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a table and return as LuaTable -

-

-
Overrides:
opttable in class LuaValue
-
-
-
Parameters:
defval - LuaTable to return if this is nil or none -
Returns:
this cast to LuaTable if a table, - defval if nil or none, - throws LuaError if some other type
See Also:
LuaValue.checktable(), -LuaValue.istable(), -LuaValue.TTABLE
-
-
-
- -

-optthread

-
-public LuaThread optthread(LuaThread defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a thread and return as LuaThread -

-

-
Overrides:
optthread in class LuaValue
-
-
-
Parameters:
defval - LuaThread to return if this is nil or none -
Returns:
this cast to LuaTable if a thread, - defval if nil or none, - throws LuaError if some other type
See Also:
LuaValue.checkthread(), -LuaValue.isthread(), -LuaValue.TTHREAD
-
-
-
- -

-optjstring

-
-public java.lang.String optjstring(java.lang.String defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a string or number and return as Java String -

-

-
Overrides:
optjstring in class LuaValue
-
-
-
Parameters:
defval - LuaString to return if this is nil or none -
Returns:
this converted to String if a string or number, - defval if nil or none, - throws LuaError if some other type
See Also:
LuaValue.tojstring(), -LuaValue.optstring(LuaString), -LuaValue.checkjstring(), -LuaValue.toString(), -LuaValue.TSTRING
-
-
-
- -

-optstring

-
-public LuaString optstring(LuaString defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a string or number and return as LuaString -

-

-
Overrides:
optstring in class LuaValue
-
-
-
Parameters:
defval - LuaString to return if this is nil or none -
Returns:
this converted to LuaString if a string or number, - defval if nil or none, - throws LuaError if some other type
See Also:
LuaValue.tojstring(), -LuaValue.optjstring(String), -LuaValue.checkstring(), -LuaValue.toString(), -LuaValue.TSTRING
-
-
-
- -

-optuserdata

-
-public java.lang.Object optuserdata(java.lang.Object defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a userdata and return the Object instance -

-

-
Overrides:
optuserdata in class LuaValue
-
-
-
Parameters:
defval - Object to return if this is nil or none -
Returns:
Object instance of the userdata if a LuaUserdata, - defval if nil or none, - throws LuaError if some other type
See Also:
LuaValue.checkuserdata(), -LuaValue.isuserdata(), -LuaValue.optuserdata(Class, Object), -LuaValue.TUSERDATA
-
-
-
- -

-optuserdata

-
-public java.lang.Object optuserdata(java.lang.Class c,
-                                    java.lang.Object defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a userdata whose instance is of a type - and return the Object instance -

-

-
Overrides:
optuserdata in class LuaValue
-
-
-
Parameters:
c - Class to test userdata instance against
defval - Object to return if this is nil or none -
Returns:
Object instance of the userdata if a LuaUserdata and instance is assignable to c, - defval if nil or none, - throws LuaError if some other type
See Also:
LuaValue.checkuserdata(Class), -LuaValue.isuserdata(Class), -LuaValue.optuserdata(Object), -LuaValue.TUSERDATA
-
-
-
- -

-optvalue

-
-public LuaValue optvalue(LuaValue defval)
-
-
Description copied from class: LuaValue
-
Perform argument check that this is not nil or none. -

-

-
Overrides:
optvalue in class LuaValue
-
-
-
Parameters:
defval - LuaValue to return if this is nil or none -
Returns:
this if not nil or none, else defval
See Also:
LuaValue.NIL, -LuaValue.NONE, -LuaValue.isnil(), -Varargs.isnoneornil(int), -LuaValue.TNIL, -LuaValue.TNONE
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/LuaNumber.html b/luaj-2.0.3/docs/api/org/luaj/vm2/LuaNumber.html deleted file mode 100644 index 9f2e5f34b..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/LuaNumber.html +++ /dev/null @@ -1,747 +0,0 @@ - - - - - - -LuaNumber (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2 -
-Class LuaNumber

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.LuaNumber
-
-
-
Direct Known Subclasses:
LuaDouble, LuaInteger
-
-
-
-
public abstract class LuaNumber
extends LuaValue
- - -

-Base class for representing numbers as lua values directly. -

- The main subclasses are LuaInteger which holds values that fit in a java int, - and LuaDouble which holds all other number values. -

- -

-

-
See Also:
LuaInteger, -LuaDouble, -LuaValue
-
- -

- - - - - - - - - - - -
-Field Summary
-static LuaValues_metatable - -
-          Shared static metatable for all number values represented in lua.
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - -
-Constructor Summary
LuaNumber() - -
-           
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
- LuaNumberchecknumber() - -
-          Check that the value is numeric, and return as a LuaNumber if so, or throw LuaError
- LuaNumberchecknumber(java.lang.String errmsg) - -
-          Check that the value is numeric, and return as a LuaNumber if so, or throw LuaError
- Bufferconcat(Buffer rhs) - -
-          Concatenate a Buffer onto this value and return the result - using rules of lua string concatenation including metatag processing.
- LuaValueconcat(LuaValue rhs) - -
-          Concatenate another value onto this value and return the result - using rules of lua string concatenation including metatag processing.
- LuaValueconcatTo(LuaNumber lhs) - -
-          Reverse-concatenation: concatenate this value onto another value - known to be a LuaNumber - and return the result using rules of lua string concatenation including - metatag processing.
- LuaValueconcatTo(LuaString lhs) - -
-          Reverse-concatenation: concatenate this value onto another value - known to be a LuaString - and return the result using rules of lua string concatenation including - metatag processing.
- LuaValuegetmetatable() - -
-          Get the metatable for this LuaValue
- booleanisnumber() - -
-          Check if this is a number
- booleanisstring() - -
-          Check if this is a string
- LuaNumberoptnumber(LuaNumber defval) - -
-          Check that optional argument is a number or string convertible to number and return as LuaNumber
- LuaValuetonumber() - -
-          Conditionally convert to lua number without throwing errors.
- inttype() - -
-          Get the enumeration value for the type of this value.
- java.lang.Stringtypename() - -
-          Get the String name of the type of this value.
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
add, add, add, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, call, call, call, call, callmt, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checkmetatag, checknotnil, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalidkey, compareerror, compareerror, comparemt, concatmt, concatTo, div, div, div, divInto, eq_b, eq, eqmtcall, equals, error, get, get, get, getfenv, getn, gettable, gt_b, gt_b, gt_b, gt, gt, gt, gteq_b, gteq_b, gteq_b, gteq, gteq, gteq, illegal, inext, invoke, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isfunction, isint, isinttype, islong, isnil, istable, isthread, isuserdata, isuserdata, isweaknil, len, lenerror, length, listOf, listOf, load, lt_b, lt_b, lt_b, lt, lt, lt, lteq_b, lteq_b, lteq_b, lteq, lteq, lteq, metatag, method, method, method, method, method, method, mod, mod, mod, modFrom, mul, mul, mul, narg, neg, neq_b, neq, next, not, onInvoke, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, or, pow, pow, pow, powWith, powWith, presize, raweq, raweq, raweq, raweq, raweq, rawget, rawget, rawget, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setfenv, setmetatable, settable, strcmp, strcmp, strongkey, strongvalue, strvalue, sub, sub, sub, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, tostring, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Field Detail
- -

-s_metatable

-
-public static LuaValue s_metatable
-
-
Shared static metatable for all number values represented in lua. -

-

-
-
- - - - - - - - -
-Constructor Detail
- -

-LuaNumber

-
-public LuaNumber()
-
-
- - - - - - - - -
-Method Detail
- -

-type

-
-public int type()
-
-
Description copied from class: LuaValue
-
Get the enumeration value for the type of this value. -

-

-
Specified by:
type in class LuaValue
-
-
- -
Returns:
value for this type, one of - TNIL, - TBOOLEAN, - TNUMBER, - TSTRING, - TTABLE, - TFUNCTION, - TUSERDATA, - TTHREAD
See Also:
LuaValue.typename()
-
-
-
- -

-typename

-
-public java.lang.String typename()
-
-
Description copied from class: LuaValue
-
Get the String name of the type of this value. -

-

-

-
Specified by:
typename in class LuaValue
-
-
- -
Returns:
name from type name list LuaValue.TYPE_NAMES - corresponding to the type of this value: - "nil", "boolean", "number", "string", - "table", "function", "userdata", "thread"
See Also:
LuaValue.type()
-
-
-
- -

-checknumber

-
-public LuaNumber checknumber()
-
-
Description copied from class: LuaValue
-
Check that the value is numeric, and return as a LuaNumber if so, or throw LuaError -

- Values that are LuaString that can be converted to a number will be converted and returned. -

-

-
Overrides:
checknumber in class LuaValue
-
-
- -
Returns:
value as a LuaNumber if numeric
See Also:
LuaValue.checkint(), -LuaValue.checkinteger(), -LuaValue.checkdouble(), -LuaValue.checklong(), -LuaValue.optnumber(LuaNumber), -LuaValue.TNUMBER
-
-
-
- -

-checknumber

-
-public LuaNumber checknumber(java.lang.String errmsg)
-
-
Description copied from class: LuaValue
-
Check that the value is numeric, and return as a LuaNumber if so, or throw LuaError -

- Values that are LuaString that can be converted to a number will be converted and returned. -

-

-
Overrides:
checknumber in class LuaValue
-
-
-
Parameters:
errmsg - String message to supply if conversion fails -
Returns:
value as a LuaNumber if numeric
See Also:
LuaValue.checkint(), -LuaValue.checkinteger(), -LuaValue.checkdouble(), -LuaValue.checklong(), -LuaValue.optnumber(LuaNumber), -LuaValue.TNUMBER
-
-
-
- -

-optnumber

-
-public LuaNumber optnumber(LuaNumber defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a number or string convertible to number and return as LuaNumber -

-

-
Overrides:
optnumber in class LuaValue
-
-
-
Parameters:
defval - LuaNumber to return if this is nil or none -
Returns:
this cast to LuaNumber if numeric, - defval if nil or none, - throws LuaError otherwise
See Also:
LuaValue.optdouble(double), -LuaValue.optlong(long), -LuaValue.optint(int), -LuaValue.checkint(), -LuaValue.toint(), -LuaValue.tonumber(), -LuaValue.isnumber(), -LuaValue.TNUMBER
-
-
-
- -

-tonumber

-
-public LuaValue tonumber()
-
-
Description copied from class: LuaValue
-
Conditionally convert to lua number without throwing errors. -

- In lua all numbers are strings, but not all strings are numbers. - This function will return - the LuaValue this if it is a number - or a string convertible to a number, - and NIL for all other cases. -

- This allows values to be tested for their "numeric-ness" without - the penalty of throwing exceptions, - nor the cost of converting the type and creating storage for it. -

-

-
Overrides:
tonumber in class LuaValue
-
-
- -
Returns:
this if it is a LuaNumber - or LuaString that can be converted to a number, - otherwise LuaValue.NIL
See Also:
LuaValue.tostring(), -LuaValue.optnumber(LuaNumber), -LuaValue.checknumber(), -LuaValue.toint(), -LuaValue.todouble()
-
-
-
- -

-isnumber

-
-public boolean isnumber()
-
-
Description copied from class: LuaValue
-
Check if this is a number -

-

-
Overrides:
isnumber in class LuaValue
-
-
- -
Returns:
true if this is a number, - meaning derives from LuaNumber - or derives from LuaString and is convertible to a number, - otherwise false
See Also:
LuaValue.tonumber(), -LuaValue.checknumber(), -LuaValue.optnumber(LuaNumber), -LuaValue.TNUMBER
-
-
-
- -

-isstring

-
-public boolean isstring()
-
-
Description copied from class: LuaValue
-
Check if this is a string -

-

-
Overrides:
isstring in class LuaValue
-
-
- -
Returns:
true if this is a string, - meaning derives from LuaString or LuaNumber, - otherwise false
See Also:
LuaValue.tostring(), -LuaValue.checkstring(), -LuaValue.optstring(LuaString), -LuaValue.TSTRING
-
-
-
- -

-getmetatable

-
-public LuaValue getmetatable()
-
-
Description copied from class: LuaValue
-
Get the metatable for this LuaValue -

- For LuaTable and LuaUserdata instances, - the metatable returned is this instance metatable. - For all other types, the class metatable value will be returned. -

-

-
Overrides:
getmetatable in class LuaValue
-
-
- -
Returns:
metatable, or null if it there is none
See Also:
LuaBoolean.s_metatable, -s_metatable, -LuaNil.s_metatable, -LuaFunction.s_metatable, -LuaThread.s_metatable
-
-
-
- -

-concat

-
-public LuaValue concat(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Concatenate another value onto this value and return the result - using rules of lua string concatenation including metatag processing. -

- Only strings and numbers as represented can be concatenated, meaning - each operand must derive from LuaString or LuaNumber. -

-

-
Overrides:
concat in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the operation with
-
-
-
- -

-concat

-
-public Buffer concat(Buffer rhs)
-
-
Description copied from class: LuaValue
-
Concatenate a Buffer onto this value and return the result - using rules of lua string concatenation including metatag processing. -

- Only strings and numbers as represented can be concatenated, meaning - each operand must derive from LuaString or LuaNumber. -

-

-
Overrides:
concat in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side Buffer to perform the operation with -
Returns:
LuaString resulting from concatenation of (this .. rhs)
-
-
-
- -

-concatTo

-
-public LuaValue concatTo(LuaNumber lhs)
-
-
Description copied from class: LuaValue
-
Reverse-concatenation: concatenate this value onto another value - known to be a LuaNumber - and return the result using rules of lua string concatenation including - metatag processing. -

- Only strings and numbers as represented can be concatenated, meaning - each operand must derive from LuaString or LuaNumber. -

-

-
Overrides:
concatTo in class LuaValue
-
-
-
Parameters:
lhs - The left-hand-side value onto which this will be concatenated
See Also:
LuaValue.concat(LuaValue)
-
-
-
- -

-concatTo

-
-public LuaValue concatTo(LuaString lhs)
-
-
Description copied from class: LuaValue
-
Reverse-concatenation: concatenate this value onto another value - known to be a LuaString - and return the result using rules of lua string concatenation including - metatag processing. -

- Only strings and numbers as represented can be concatenated, meaning - each operand must derive from LuaString or LuaNumber. -

-

-
Overrides:
concatTo in class LuaValue
-
-
-
Parameters:
lhs - The left-hand-side value onto which this will be concatenated
See Also:
LuaValue.concat(LuaValue)
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/LuaString.html b/luaj-2.0.3/docs/api/org/luaj/vm2/LuaString.html deleted file mode 100644 index 3bf0a1a7c..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/LuaString.html +++ /dev/null @@ -1,3786 +0,0 @@ - - - - - - -LuaString (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2 -
-Class LuaString

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.LuaString
-
-
-
-
public class LuaString
extends LuaValue
- - -

-Subclass of LuaValue for representing lua strings. -

- Because lua string values are more nearly sequences of bytes than - sequences of characters or unicode code points, the LuaString - implementation holds the string value in an internal byte array. -

- LuaString values are generally not mutable once constructed, - so multiple LuaString values can chare a single byte array. -

- Currently LuaStrings are pooled via a centrally managed weak table. - To ensure that as many string values as possible take advantage of this, - Constructors are not exposed directly. As with number, booleans, and nil, - instance construction should be via LuaValue.valueOf(byte[]) or similar API. -

- When Java Strings are used to initialize LuaString data, the UTF8 encoding is assumed. - The functions - LuaString#lengthAsUtf8(char[]), - {@link LuaString#encodeToUtf8(char[], byte[], int)}, and - {@link LuaString#decodeAsUtf8(byte[], int, int) - are used to convert back and forth between UTF8 byte arrays and character arrays. -

- -

-

-
See Also:
LuaValue, -LuaValue.valueOf(String), -LuaValue.valueOf(byte[])
-
- -

- - - - - - - - - - - - - - - - - - - - - - - -
-Field Summary
- byte[]m_bytes - -
-          The bytes for the string
- intm_length - -
-          The number of bytes that comprise this string
- intm_offset - -
-          The offset into the byte array, 0 means start at the first byte
-static LuaValues_metatable - -
-          The singleton instance representing lua true
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
- LuaValueadd(double rhs) - -
-          Add: Perform numeric add operation with another value - of double type with metatag processing
- LuaValueadd(int rhs) - -
-          Add: Perform numeric add operation with another value - of int type with metatag processing
- LuaValueadd(LuaValue rhs) - -
-          Add: Perform numeric add operation with another value - including metatag processing.
- intcharAt(int index) - -
-           
- doublecheckdouble() - -
-          Check that the value is numeric and return the value as a double, - or throw LuaError if not numeric
- intcheckint() - -
-          Check that the value is numeric, and convert and cast value to int, or throw LuaError if not numeric
- LuaIntegercheckinteger() - -
-          Check that the value is numeric, and convert and cast value to int, or throw LuaError if not numeric
- java.lang.Stringcheckjstring() - -
-          Convert this value to a Java String.
- longchecklong() - -
-          Check that the value is numeric, and convert and cast value to long, or throw LuaError if not numeric
- LuaNumberchecknumber() - -
-          Check that the value is numeric, and return as a LuaNumber if so, or throw LuaError
- LuaNumberchecknumber(java.lang.String msg) - -
-          Check that the value is numeric, and return as a LuaNumber if so, or throw LuaError
- LuaStringcheckstring() - -
-          Check that this is a lua string, or throw LuaError if it is not.
- Bufferconcat(Buffer rhs) - -
-          Concatenate a Buffer onto this value and return the result - using rules of lua string concatenation including metatag processing.
- LuaValueconcat(LuaValue rhs) - -
-          Concatenate another value onto this value and return the result - using rules of lua string concatenation including metatag processing.
- LuaValueconcatTo(LuaNumber lhs) - -
-          Reverse-concatenation: concatenate this value onto another value - known to be a LuaNumber - and return the result using rules of lua string concatenation including - metatag processing.
- LuaValueconcatTo(LuaString lhs) - -
-          Reverse-concatenation: concatenate this value onto another value - known to be a LuaString - and return the result using rules of lua string concatenation including - metatag processing.
- voidcopyInto(int strOffset, - byte[] bytes, - int arrayOffset, - int len) - -
-          Copy the bytes of the string into the given byte array.
-static java.lang.StringdecodeAsUtf8(byte[] bytes, - int offset, - int length) - -
-          Convert to Java String interpreting as utf8 characters.
- LuaValuediv(double rhs) - -
-          Divide: Perform numeric divide operation by another value - of double type without metatag processing
- LuaValuediv(int rhs) - -
-          Divide: Perform numeric divide operation by another value - of int type without metatag processing
- LuaValuediv(LuaValue rhs) - -
-          Divide: Perform numeric divide operation by another value - of unknown type, - including metatag processing.
- LuaValuedivInto(double lhs) - -
-          Reverse-divide: Perform numeric divide operation into another value - with metatag processing
-static voidencodeToUtf8(char[] chars, - byte[] bytes, - int off) - -
-          Encode the given Java string as UTF-8 bytes, writing the result to bytes - starting at offset.
- booleaneq_b(LuaValue val) - -
-          Equals: Perform equality comparison with another value - including metatag processing using EQ, - and return java boolean
- LuaValueeq(LuaValue val) - -
-          Equals: Perform equality comparison with another value - including metatag processing using EQ.
-static booleanequals(byte[] a, - int i, - byte[] b, - int j, - int n) - -
-           
-static booleanequals(LuaString a, - int i, - LuaString b, - int j, - int n) - -
-           
- booleanequals(java.lang.Object o) - -
-           
- LuaValueget(LuaValue key) - -
-          Get a value in a table including metatag processing using INDEX.
- LuaValuegetmetatable() - -
-          Get the metatable for this LuaValue
- booleangt_b(double rhs) - -
-          Greater than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean.
- booleangt_b(int rhs) - -
-          Greater than: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean.
- booleangt_b(LuaValue rhs) - -
-          Greater than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean.
- LuaValuegt(LuaValue rhs) - -
-          Greater than: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue.
- booleangteq_b(double rhs) - -
-          Greater than or equals: Perform numeric comparison with another value - of double type, - including metatag processing, - and returning java boolean.
- booleangteq_b(int rhs) - -
-          Greater than or equals: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean.
- booleangteq_b(LuaValue rhs) - -
-          Greater than or equals: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean.
- LuaValuegteq(LuaValue rhs) - -
-          Greater than or equals: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue.
- inthashCode() - -
-           
- intindexOf(byte b, - int start) - -
-          Find the index of a byte starting at a point in this string
- intindexOf(LuaString s, - int start) - -
-          Find the index of a string starting at a point in this string
- intindexOfAny(LuaString accept) - -
-          Java version of strpbrk - find index of any byte that in an accept string.
- booleanisint() - -
-          Check if this is a number and is representable by java int - without rounding or truncation
- booleanislong() - -
-          Check if this is a number and is representable by java long - without rounding or truncation
- booleanisnumber() - -
-          Check if this is a number
- booleanisstring() - -
-          Check if this is a string
- booleanisValidUtf8() - -
-          Check that a byte sequence is valid UTF-8
- intlastIndexOf(LuaString s) - -
-          Find the last index of a string in this string
- LuaValuelen() - -
-          Length operator: return lua length of object (#this) including metatag processing as java int
- intlength() - -
-          Length operator: return lua length of object (#this) including metatag processing as java int
-static intlengthAsUtf8(char[] chars) - -
-          Count the number of bytes required to encode the string as UTF-8.
- booleanlt_b(double rhs) - -
-          Less than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean.
- booleanlt_b(int rhs) - -
-          Less than: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean.
- booleanlt_b(LuaValue rhs) - -
-          Less than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean.
- LuaValuelt(LuaValue rhs) - -
-          Less than: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue.
- booleanlteq_b(double rhs) - -
-          Less than or equals: Perform numeric comparison with another value - of double type, - including metatag processing, - and returning java boolean.
- booleanlteq_b(int rhs) - -
-          Less than or equals: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean.
- booleanlteq_b(LuaValue rhs) - -
-          Less than or equals: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean.
- LuaValuelteq(LuaValue rhs) - -
-          Less than or equals: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue.
- intluaByte(int index) - -
-           
- LuaValuemod(double rhs) - -
-          Modulo: Perform numeric modulo operation with another value - of double type without metatag processing
- LuaValuemod(int rhs) - -
-          Modulo: Perform numeric modulo operation with another value - of int type without metatag processing
- LuaValuemod(LuaValue rhs) - -
-          Modulo: Perform numeric modulo operation with another value - of unknown type, - including metatag processing.
- LuaValuemodFrom(double lhs) - -
-          Reverse-modulo: Perform numeric modulo operation from another value - with metatag processing
- LuaValuemul(double rhs) - -
-          Multiply: Perform numeric multiply operation with another value - of double type with metatag processing
- LuaValuemul(int rhs) - -
-          Multiply: Perform numeric multiply operation with another value - of int type with metatag processing
- LuaValuemul(LuaValue rhs) - -
-          Multiply: Perform numeric multiply operation with another value - of unknown type, - including metatag processing.
- LuaValueneg() - -
-          Unary minus: return negative value (-this) as defined by lua unary minus operator
- doubleoptdouble(double defval) - -
-          Check that optional argument is a number or string convertible to number and return as double
- intoptint(int defval) - -
-          Check that optional argument is a number or string convertible to number and return as int
- LuaIntegeroptinteger(LuaInteger defval) - -
-          Check that optional argument is a number or string convertible to number and return as LuaInteger
- java.lang.Stringoptjstring(java.lang.String defval) - -
-          Check that optional argument is a string or number and return as Java String
- longoptlong(long defval) - -
-          Check that optional argument is a number or string convertible to number and return as long
- LuaNumberoptnumber(LuaNumber defval) - -
-          Check that optional argument is a number or string convertible to number and return as LuaNumber
- LuaStringoptstring(LuaString defval) - -
-          Check that optional argument is a string or number and return as LuaString
- LuaValuepow(double rhs) - -
-          Raise to power: Raise this value to a power - of double type with metatag processing
- LuaValuepow(int rhs) - -
-          Raise to power: Raise this value to a power - of int type with metatag processing
- LuaValuepow(LuaValue rhs) - -
-          Raise to power: Raise this value to a power - including metatag processing.
- LuaValuepowWith(double lhs) - -
-          Reverse-raise to power: Raise another value of double type to this power - with metatag processing
- LuaValuepowWith(int lhs) - -
-          Reverse-raise to power: Raise another value of double type to this power - with metatag processing
- booleanraweq(LuaString s) - -
-          Equals: Perform direct equality comparison with a LuaString value - without metatag processing.
- booleanraweq(LuaValue val) - -
-          Equals: Perform direct equality comparison with another value - without metatag processing.
- doublescannumber(int base) - -
-          Convert to a number in a base, or return Double.NaN if not a number.
- intstrcmp(LuaString rhs) - -
-          Perform string comparison with another value - known to be a LuaString - using string comparison based on byte values.
- intstrcmp(LuaValue lhs) - -
-          Perform string comparison with another value - of any type - using string comparison based on byte values.
- LuaStringstrvalue() - -
-          Convert this value to a string if it is a LuaString or LuaNumber, - or throw a LuaError if it is not
- LuaValuesub(double rhs) - -
-          Subtract: Perform numeric subtract operation with another value - of double type with metatag processing
- LuaValuesub(int rhs) - -
-          Subtract: Perform numeric subtract operation with another value - of int type with metatag processing
- LuaValuesub(LuaValue rhs) - -
-          Subtract: Perform numeric subtract operation with another value - of unknown type, - including metatag processing.
- LuaValuesubFrom(double lhs) - -
-          Reverse-subtract: Perform numeric subtract operation from an int value - with metatag processing
- LuaStringsubstring(int beginIndex, - int endIndex) - -
-           
- bytetobyte() - -
-          Convert to byte if numeric, or 0 if not.
- chartochar() - -
-          Convert to char if numeric, or 0 if not.
- doubletodouble() - -
-          Convert to double if numeric, or 0 if not.
- floattofloat() - -
-          Convert to float if numeric, or 0 if not.
- java.io.InputStreamtoInputStream() - -
-          Convert value to an input stream.
- inttoint() - -
-          Convert to int if numeric, or 0 if not.
- java.lang.Stringtojstring() - -
-          Convert to human readable String for any type.
- longtolong() - -
-          Convert to long if numeric, or 0 if not.
- LuaValuetonumber() - -
-          Conditionally convert to lua number without throwing errors.
- LuaValuetonumber(int base) - -
-          convert to a number using a supplied base, or NIL if it can't be converted
- shorttoshort() - -
-          Convert to short if numeric, or 0 if not.
- LuaValuetostring() - -
-          Conditionally convert to lua string without throwing errors.
- inttype() - -
-          Get the enumeration value for the type of this value.
- java.lang.Stringtypename() - -
-          Get the String name of the type of this value.
-static LuaStringvalueOf(byte[] bytes) - -
-          Construct a LuaString around a byte array without copying the contents.
-static LuaStringvalueOf(byte[] bytes, - int off, - int len) - -
-          Construct a LuaString around a byte array without copying the contents.
-static LuaStringvalueOf(char[] bytes) - -
-          Construct a LuaString using the supplied characters as byte values.
-static LuaStringvalueOf(java.lang.String string) - -
-          Get a LuaString instance whose bytes match - the supplied Java String using the UTF8 encoding.
- voidwrite(java.io.DataOutputStream writer, - int i, - int len) - -
-           
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, call, call, call, call, callmt, checkboolean, checkclosure, checkfunction, checkmetatag, checknotnil, checktable, checkthread, checkuserdata, checkuserdata, checkvalidkey, compareerror, compareerror, comparemt, concatmt, concatTo, eqmtcall, error, get, get, getfenv, getn, gettable, gt, gt, gteq, gteq, illegal, inext, invoke, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isfunction, isinttype, isnil, istable, isthread, isuserdata, isuserdata, isweaknil, lenerror, listOf, listOf, load, lt, lt, lteq, lteq, metatag, method, method, method, method, method, method, narg, neq_b, neq, next, not, onInvoke, optboolean, optclosure, optfunction, opttable, optthread, optuserdata, optuserdata, optvalue, or, presize, raweq, raweq, raweq, rawget, rawget, rawget, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setfenv, setmetatable, settable, strongkey, strongvalue, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Field Detail
- -

-s_metatable

-
-public static LuaValue s_metatable
-
-
The singleton instance representing lua true -

-

-
-
-
- -

-m_bytes

-
-public final byte[] m_bytes
-
-
The bytes for the string -

-

-
-
-
- -

-m_offset

-
-public final int m_offset
-
-
The offset into the byte array, 0 means start at the first byte -

-

-
-
-
- -

-m_length

-
-public final int m_length
-
-
The number of bytes that comprise this string -

-

-
-
- - - - - - - - -
-Method Detail
- -

-valueOf

-
-public static LuaString valueOf(java.lang.String string)
-
-
Get a LuaString instance whose bytes match - the supplied Java String using the UTF8 encoding. -

-

-
Parameters:
string - Java String containing characters to encode as UTF8 -
Returns:
LuaString with UTF8 bytes corresponding to the supplied String
-
-
-
- -

-valueOf

-
-public static LuaString valueOf(byte[] bytes,
-                                int off,
-                                int len)
-
-
Construct a LuaString around a byte array without copying the contents. -

- The array is used directly after this is called, so clients must not change contents. -

-

-

-
Parameters:
bytes - byte buffer
off - offset into the byte buffer
len - length of the byte buffer -
Returns:
LuaString wrapping the byte buffer
-
-
-
- -

-valueOf

-
-public static LuaString valueOf(char[] bytes)
-
-
Construct a LuaString using the supplied characters as byte values. -

- Only th elow-order 8-bits of each character are used, the remainder is ignored. -

- This is most useful for constructing byte sequences that do not conform to UTF8. -

-

-
Parameters:
bytes - array of char, whose values are truncated at 8-bits each and put into a byte array. -
Returns:
LuaString wrapping a copy of the byte buffer
-
-
-
- -

-valueOf

-
-public static LuaString valueOf(byte[] bytes)
-
-
Construct a LuaString around a byte array without copying the contents. -

- The array is used directly after this is called, so clients must not change contents. -

-

-

-
Parameters:
bytes - byte buffer -
Returns:
LuaString wrapping the byte buffer
-
-
-
- -

-isstring

-
-public boolean isstring()
-
-
Description copied from class: LuaValue
-
Check if this is a string -

-

-
Overrides:
isstring in class LuaValue
-
-
- -
Returns:
true if this is a string, - meaning derives from LuaString or LuaNumber, - otherwise false
See Also:
LuaValue.tostring(), -LuaValue.checkstring(), -LuaValue.optstring(LuaString), -LuaValue.TSTRING
-
-
-
- -

-getmetatable

-
-public LuaValue getmetatable()
-
-
Description copied from class: LuaValue
-
Get the metatable for this LuaValue -

- For LuaTable and LuaUserdata instances, - the metatable returned is this instance metatable. - For all other types, the class metatable value will be returned. -

-

-
Overrides:
getmetatable in class LuaValue
-
-
- -
Returns:
metatable, or null if it there is none
See Also:
LuaBoolean.s_metatable, -LuaNumber.s_metatable, -LuaNil.s_metatable, -LuaFunction.s_metatable, -LuaThread.s_metatable
-
-
-
- -

-type

-
-public int type()
-
-
Description copied from class: LuaValue
-
Get the enumeration value for the type of this value. -

-

-
Specified by:
type in class LuaValue
-
-
- -
Returns:
value for this type, one of - TNIL, - TBOOLEAN, - TNUMBER, - TSTRING, - TTABLE, - TFUNCTION, - TUSERDATA, - TTHREAD
See Also:
LuaValue.typename()
-
-
-
- -

-typename

-
-public java.lang.String typename()
-
-
Description copied from class: LuaValue
-
Get the String name of the type of this value. -

-

-

-
Specified by:
typename in class LuaValue
-
-
- -
Returns:
name from type name list LuaValue.TYPE_NAMES - corresponding to the type of this value: - "nil", "boolean", "number", "string", - "table", "function", "userdata", "thread"
See Also:
LuaValue.type()
-
-
-
- -

-tojstring

-
-public java.lang.String tojstring()
-
-
Description copied from class: LuaValue
-
Convert to human readable String for any type. -

-

-
Overrides:
tojstring in class LuaValue
-
-
- -
Returns:
String for use by human readers based on type.
See Also:
LuaValue.tostring(), -LuaValue.optjstring(String), -LuaValue.checkjstring(), -LuaValue.isstring(), -TSTRING
-
-
-
- -

-get

-
-public LuaValue get(LuaValue key)
-
-
Description copied from class: LuaValue
-
Get a value in a table including metatag processing using INDEX. -

-

-
Overrides:
get in class LuaValue
-
-
-
Parameters:
key - the key to look up, must not be NIL or null -
Returns:
LuaValue for that key, or NIL if not found and no metatag
See Also:
LuaValue.get(int), -LuaValue.get(String), -LuaValue.rawget(LuaValue)
-
-
-
- -

-neg

-
-public LuaValue neg()
-
-
Description copied from class: LuaValue
-
Unary minus: return negative value (-this) as defined by lua unary minus operator -

-

-
Overrides:
neg in class LuaValue
-
-
- -
Returns:
boolean inverse as LuaBoolean if boolean or nil, - numeric inverse as if numeric, - or metatag processing result if UNM metatag is defined
-
-
-
- -

-add

-
-public LuaValue add(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Add: Perform numeric add operation with another value - including metatag processing. -

- Each operand must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
add in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the add with -
Returns:
value of (this + rhs) if both are numeric, - or LuaValue if metatag processing occurs
See Also:
LuaValue.arithmt(LuaValue, LuaValue)
-
-
-
- -

-add

-
-public LuaValue add(double rhs)
-
-
Description copied from class: LuaValue
-
Add: Perform numeric add operation with another value - of double type with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
add in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the add with -
Returns:
value of (this + rhs) if this is numeric
See Also:
LuaValue.add(LuaValue)
-
-
-
- -

-add

-
-public LuaValue add(int rhs)
-
-
Description copied from class: LuaValue
-
Add: Perform numeric add operation with another value - of int type with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
add in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the add with -
Returns:
value of (this + rhs) if this is numeric
See Also:
LuaValue.add(LuaValue)
-
-
-
- -

-sub

-
-public LuaValue sub(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Subtract: Perform numeric subtract operation with another value - of unknown type, - including metatag processing. -

- Each operand must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
sub in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the subtract with -
Returns:
value of (this - rhs) if both are numeric, - or LuaValue if metatag processing occurs
See Also:
LuaValue.arithmt(LuaValue, LuaValue)
-
-
-
- -

-sub

-
-public LuaValue sub(double rhs)
-
-
Description copied from class: LuaValue
-
Subtract: Perform numeric subtract operation with another value - of double type with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
sub in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the subtract with -
Returns:
value of (this - rhs) if this is numeric
See Also:
LuaValue.sub(LuaValue)
-
-
-
- -

-sub

-
-public LuaValue sub(int rhs)
-
-
Description copied from class: LuaValue
-
Subtract: Perform numeric subtract operation with another value - of int type with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
sub in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the subtract with -
Returns:
value of (this - rhs) if this is numeric
See Also:
LuaValue.sub(LuaValue)
-
-
-
- -

-subFrom

-
-public LuaValue subFrom(double lhs)
-
-
Description copied from class: LuaValue
-
Reverse-subtract: Perform numeric subtract operation from an int value - with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
subFrom in class LuaValue
-
-
-
Parameters:
lhs - The left-hand-side value from which to perform the subtraction -
Returns:
value of (lhs - this) if this is numeric
See Also:
LuaValue.sub(LuaValue), -LuaValue.sub(double), -LuaValue.sub(int)
-
-
-
- -

-mul

-
-public LuaValue mul(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Multiply: Perform numeric multiply operation with another value - of unknown type, - including metatag processing. -

- Each operand must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
mul in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the multiply with -
Returns:
value of (this * rhs) if both are numeric, - or LuaValue if metatag processing occurs
See Also:
LuaValue.arithmt(LuaValue, LuaValue)
-
-
-
- -

-mul

-
-public LuaValue mul(double rhs)
-
-
Description copied from class: LuaValue
-
Multiply: Perform numeric multiply operation with another value - of double type with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
mul in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the multiply with -
Returns:
value of (this * rhs) if this is numeric
See Also:
LuaValue.mul(LuaValue)
-
-
-
- -

-mul

-
-public LuaValue mul(int rhs)
-
-
Description copied from class: LuaValue
-
Multiply: Perform numeric multiply operation with another value - of int type with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
mul in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the multiply with -
Returns:
value of (this * rhs) if this is numeric
See Also:
LuaValue.mul(LuaValue)
-
-
-
- -

-pow

-
-public LuaValue pow(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Raise to power: Raise this value to a power - including metatag processing. -

- Each operand must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
pow in class LuaValue
-
-
-
Parameters:
rhs - The power to raise this value to -
Returns:
value of (this ^ rhs) if both are numeric, - or LuaValue if metatag processing occurs
See Also:
LuaValue.arithmt(LuaValue, LuaValue)
-
-
-
- -

-pow

-
-public LuaValue pow(double rhs)
-
-
Description copied from class: LuaValue
-
Raise to power: Raise this value to a power - of double type with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
pow in class LuaValue
-
-
-
Parameters:
rhs - The power to raise this value to -
Returns:
value of (this ^ rhs) if this is numeric
See Also:
LuaValue.pow(LuaValue)
-
-
-
- -

-pow

-
-public LuaValue pow(int rhs)
-
-
Description copied from class: LuaValue
-
Raise to power: Raise this value to a power - of int type with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
pow in class LuaValue
-
-
-
Parameters:
rhs - The power to raise this value to -
Returns:
value of (this ^ rhs) if this is numeric
See Also:
LuaValue.pow(LuaValue)
-
-
-
- -

-powWith

-
-public LuaValue powWith(double lhs)
-
-
Description copied from class: LuaValue
-
Reverse-raise to power: Raise another value of double type to this power - with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
powWith in class LuaValue
-
-
-
Parameters:
lhs - The left-hand-side value which will be raised to this power -
Returns:
value of (lhs ^ this) if this is numeric
See Also:
LuaValue.pow(LuaValue), -LuaValue.pow(double), -LuaValue.pow(int)
-
-
-
- -

-powWith

-
-public LuaValue powWith(int lhs)
-
-
Description copied from class: LuaValue
-
Reverse-raise to power: Raise another value of double type to this power - with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
powWith in class LuaValue
-
-
-
Parameters:
lhs - The left-hand-side value which will be raised to this power -
Returns:
value of (lhs ^ this) if this is numeric
See Also:
LuaValue.pow(LuaValue), -LuaValue.pow(double), -LuaValue.pow(int)
-
-
-
- -

-div

-
-public LuaValue div(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Divide: Perform numeric divide operation by another value - of unknown type, - including metatag processing. -

- Each operand must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
div in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the divulo with -
Returns:
value of (this / rhs) if both are numeric, - or LuaValue if metatag processing occurs
See Also:
LuaValue.arithmt(LuaValue, LuaValue)
-
-
-
- -

-div

-
-public LuaValue div(double rhs)
-
-
Description copied from class: LuaValue
-
Divide: Perform numeric divide operation by another value - of double type without metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

- For metatag processing LuaValue.div(LuaValue) must be used -

-

-
Overrides:
div in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the divulo with -
Returns:
value of (this / rhs) if this is numeric
See Also:
LuaValue.div(LuaValue)
-
-
-
- -

-div

-
-public LuaValue div(int rhs)
-
-
Description copied from class: LuaValue
-
Divide: Perform numeric divide operation by another value - of int type without metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

- For metatag processing LuaValue.div(LuaValue) must be used -

-

-
Overrides:
div in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the divulo with -
Returns:
value of (this / rhs) if this is numeric
See Also:
LuaValue.div(LuaValue)
-
-
-
- -

-divInto

-
-public LuaValue divInto(double lhs)
-
-
Description copied from class: LuaValue
-
Reverse-divide: Perform numeric divide operation into another value - with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
divInto in class LuaValue
-
-
-
Parameters:
lhs - The left-hand-side value which will be divided by this -
Returns:
value of (lhs / this) if this is numeric
See Also:
LuaValue.div(LuaValue), -LuaValue.div(double), -LuaValue.div(int)
-
-
-
- -

-mod

-
-public LuaValue mod(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Modulo: Perform numeric modulo operation with another value - of unknown type, - including metatag processing. -

- Each operand must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
mod in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the modulo with -
Returns:
value of (this % rhs) if both are numeric, - or LuaValue if metatag processing occurs
See Also:
LuaValue.arithmt(LuaValue, LuaValue)
-
-
-
- -

-mod

-
-public LuaValue mod(double rhs)
-
-
Description copied from class: LuaValue
-
Modulo: Perform numeric modulo operation with another value - of double type without metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

- For metatag processing LuaValue.mod(LuaValue) must be used -

-

-
Overrides:
mod in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the modulo with -
Returns:
value of (this % rhs) if this is numeric
See Also:
LuaValue.mod(LuaValue)
-
-
-
- -

-mod

-
-public LuaValue mod(int rhs)
-
-
Description copied from class: LuaValue
-
Modulo: Perform numeric modulo operation with another value - of int type without metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

- For metatag processing LuaValue.mod(LuaValue) must be used -

-

-
Overrides:
mod in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the modulo with -
Returns:
value of (this % rhs) if this is numeric
See Also:
LuaValue.mod(LuaValue)
-
-
-
- -

-modFrom

-
-public LuaValue modFrom(double lhs)
-
-
Description copied from class: LuaValue
-
Reverse-modulo: Perform numeric modulo operation from another value - with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Overrides:
modFrom in class LuaValue
-
-
-
Parameters:
lhs - The left-hand-side value which will be modulo'ed by this -
Returns:
value of (lhs % this) if this is numeric
See Also:
LuaValue.mod(LuaValue), -LuaValue.mod(double), -LuaValue.mod(int)
-
-
-
- -

-lt

-
-public LuaValue lt(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Less than: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Overrides:
lt in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this < rhs), FALSE if not, - or LuaValue if metatag processing occurs
See Also:
LuaValue.gteq_b(LuaValue), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-lt_b

-
-public boolean lt_b(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Less than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Overrides:
lt_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this < rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(LuaValue), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-lt_b

-
-public boolean lt_b(int rhs)
-
-
Description copied from class: LuaValue
-
Less than: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean. -

- To be comparable, this must derive from LuaNumber. -

-

-
Overrides:
lt_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this < rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(int), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-lt_b

-
-public boolean lt_b(double rhs)
-
-
Description copied from class: LuaValue
-
Less than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Overrides:
lt_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this < rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(LuaValue), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-lteq

-
-public LuaValue lteq(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Less than or equals: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Overrides:
lteq in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this <= rhs), FALSE if not, - or LuaValue if metatag processing occurs
See Also:
LuaValue.gteq_b(LuaValue), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-lteq_b

-
-public boolean lteq_b(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Less than or equals: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Overrides:
lteq_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this <= rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(LuaValue), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-lteq_b

-
-public boolean lteq_b(int rhs)
-
-
Description copied from class: LuaValue
-
Less than or equals: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean. -

- To be comparable, this must derive from LuaNumber. -

-

-
Overrides:
lteq_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this <= rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(int), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-lteq_b

-
-public boolean lteq_b(double rhs)
-
-
Description copied from class: LuaValue
-
Less than or equals: Perform numeric comparison with another value - of double type, - including metatag processing, - and returning java boolean. -

- To be comparable, this must derive from LuaNumber. -

-

-
Overrides:
lteq_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this <= rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(double), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-gt

-
-public LuaValue gt(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Greater than: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Overrides:
gt in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this > rhs), FALSE if not, - or LuaValue if metatag processing occurs
See Also:
LuaValue.gteq_b(LuaValue), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-gt_b

-
-public boolean gt_b(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Greater than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Overrides:
gt_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this > rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(LuaValue), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-gt_b

-
-public boolean gt_b(int rhs)
-
-
Description copied from class: LuaValue
-
Greater than: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean. -

- To be comparable, this must derive from LuaNumber. -

-

-
Overrides:
gt_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this > rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(int), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-gt_b

-
-public boolean gt_b(double rhs)
-
-
Description copied from class: LuaValue
-
Greater than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Overrides:
gt_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this > rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(LuaValue), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-gteq

-
-public LuaValue gteq(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Greater than or equals: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Overrides:
gteq in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this >= rhs), FALSE if not, - or LuaValue if metatag processing occurs
See Also:
LuaValue.gteq_b(LuaValue), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-gteq_b

-
-public boolean gteq_b(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Greater than or equals: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Overrides:
gteq_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this >= rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(LuaValue), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-gteq_b

-
-public boolean gteq_b(int rhs)
-
-
Description copied from class: LuaValue
-
Greater than or equals: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean. -

- To be comparable, this must derive from LuaNumber. -

-

-
Overrides:
gteq_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this >= rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(int), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-gteq_b

-
-public boolean gteq_b(double rhs)
-
-
Description copied from class: LuaValue
-
Greater than or equals: Perform numeric comparison with another value - of double type, - including metatag processing, - and returning java boolean. -

- To be comparable, this must derive from LuaNumber. -

-

-
Overrides:
gteq_b in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this >= rhs), false if not, - and boolean interpreation of result if metatag processing occurs.
See Also:
LuaValue.gteq(double), -LuaValue.comparemt(LuaValue, LuaValue)
-
-
-
- -

-concat

-
-public LuaValue concat(LuaValue rhs)
-
-
Description copied from class: LuaValue
-
Concatenate another value onto this value and return the result - using rules of lua string concatenation including metatag processing. -

- Only strings and numbers as represented can be concatenated, meaning - each operand must derive from LuaString or LuaNumber. -

-

-
Overrides:
concat in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the operation with
-
-
-
- -

-concat

-
-public Buffer concat(Buffer rhs)
-
-
Description copied from class: LuaValue
-
Concatenate a Buffer onto this value and return the result - using rules of lua string concatenation including metatag processing. -

- Only strings and numbers as represented can be concatenated, meaning - each operand must derive from LuaString or LuaNumber. -

-

-
Overrides:
concat in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side Buffer to perform the operation with -
Returns:
LuaString resulting from concatenation of (this .. rhs)
-
-
-
- -

-concatTo

-
-public LuaValue concatTo(LuaNumber lhs)
-
-
Description copied from class: LuaValue
-
Reverse-concatenation: concatenate this value onto another value - known to be a LuaNumber - and return the result using rules of lua string concatenation including - metatag processing. -

- Only strings and numbers as represented can be concatenated, meaning - each operand must derive from LuaString or LuaNumber. -

-

-
Overrides:
concatTo in class LuaValue
-
-
-
Parameters:
lhs - The left-hand-side value onto which this will be concatenated
See Also:
LuaValue.concat(LuaValue)
-
-
-
- -

-concatTo

-
-public LuaValue concatTo(LuaString lhs)
-
-
Description copied from class: LuaValue
-
Reverse-concatenation: concatenate this value onto another value - known to be a LuaString - and return the result using rules of lua string concatenation including - metatag processing. -

- Only strings and numbers as represented can be concatenated, meaning - each operand must derive from LuaString or LuaNumber. -

-

-
Overrides:
concatTo in class LuaValue
-
-
-
Parameters:
lhs - The left-hand-side value onto which this will be concatenated
See Also:
LuaValue.concat(LuaValue)
-
-
-
- -

-strcmp

-
-public int strcmp(LuaValue lhs)
-
-
Description copied from class: LuaValue
-
Perform string comparison with another value - of any type - using string comparison based on byte values. -

- Only strings can be compared, meaning - each operand must derive from LuaString. -

-

-
Overrides:
strcmp in class LuaValue
-
-
-
Parameters:
lhs - The right-hand-side value to perform the comparison with
-
-
-
- -

-strcmp

-
-public int strcmp(LuaString rhs)
-
-
Description copied from class: LuaValue
-
Perform string comparison with another value - known to be a LuaString - using string comparison based on byte values. -

- Only strings can be compared, meaning - each operand must derive from LuaString. -

-

-
Overrides:
strcmp in class LuaValue
-
-
-
Parameters:
rhs - The right-hand-side value to perform the comparison with
-
-
-
- -

-checkint

-
-public int checkint()
-
-
Description copied from class: LuaValue
-
Check that the value is numeric, and convert and cast value to int, or throw LuaError if not numeric -

- Values that are LuaNumber will be cast to int and may lose precision. - Values that are LuaString that can be converted to a number will be converted, - then cast to int, so may also lose precision. -

-

-
Overrides:
checkint in class LuaValue
-
-
- -
Returns:
value cast to a int if numeric
See Also:
LuaValue.checkinteger(), -LuaValue.checklong(), -LuaValue.checkdouble(), -LuaValue.optint(int), -LuaValue.TNUMBER
-
-
-
- -

-checkinteger

-
-public LuaInteger checkinteger()
-
-
Description copied from class: LuaValue
-
Check that the value is numeric, and convert and cast value to int, or throw LuaError if not numeric -

- Values that are LuaNumber will be cast to int and may lose precision. - Values that are LuaString that can be converted to a number will be converted, - then cast to int, so may also lose precision. -

-

-
Overrides:
checkinteger in class LuaValue
-
-
- -
Returns:
value cast to a int and wrapped in LuaInteger if numeric
See Also:
LuaValue.checkint(), -LuaValue.checklong(), -LuaValue.checkdouble(), -LuaValue.optinteger(LuaInteger), -LuaValue.TNUMBER
-
-
-
- -

-checklong

-
-public long checklong()
-
-
Description copied from class: LuaValue
-
Check that the value is numeric, and convert and cast value to long, or throw LuaError if not numeric -

- Values that are LuaNumber will be cast to long and may lose precision. - Values that are LuaString that can be converted to a number will be converted, - then cast to long, so may also lose precision. -

-

-
Overrides:
checklong in class LuaValue
-
-
- -
Returns:
value cast to a long if numeric
See Also:
LuaValue.checkint(), -LuaValue.checkinteger(), -LuaValue.checkdouble(), -LuaValue.optlong(long), -LuaValue.TNUMBER
-
-
-
- -

-checkdouble

-
-public double checkdouble()
-
-
Description copied from class: LuaValue
-
Check that the value is numeric and return the value as a double, - or throw LuaError if not numeric -

- Values that are LuaNumber and values that are LuaString - that can be converted to a number will be converted to double. -

-

-
Overrides:
checkdouble in class LuaValue
-
-
- -
Returns:
value cast to a double if numeric
See Also:
LuaValue.checkint(), -LuaValue.checkinteger(), -LuaValue.checklong(), -LuaValue.optdouble(double), -LuaValue.TNUMBER
-
-
-
- -

-checknumber

-
-public LuaNumber checknumber()
-
-
Description copied from class: LuaValue
-
Check that the value is numeric, and return as a LuaNumber if so, or throw LuaError -

- Values that are LuaString that can be converted to a number will be converted and returned. -

-

-
Overrides:
checknumber in class LuaValue
-
-
- -
Returns:
value as a LuaNumber if numeric
See Also:
LuaValue.checkint(), -LuaValue.checkinteger(), -LuaValue.checkdouble(), -LuaValue.checklong(), -LuaValue.optnumber(LuaNumber), -LuaValue.TNUMBER
-
-
-
- -

-checknumber

-
-public LuaNumber checknumber(java.lang.String msg)
-
-
Description copied from class: LuaValue
-
Check that the value is numeric, and return as a LuaNumber if so, or throw LuaError -

- Values that are LuaString that can be converted to a number will be converted and returned. -

-

-
Overrides:
checknumber in class LuaValue
-
-
-
Parameters:
msg - String message to supply if conversion fails -
Returns:
value as a LuaNumber if numeric
See Also:
LuaValue.checkint(), -LuaValue.checkinteger(), -LuaValue.checkdouble(), -LuaValue.checklong(), -LuaValue.optnumber(LuaNumber), -LuaValue.TNUMBER
-
-
-
- -

-tonumber

-
-public LuaValue tonumber()
-
-
Description copied from class: LuaValue
-
Conditionally convert to lua number without throwing errors. -

- In lua all numbers are strings, but not all strings are numbers. - This function will return - the LuaValue this if it is a number - or a string convertible to a number, - and NIL for all other cases. -

- This allows values to be tested for their "numeric-ness" without - the penalty of throwing exceptions, - nor the cost of converting the type and creating storage for it. -

-

-
Overrides:
tonumber in class LuaValue
-
-
- -
Returns:
this if it is a LuaNumber - or LuaString that can be converted to a number, - otherwise LuaValue.NIL
See Also:
LuaValue.tostring(), -LuaValue.optnumber(LuaNumber), -LuaValue.checknumber(), -LuaValue.toint(), -LuaValue.todouble()
-
-
-
- -

-isnumber

-
-public boolean isnumber()
-
-
Description copied from class: LuaValue
-
Check if this is a number -

-

-
Overrides:
isnumber in class LuaValue
-
-
- -
Returns:
true if this is a number, - meaning derives from LuaNumber - or derives from LuaString and is convertible to a number, - otherwise false
See Also:
LuaValue.tonumber(), -LuaValue.checknumber(), -LuaValue.optnumber(LuaNumber), -LuaValue.TNUMBER
-
-
-
- -

-isint

-
-public boolean isint()
-
-
Description copied from class: LuaValue
-
Check if this is a number and is representable by java int - without rounding or truncation -

-

-
Overrides:
isint in class LuaValue
-
-
- -
Returns:
true if this is a number - meaning derives from LuaNumber - or derives from LuaString and is convertible to a number, - and can be represented by int, - otherwise false
See Also:
LuaValue.isinttype(), -LuaValue.islong(), -LuaValue.tonumber(), -LuaValue.checkint(), -LuaValue.optint(int), -LuaValue.TNUMBER
-
-
-
- -

-islong

-
-public boolean islong()
-
-
Description copied from class: LuaValue
-
Check if this is a number and is representable by java long - without rounding or truncation -

-

-
Overrides:
islong in class LuaValue
-
-
- -
Returns:
true if this is a number - meaning derives from LuaNumber - or derives from LuaString and is convertible to a number, - and can be represented by long, - otherwise false
See Also:
LuaValue.tonumber(), -LuaValue.checklong(), -LuaValue.optlong(long), -LuaValue.TNUMBER
-
-
-
- -

-tobyte

-
-public byte tobyte()
-
-
Description copied from class: LuaValue
-
Convert to byte if numeric, or 0 if not. -

-

-
Overrides:
tobyte in class LuaValue
-
-
- -
Returns:
Value cast to byte if number or string convertible to number, otherwise 0
See Also:
LuaValue.toint(), -LuaValue.todouble(), -#optbyte(byte), -LuaValue.checknumber(), -LuaValue.isnumber(), -TNUMBER
-
-
-
- -

-tochar

-
-public char tochar()
-
-
Description copied from class: LuaValue
-
Convert to char if numeric, or 0 if not. -

-

-
Overrides:
tochar in class LuaValue
-
-
- -
Returns:
Value cast to char if number or string convertible to number, otherwise 0
See Also:
LuaValue.toint(), -LuaValue.todouble(), -#optchar(char), -LuaValue.checknumber(), -LuaValue.isnumber(), -TNUMBER
-
-
-
- -

-todouble

-
-public double todouble()
-
-
Description copied from class: LuaValue
-
Convert to double if numeric, or 0 if not. -

-

-
Overrides:
todouble in class LuaValue
-
-
- -
Returns:
Value cast to double if number or string convertible to number, otherwise 0
See Also:
LuaValue.toint(), -LuaValue.tobyte(), -LuaValue.tochar(), -LuaValue.toshort(), -LuaValue.tolong(), -LuaValue.tofloat(), -LuaValue.optdouble(double), -LuaValue.checknumber(), -LuaValue.isnumber(), -TNUMBER
-
-
-
- -

-tofloat

-
-public float tofloat()
-
-
Description copied from class: LuaValue
-
Convert to float if numeric, or 0 if not. -

-

-
Overrides:
tofloat in class LuaValue
-
-
- -
Returns:
Value cast to float if number or string convertible to number, otherwise 0
See Also:
LuaValue.toint(), -LuaValue.todouble(), -#optfloat(float), -LuaValue.checknumber(), -LuaValue.isnumber(), -TNUMBER
-
-
-
- -

-toint

-
-public int toint()
-
-
Description copied from class: LuaValue
-
Convert to int if numeric, or 0 if not. -

-

-
Overrides:
toint in class LuaValue
-
-
- -
Returns:
Value cast to int if number or string convertible to number, otherwise 0
See Also:
LuaValue.tobyte(), -LuaValue.tochar(), -LuaValue.toshort(), -LuaValue.tolong(), -LuaValue.tofloat(), -LuaValue.todouble(), -LuaValue.optint(int), -LuaValue.checknumber(), -LuaValue.isnumber(), -TNUMBER
-
-
-
- -

-tolong

-
-public long tolong()
-
-
Description copied from class: LuaValue
-
Convert to long if numeric, or 0 if not. -

-

-
Overrides:
tolong in class LuaValue
-
-
- -
Returns:
Value cast to long if number or string convertible to number, otherwise 0
See Also:
LuaValue.isint(), -LuaValue.isinttype(), -LuaValue.toint(), -LuaValue.todouble(), -LuaValue.optlong(long), -LuaValue.checknumber(), -LuaValue.isnumber(), -TNUMBER
-
-
-
- -

-toshort

-
-public short toshort()
-
-
Description copied from class: LuaValue
-
Convert to short if numeric, or 0 if not. -

-

-
Overrides:
toshort in class LuaValue
-
-
- -
Returns:
Value cast to short if number or string convertible to number, otherwise 0
See Also:
LuaValue.toint(), -LuaValue.todouble(), -#optshort(short), -LuaValue.checknumber(), -LuaValue.isnumber(), -TNUMBER
-
-
-
- -

-optdouble

-
-public double optdouble(double defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a number or string convertible to number and return as double -

-

-
Overrides:
optdouble in class LuaValue
-
-
-
Parameters:
defval - double to return if this is nil or none -
Returns:
this cast to double if numeric, - defval if nil or none, - throws LuaError otherwise
See Also:
LuaValue.optint(int), -LuaValue.optinteger(LuaInteger), -LuaValue.checkdouble(), -LuaValue.todouble(), -LuaValue.tonumber(), -LuaValue.isnumber(), -LuaValue.TNUMBER
-
-
-
- -

-optint

-
-public int optint(int defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a number or string convertible to number and return as int -

-

-
Overrides:
optint in class LuaValue
-
-
-
Parameters:
defval - int to return if this is nil or none -
Returns:
this cast to int if numeric, - defval if nil or none, - throws LuaError otherwise
See Also:
LuaValue.optdouble(double), -LuaValue.optlong(long), -LuaValue.optinteger(LuaInteger), -LuaValue.checkint(), -LuaValue.toint(), -LuaValue.tonumber(), -LuaValue.isnumber(), -LuaValue.TNUMBER
-
-
-
- -

-optinteger

-
-public LuaInteger optinteger(LuaInteger defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a number or string convertible to number and return as LuaInteger -

-

-
Overrides:
optinteger in class LuaValue
-
-
-
Parameters:
defval - LuaInteger to return if this is nil or none -
Returns:
this converted and wrapped in LuaInteger if numeric, - defval if nil or none, - throws LuaError otherwise
See Also:
LuaValue.optdouble(double), -LuaValue.optint(int), -LuaValue.checkint(), -LuaValue.toint(), -LuaValue.tonumber(), -LuaValue.isnumber(), -LuaValue.TNUMBER
-
-
-
- -

-optlong

-
-public long optlong(long defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a number or string convertible to number and return as long -

-

-
Overrides:
optlong in class LuaValue
-
-
-
Parameters:
defval - long to return if this is nil or none -
Returns:
this cast to long if numeric, - defval if nil or none, - throws LuaError otherwise
See Also:
LuaValue.optdouble(double), -LuaValue.optint(int), -LuaValue.checkint(), -LuaValue.toint(), -LuaValue.tonumber(), -LuaValue.isnumber(), -LuaValue.TNUMBER
-
-
-
- -

-optnumber

-
-public LuaNumber optnumber(LuaNumber defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a number or string convertible to number and return as LuaNumber -

-

-
Overrides:
optnumber in class LuaValue
-
-
-
Parameters:
defval - LuaNumber to return if this is nil or none -
Returns:
this cast to LuaNumber if numeric, - defval if nil or none, - throws LuaError otherwise
See Also:
LuaValue.optdouble(double), -LuaValue.optlong(long), -LuaValue.optint(int), -LuaValue.checkint(), -LuaValue.toint(), -LuaValue.tonumber(), -LuaValue.isnumber(), -LuaValue.TNUMBER
-
-
-
- -

-optstring

-
-public LuaString optstring(LuaString defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a string or number and return as LuaString -

-

-
Overrides:
optstring in class LuaValue
-
-
-
Parameters:
defval - LuaString to return if this is nil or none -
Returns:
this converted to LuaString if a string or number, - defval if nil or none, - throws LuaError if some other type
See Also:
LuaValue.tojstring(), -LuaValue.optjstring(String), -LuaValue.checkstring(), -LuaValue.toString(), -LuaValue.TSTRING
-
-
-
- -

-tostring

-
-public LuaValue tostring()
-
-
Description copied from class: LuaValue
-
Conditionally convert to lua string without throwing errors. -

- In lua all numbers are strings, so this function will return - the LuaValue this if it is a string or number, - and NIL for all other cases. -

- This allows values to be tested for their "string-ness" without - the penalty of throwing exceptions. -

-

-
Overrides:
tostring in class LuaValue
-
-
- -
Returns:
this if it is a LuaString or LuaNumber, - otherwise NIL
See Also:
LuaValue.tonumber(), -LuaValue.tojstring(), -LuaValue.optstring(LuaString), -LuaValue.checkstring(), -LuaValue.toString()
-
-
-
- -

-optjstring

-
-public java.lang.String optjstring(java.lang.String defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a string or number and return as Java String -

-

-
Overrides:
optjstring in class LuaValue
-
-
-
Parameters:
defval - LuaString to return if this is nil or none -
Returns:
this converted to String if a string or number, - defval if nil or none, - throws LuaError if some other type
See Also:
LuaValue.tojstring(), -LuaValue.optstring(LuaString), -LuaValue.checkjstring(), -LuaValue.toString(), -LuaValue.TSTRING
-
-
-
- -

-strvalue

-
-public LuaString strvalue()
-
-
Description copied from class: LuaValue
-
Convert this value to a string if it is a LuaString or LuaNumber, - or throw a LuaError if it is not -

-

-
Overrides:
strvalue in class LuaValue
-
-
- -
Returns:
LuaString corresponding to the value if a string or number
-
-
-
- -

-substring

-
-public LuaString substring(int beginIndex,
-                           int endIndex)
-
-
-
-
-
-
- -

-hashCode

-
-public int hashCode()
-
-
-
Overrides:
hashCode in class java.lang.Object
-
-
-
-
-
-
- -

-equals

-
-public boolean equals(java.lang.Object o)
-
-
-
Overrides:
equals in class LuaValue
-
-
-
-
-
-
- -

-eq

-
-public LuaValue eq(LuaValue val)
-
-
Description copied from class: LuaValue
-
Equals: Perform equality comparison with another value - including metatag processing using EQ. -

-

-
Overrides:
eq in class LuaValue
-
-
-
Parameters:
val - The value to compare with. -
Returns:
TRUE if values are comparable and (this == rhs), - FALSE if comparable but not equal, - LuaValue if metatag processing occurs.
See Also:
LuaValue.eq_b(LuaValue), -LuaValue.raweq(LuaValue), -LuaValue.neq(LuaValue), -LuaValue.eqmtcall(LuaValue, LuaValue, LuaValue, LuaValue), -LuaValue.EQ
-
-
-
- -

-eq_b

-
-public boolean eq_b(LuaValue val)
-
-
Description copied from class: LuaValue
-
Equals: Perform equality comparison with another value - including metatag processing using EQ, - and return java boolean -

-

-
Overrides:
eq_b in class LuaValue
-
-
-
Parameters:
val - The value to compare with. -
Returns:
true if values are comparable and (this == rhs), - false if comparable but not equal, - result converted to java boolean if metatag processing occurs.
See Also:
LuaValue.eq(LuaValue), -LuaValue.raweq(LuaValue), -LuaValue.neq_b(LuaValue), -LuaValue.eqmtcall(LuaValue, LuaValue, LuaValue, LuaValue), -LuaValue.EQ
-
-
-
- -

-raweq

-
-public boolean raweq(LuaValue val)
-
-
Description copied from class: LuaValue
-
Equals: Perform direct equality comparison with another value - without metatag processing. -

-

-
Overrides:
raweq in class LuaValue
-
-
-
Parameters:
val - The value to compare with. -
Returns:
true if (this == rhs), false otherwise
See Also:
LuaValue.eq(LuaValue), -LuaValue.raweq(LuaUserdata), -LuaValue.raweq(LuaString), -LuaValue.raweq(double), -LuaValue.raweq(int), -LuaValue.EQ
-
-
-
- -

-raweq

-
-public boolean raweq(LuaString s)
-
-
Description copied from class: LuaValue
-
Equals: Perform direct equality comparison with a LuaString value - without metatag processing. -

-

-
Overrides:
raweq in class LuaValue
-
-
-
Parameters:
s - The LuaString to compare with. -
Returns:
true if this is a LuaString - and their byte sequences match, - otherwise false
-
-
-
- -

-equals

-
-public static boolean equals(LuaString a,
-                             int i,
-                             LuaString b,
-                             int j,
-                             int n)
-
-
-
-
-
-
- -

-equals

-
-public static boolean equals(byte[] a,
-                             int i,
-                             byte[] b,
-                             int j,
-                             int n)
-
-
-
-
-
-
- -

-write

-
-public void write(java.io.DataOutputStream writer,
-                  int i,
-                  int len)
-           throws java.io.IOException
-
-
- -
Throws: -
java.io.IOException
-
-
-
- -

-len

-
-public LuaValue len()
-
-
Description copied from class: LuaValue
-
Length operator: return lua length of object (#this) including metatag processing as java int -

-

-
Overrides:
len in class LuaValue
-
-
- -
Returns:
length as defined by the lua # operator - or metatag processing result
-
-
-
- -

-length

-
-public int length()
-
-
Description copied from class: LuaValue
-
Length operator: return lua length of object (#this) including metatag processing as java int -

-

-
Overrides:
length in class LuaValue
-
-
- -
Returns:
length as defined by the lua # operator - or metatag processing result converted to java int using LuaValue.toint()
-
-
-
- -

-luaByte

-
-public int luaByte(int index)
-
-
-
-
-
-
- -

-charAt

-
-public int charAt(int index)
-
-
-
-
-
-
- -

-checkjstring

-
-public java.lang.String checkjstring()
-
-
Description copied from class: LuaValue
-
Convert this value to a Java String. -

- The string representations here will roughly match what is produced by the - C lua distribution, however hash codes have no relationship, - and there may be differences in number formatting. -

-

-
Overrides:
checkjstring in class LuaValue
-
-
- -
Returns:
String representation of the value
See Also:
LuaValue.checkstring(), -LuaValue.optjstring(String), -LuaValue.tojstring(), -LuaValue.isstring(), -LuaValue.TSTRING
-
-
-
- -

-checkstring

-
-public LuaString checkstring()
-
-
Description copied from class: LuaValue
-
Check that this is a lua string, or throw LuaError if it is not. -

- In lua all numbers are strings, so this will succeed for - anything that derives from LuaString or LuaNumber. - Numbers will be converted to LuaString. -

-

-
Overrides:
checkstring in class LuaValue
-
-
- -
Returns:
LuaString representation of the value if it is a LuaString or LuaNumber
See Also:
LuaValue.checkjstring(), -LuaValue.optstring(LuaString), -LuaValue.tostring(), -LuaValue.isstring(), -LuaValue.TSTRING
-
-
-
- -

-toInputStream

-
-public java.io.InputStream toInputStream()
-
-
Convert value to an input stream. -

-

- -
Returns:
InputStream whose data matches the bytes in this LuaString
-
-
-
- -

-copyInto

-
-public void copyInto(int strOffset,
-                     byte[] bytes,
-                     int arrayOffset,
-                     int len)
-
-
Copy the bytes of the string into the given byte array. -

-

-
Parameters:
strOffset - offset from which to copy
bytes - destination byte array
arrayOffset - offset in destination
len - number of bytes to copy
-
-
-
- -

-indexOfAny

-
-public int indexOfAny(LuaString accept)
-
-
Java version of strpbrk - find index of any byte that in an accept string. -

-

-
Parameters:
accept - LuaString containing characters to look for. -
Returns:
index of first match in the accept string, or -1 if not found.
-
-
-
- -

-indexOf

-
-public int indexOf(byte b,
-                   int start)
-
-
Find the index of a byte starting at a point in this string -

-

-
Parameters:
b - the byte to look for
start - the first index in the string -
Returns:
index of first match found, or -1 if not found.
-
-
-
- -

-indexOf

-
-public int indexOf(LuaString s,
-                   int start)
-
-
Find the index of a string starting at a point in this string -

-

-
Parameters:
s - the string to search for
start - the first index in the string -
Returns:
index of first match found, or -1 if not found.
-
-
-
- -

-lastIndexOf

-
-public int lastIndexOf(LuaString s)
-
-
Find the last index of a string in this string -

-

-
Parameters:
s - the string to search for -
Returns:
index of last match found, or -1 if not found.
-
-
-
- -

-decodeAsUtf8

-
-public static java.lang.String decodeAsUtf8(byte[] bytes,
-                                            int offset,
-                                            int length)
-
-
Convert to Java String interpreting as utf8 characters. -

-

-
Parameters:
bytes - byte array in UTF8 encoding to convert
offset - starting index in byte array
length - number of bytes to convert -
Returns:
Java String corresponding to the value of bytes interpreted using UTF8
See Also:
lengthAsUtf8(char[]), -encodeToUtf8(char[], byte[], int), -isValidUtf8()
-
-
-
- -

-lengthAsUtf8

-
-public static int lengthAsUtf8(char[] chars)
-
-
Count the number of bytes required to encode the string as UTF-8. -

-

-
Parameters:
chars - Array of unicode characters to be encoded as UTF-8 -
Returns:
count of bytes needed to encode using UTF-8
See Also:
encodeToUtf8(char[], byte[], int), -decodeAsUtf8(byte[], int, int), -isValidUtf8()
-
-
-
- -

-encodeToUtf8

-
-public static void encodeToUtf8(char[] chars,
-                                byte[] bytes,
-                                int off)
-
-
Encode the given Java string as UTF-8 bytes, writing the result to bytes - starting at offset. -

- The string should be measured first with lengthAsUtf8 - to make sure the given byte array is large enough. -

-

-
Parameters:
chars - Array of unicode characters to be encoded as UTF-8
bytes - byte array to hold the result
off - offset into the byte array to start writing
See Also:
lengthAsUtf8(char[]), -decodeAsUtf8(byte[], int, int), -isValidUtf8()
-
-
-
- -

-isValidUtf8

-
-public boolean isValidUtf8()
-
-
Check that a byte sequence is valid UTF-8 -

-

- -
Returns:
true if it is valid UTF-8, otherwise false
See Also:
lengthAsUtf8(char[]), -encodeToUtf8(char[], byte[], int), -decodeAsUtf8(byte[], int, int)
-
-
-
- -

-tonumber

-
-public LuaValue tonumber(int base)
-
-
convert to a number using a supplied base, or NIL if it can't be converted -

-

-
Parameters:
base - the base to use, such as 10 -
Returns:
IntValue, DoubleValue, or NIL depending on the content of the string.
See Also:
LuaValue.tonumber()
-
-
-
- -

-scannumber

-
-public double scannumber(int base)
-
-
Convert to a number in a base, or return Double.NaN if not a number. -

-

-
Parameters:
base - the base to use, such as 10 -
Returns:
double value if conversion is valid, or Double.NaN if not
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/LuaTable.html b/luaj-2.0.3/docs/api/org/luaj/vm2/LuaTable.html deleted file mode 100644 index 6b635b20f..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/LuaTable.html +++ /dev/null @@ -1,1563 +0,0 @@ - - - - - - -LuaTable (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2 -
-Class LuaTable

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.LuaTable
-
-
-
Direct Known Subclasses:
WeakTable
-
-
-
-
public class LuaTable
extends LuaValue
- - -

-Subclass of LuaValue for representing lua tables. -

- Almost all API's implemented in LuaTable are defined and documented in LuaValue. -

- If a table is needed, the one of the type-checking functions can be used such as - istable(), - checktable(), or - opttable(LuaTable) -

- The main table operations are defined on LuaValue - for getting and setting values with and without metatag processing: -

-

- To iterate over key-value pairs from Java, use -

 LuaValue k = LuaValue.NIL;
- while ( true ) {
-    Varargs n = table.next(k);
-    if ( (k = n.arg1()).isnil() )
-       break;
-    LuaValue v = n.arg(2)
-    process( k, v )
- }
- -

- As with other types, LuaTable instances should be constructed via one of the table constructor - methods on LuaValue: -

-

- -

-

-
See Also:
LuaValue
-
- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Field Summary
-protected  LuaValue[]array - -
-          the array values
-protected  inthashEntries - -
-          the number of hash entries
-protected  LuaValue[]hashKeys - -
-          the hash keys
-protected  LuaValue[]hashValues - -
-          the hash values
-protected  LuaValuem_metatable - -
-          metatable for this table, or null
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - - - - - - - - - - - - - -
-Constructor Summary
LuaTable() - -
-          Construct empty table
LuaTable(int narray, - int nhash) - -
-          Construct table with preset capacity.
LuaTable(LuaValue[] named, - LuaValue[] unnamed, - Varargs lastarg) - -
-          Construct table with named and unnamed parts.
LuaTable(Varargs varargs) - -
-          Construct table of unnamed elements.
LuaTable(Varargs varargs, - int firstarg) - -
-          Construct table of unnamed elements.
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
-protected  LuaTablechangemode(boolean weakkeys, - boolean weakvalues) - -
-          Change the mode of a table
- LuaTablechecktable() - -
-          Check that this is a LuaTable, or throw LuaError if it is not
- LuaValueconcat(LuaString sep, - int i, - int j) - -
-          Concatenate the contents of a table efficiently, using Buffer
- booleaneq_b(LuaValue val) - -
-          Equals: Perform equality comparison with another value - including metatag processing using EQ, - and return java boolean
- LuaValueeq(LuaValue val) - -
-          Equals: Perform equality comparison with another value - including metatag processing using EQ.
- LuaValueforeach(LuaValue func) - -
-          Call the supplied function once for each key-value pair
- LuaValueforeachi(LuaValue func) - -
-          Call the supplied function once for each key-value pair - in the contiguous array part
- LuaValueget(int key) - -
-          Get a value in a table including metatag processing using INDEX.
- LuaValueget(LuaValue key) - -
-          Get a value in a table including metatag processing using INDEX.
-protected  intgetArrayLength() - -
-          Get the length of the array part of the table.
-protected  intgetHashLength() - -
-          Get the length of the hash part of the table.
- LuaValuegetmetatable() - -
-          Get the metatable for this LuaValue
- LuaValuegetn() - -
-          Implementation of lua 5.0 getn() function.
-protected  voidhashClearSlot(int i) - -
-          Clear a particular slot in the table
- inthashFindSlot(LuaValue key) - -
-          Find the hashtable slot to use
-protected  LuaValuehashget(LuaValue key) - -
-           
- voidhashset(LuaValue key, - LuaValue value) - -
-          Set a hashtable value
- Varargsinext(LuaValue key) - -
-          Get the next element after a particular key in the - contiguous array part of a table
- voidinsert(int pos, - LuaValue value) - -
-          Insert an element at a position in a list-table
- booleanistable() - -
-          Check if this is a table
- intkeyCount() - -
-          This may be deprecated in a future release.
- LuaValue[]keys() - -
-          This may be deprecated in a future release.
- LuaValuelen() - -
-          Length operator: return lua length of object (#this) including metatag processing as java int
- intlength() - -
-          Length operator: return lua length of object (#this) including metatag processing as java int
- intmaxn() - -
-          Return table.maxn() as defined by lua 5.0.
- Varargsnext(LuaValue key) - -
-          Get the next element after a particular key in the table
- LuaTableopttable(LuaTable defval) - -
-          Check that optional argument is a table and return as LuaTable
- voidpresize(int narray) - -
-          Preallocate the array part of a table to be a certain size,
- voidpresize(int narray, - int nhash) - -
-           
- LuaValuerawget(int key) - -
-          Get a value in a table without metatag processing.
- LuaValuerawget(LuaValue key) - -
-          Get a value in a table without metatag processing.
- voidrawset(int key, - LuaValue value) - -
-          Set a value in a table without metatag processing.
- voidrawset(LuaValue key, - LuaValue value) - -
-          caller must ensure key is not nil
- LuaValueremove(int pos) - -
-          Remove the element at a position in a list-table
- voidset(int key, - LuaValue value) - -
-          Set a value in a table without metatag processing using NEWINDEX.
- voidset(LuaValue key, - LuaValue value) - -
-          caller must ensure key is not nil
- LuaValuesetmetatable(LuaValue metatable) - -
-          Set the metatable for this LuaValue
- voidsort(LuaValue comparator) - -
-          Sort the table using a comparator.
- inttype() - -
-          Get the enumeration value for the type of this value.
- java.lang.Stringtypename() - -
-          Get the String name of the type of this value.
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
add, add, add, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, call, call, call, call, callmt, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checkmetatag, checknotnil, checknumber, checknumber, checkstring, checkthread, checkuserdata, checkuserdata, checkvalidkey, compareerror, compareerror, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, div, div, div, divInto, eqmtcall, equals, error, get, getfenv, gettable, gt_b, gt_b, gt_b, gt, gt, gt, gteq_b, gteq_b, gteq_b, gteq, gteq, gteq, illegal, invoke, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isfunction, isint, isinttype, islong, isnil, isnumber, isstring, isthread, isuserdata, isuserdata, isweaknil, lenerror, listOf, listOf, load, lt_b, lt_b, lt_b, lt, lt, lt, lteq_b, lteq_b, lteq_b, lteq, lteq, lteq, metatag, method, method, method, method, method, method, mod, mod, mod, modFrom, mul, mul, mul, narg, neg, neq_b, neq, not, onInvoke, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, optthread, optuserdata, optuserdata, optvalue, or, pow, pow, pow, powWith, powWith, raweq, raweq, raweq, raweq, raweq, rawget, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, setfenv, settable, strcmp, strcmp, strongkey, strongvalue, strvalue, sub, sub, sub, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, tonumber, toshort, tostring, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Field Detail
- -

-array

-
-protected LuaValue[] array
-
-
the array values -

-

-
-
-
- -

-hashKeys

-
-protected LuaValue[] hashKeys
-
-
the hash keys -

-

-
-
-
- -

-hashValues

-
-protected LuaValue[] hashValues
-
-
the hash values -

-

-
-
-
- -

-hashEntries

-
-protected int hashEntries
-
-
the number of hash entries -

-

-
-
-
- -

-m_metatable

-
-protected LuaValue m_metatable
-
-
metatable for this table, or null -

-

-
-
- - - - - - - - -
-Constructor Detail
- -

-LuaTable

-
-public LuaTable()
-
-
Construct empty table -

-

-
- -

-LuaTable

-
-public LuaTable(int narray,
-                int nhash)
-
-
Construct table with preset capacity. -

-

-
Parameters:
narray - capacity of array part
nhash - capacity of hash part
-
-
- -

-LuaTable

-
-public LuaTable(LuaValue[] named,
-                LuaValue[] unnamed,
-                Varargs lastarg)
-
-
Construct table with named and unnamed parts. -

-

-
Parameters:
named - Named elements in order key-a, value-a, key-b, value-b, ...
unnamed - Unnamed elements in order value-1, value-2, ...
lastarg - Additional unnamed values beyond unnamed.length
-
-
- -

-LuaTable

-
-public LuaTable(Varargs varargs)
-
-
Construct table of unnamed elements. -

-

-
Parameters:
varargs - Unnamed elements in order value-1, value-2, ...
-
-
- -

-LuaTable

-
-public LuaTable(Varargs varargs,
-                int firstarg)
-
-
Construct table of unnamed elements. -

-

-
Parameters:
varargs - Unnamed elements in order value-1, value-2, ...
firstarg - the index in varargs of the first argument to include in the table
-
- - - - - - - - -
-Method Detail
- -

-type

-
-public int type()
-
-
Description copied from class: LuaValue
-
Get the enumeration value for the type of this value. -

-

-
Specified by:
type in class LuaValue
-
-
- -
Returns:
value for this type, one of - TNIL, - TBOOLEAN, - TNUMBER, - TSTRING, - TTABLE, - TFUNCTION, - TUSERDATA, - TTHREAD
See Also:
LuaValue.typename()
-
-
-
- -

-typename

-
-public java.lang.String typename()
-
-
Description copied from class: LuaValue
-
Get the String name of the type of this value. -

-

-

-
Specified by:
typename in class LuaValue
-
-
- -
Returns:
name from type name list LuaValue.TYPE_NAMES - corresponding to the type of this value: - "nil", "boolean", "number", "string", - "table", "function", "userdata", "thread"
See Also:
LuaValue.type()
-
-
-
- -

-istable

-
-public boolean istable()
-
-
Description copied from class: LuaValue
-
Check if this is a table -

-

-
Overrides:
istable in class LuaValue
-
-
- -
Returns:
true if this is a table, otherwise false
See Also:
LuaValue.checktable(), -LuaValue.opttable(LuaTable), -LuaValue.TTABLE
-
-
-
- -

-checktable

-
-public LuaTable checktable()
-
-
Description copied from class: LuaValue
-
Check that this is a LuaTable, or throw LuaError if it is not -

-

-
Overrides:
checktable in class LuaValue
-
-
- -
Returns:
this if it is a LuaTable
See Also:
LuaValue.istable(), -LuaValue.opttable(LuaTable), -LuaValue.TTABLE
-
-
-
- -

-opttable

-
-public LuaTable opttable(LuaTable defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a table and return as LuaTable -

-

-
Overrides:
opttable in class LuaValue
-
-
-
Parameters:
defval - LuaTable to return if this is nil or none -
Returns:
this cast to LuaTable if a table, - defval if nil or none, - throws LuaError if some other type
See Also:
LuaValue.checktable(), -LuaValue.istable(), -LuaValue.TTABLE
-
-
-
- -

-presize

-
-public void presize(int narray)
-
-
Description copied from class: LuaValue
-
Preallocate the array part of a table to be a certain size, -

- Primarily used internally in response to a SETLIST bytecode. -

-

-
Overrides:
presize in class LuaValue
-
-
-
Parameters:
narray - the number of array slots to preallocate in the table.
-
-
-
- -

-presize

-
-public void presize(int narray,
-                    int nhash)
-
-
-
-
-
-
- -

-getArrayLength

-
-protected int getArrayLength()
-
-
Get the length of the array part of the table. -

-

- -
Returns:
length of the array part, does not relate to count of objects in the table.
-
-
-
- -

-getHashLength

-
-protected int getHashLength()
-
-
Get the length of the hash part of the table. -

-

- -
Returns:
length of the hash part, does not relate to count of objects in the table.
-
-
-
- -

-getmetatable

-
-public LuaValue getmetatable()
-
-
Description copied from class: LuaValue
-
Get the metatable for this LuaValue -

- For LuaTable and LuaUserdata instances, - the metatable returned is this instance metatable. - For all other types, the class metatable value will be returned. -

-

-
Overrides:
getmetatable in class LuaValue
-
-
- -
Returns:
metatable, or null if it there is none
See Also:
LuaBoolean.s_metatable, -LuaNumber.s_metatable, -LuaNil.s_metatable, -LuaFunction.s_metatable, -LuaThread.s_metatable
-
-
-
- -

-setmetatable

-
-public LuaValue setmetatable(LuaValue metatable)
-
-
Description copied from class: LuaValue
-
Set the metatable for this LuaValue -

- For LuaTable and LuaUserdata instances, the metatable is per instance. - For all other types, there is one metatable per type that can be set directly from java -

-

-
Overrides:
setmetatable in class LuaValue
-
-
-
Parameters:
metatable - LuaValue instance to serve as the metatable, or null to reset it. -
Returns:
this to allow chaining of Java function calls
See Also:
LuaBoolean.s_metatable, -LuaNumber.s_metatable, -LuaNil.s_metatable, -LuaFunction.s_metatable, -LuaThread.s_metatable
-
-
-
- -

-changemode

-
-protected LuaTable changemode(boolean weakkeys,
-                              boolean weakvalues)
-
-
Change the mode of a table -

-

-
Parameters:
weakkeys - true to make the table have weak keys going forward
weakvalues - true to make the table have weak values going forward -
Returns:
this or a new WeakTable if the mode change requires copying.
-
-
-
- -

-get

-
-public LuaValue get(int key)
-
-
Description copied from class: LuaValue
-
Get a value in a table including metatag processing using INDEX. -

-

-
Overrides:
get in class LuaValue
-
-
-
Parameters:
key - the key to look up -
Returns:
LuaValue for that key, or NIL if not found
See Also:
LuaValue.get(LuaValue), -LuaValue.rawget(int)
-
-
-
- -

-get

-
-public LuaValue get(LuaValue key)
-
-
Description copied from class: LuaValue
-
Get a value in a table including metatag processing using INDEX. -

-

-
Overrides:
get in class LuaValue
-
-
-
Parameters:
key - the key to look up, must not be NIL or null -
Returns:
LuaValue for that key, or NIL if not found and no metatag
See Also:
LuaValue.get(int), -LuaValue.get(String), -LuaValue.rawget(LuaValue)
-
-
-
- -

-rawget

-
-public LuaValue rawget(int key)
-
-
Description copied from class: LuaValue
-
Get a value in a table without metatag processing. -

-

-
Overrides:
rawget in class LuaValue
-
-
-
Parameters:
key - the key to look up -
Returns:
LuaValue for that key, or NIL if not found
-
-
-
- -

-rawget

-
-public LuaValue rawget(LuaValue key)
-
-
Description copied from class: LuaValue
-
Get a value in a table without metatag processing. -

-

-
Overrides:
rawget in class LuaValue
-
-
-
Parameters:
key - the key to look up, must not be NIL or null -
Returns:
LuaValue for that key, or NIL if not found
-
-
-
- -

-hashget

-
-protected LuaValue hashget(LuaValue key)
-
-
-
-
-
-
- -

-set

-
-public void set(int key,
-                LuaValue value)
-
-
Description copied from class: LuaValue
-
Set a value in a table without metatag processing using NEWINDEX. -

-

-
Overrides:
set in class LuaValue
-
-
-
Parameters:
key - the key to use
value - the value to use, can be NIL, must not be null
-
-
-
- -

-set

-
-public void set(LuaValue key,
-                LuaValue value)
-
-
caller must ensure key is not nil -

-

-
Overrides:
set in class LuaValue
-
-
-
Parameters:
key - the key to use, must not be NIL or null
value - the value to use, can be NIL, must not be null
-
-
-
- -

-rawset

-
-public void rawset(int key,
-                   LuaValue value)
-
-
Description copied from class: LuaValue
-
Set a value in a table without metatag processing. -

-

-
Overrides:
rawset in class LuaValue
-
-
-
Parameters:
key - the key to use
value - the value to use, can be NIL, must not be null
-
-
-
- -

-rawset

-
-public void rawset(LuaValue key,
-                   LuaValue value)
-
-
caller must ensure key is not nil -

-

-
Overrides:
rawset in class LuaValue
-
-
-
Parameters:
key - the key to use, must not be NIL or null
value - the value to use, can be NIL, must not be null
-
-
-
- -

-remove

-
-public LuaValue remove(int pos)
-
-
Remove the element at a position in a list-table -

-

-
Parameters:
pos - the position to remove -
Returns:
The removed item, or LuaValue.NONE if not removed
-
-
-
- -

-insert

-
-public void insert(int pos,
-                   LuaValue value)
-
-
Insert an element at a position in a list-table -

-

-
Parameters:
pos - the position to remove
value - The value to insert
-
-
-
- -

-concat

-
-public LuaValue concat(LuaString sep,
-                       int i,
-                       int j)
-
-
Concatenate the contents of a table efficiently, using Buffer -

-

-
Parameters:
sep - LuaString separater to apply between elements
i - the first element index
j - the last element index, inclusive -
Returns:
LuaString value of the concatenation
-
-
-
- -

-getn

-
-public LuaValue getn()
-
-
Description copied from class: LuaValue
-
Implementation of lua 5.0 getn() function. -

-

-
Overrides:
getn in class LuaValue
-
-
- -
Returns:
value of getn() as defined in lua 5.0 spec if this is a LuaTable
-
-
-
- -

-length

-
-public int length()
-
-
Description copied from class: LuaValue
-
Length operator: return lua length of object (#this) including metatag processing as java int -

-

-
Overrides:
length in class LuaValue
-
-
- -
Returns:
length as defined by the lua # operator - or metatag processing result converted to java int using LuaValue.toint()
-
-
-
- -

-len

-
-public LuaValue len()
-
-
Description copied from class: LuaValue
-
Length operator: return lua length of object (#this) including metatag processing as java int -

-

-
Overrides:
len in class LuaValue
-
-
- -
Returns:
length as defined by the lua # operator - or metatag processing result
-
-
-
- -

-maxn

-
-public int maxn()
-
-
Return table.maxn() as defined by lua 5.0. -

- Provided for compatibility, not a scalable operation. -

-

- -
Returns:
value for maxn
-
-
-
- -

-next

-
-public Varargs next(LuaValue key)
-
-
Get the next element after a particular key in the table -

-

-
Overrides:
next in class LuaValue
-
-
-
Parameters:
key - LuaInteger value identifying a key to start from, - or NIL to start at the beginning -
Returns:
key,value or nil
See Also:
LuaTable, -#inext(), -LuaValue.valueOf(int), -Varargs.arg1(), -Varargs.arg(int), -LuaValue.isnil()
-
-
-
- -

-inext

-
-public Varargs inext(LuaValue key)
-
-
Get the next element after a particular key in the - contiguous array part of a table -

-

-
Overrides:
inext in class LuaValue
-
-
-
Parameters:
key - LuaInteger value identifying a key to start from, - or NIL to start at the beginning -
Returns:
key,value or none
See Also:
LuaTable, -#next(), -LuaValue.valueOf(int), -Varargs.arg1(), -Varargs.arg(int), -LuaValue.isnil()
-
-
-
- -

-foreach

-
-public LuaValue foreach(LuaValue func)
-
-
Call the supplied function once for each key-value pair -

-

-
Parameters:
func - function to call
-
-
-
- -

-foreachi

-
-public LuaValue foreachi(LuaValue func)
-
-
Call the supplied function once for each key-value pair - in the contiguous array part -

-

-
Parameters:
func -
-
-
-
- -

-hashset

-
-public void hashset(LuaValue key,
-                    LuaValue value)
-
-
Set a hashtable value -

-

-
Parameters:
key - key to set
value - value to set
-
-
-
- -

-hashFindSlot

-
-public int hashFindSlot(LuaValue key)
-
-
Find the hashtable slot to use -

-

-
Parameters:
key - key to look for -
Returns:
slot to use
-
-
-
- -

-hashClearSlot

-
-protected void hashClearSlot(int i)
-
-
Clear a particular slot in the table -

-

-
Parameters:
i - slot to clear.
-
-
-
- -

-sort

-
-public void sort(LuaValue comparator)
-
-
Sort the table using a comparator. -

-

-
Parameters:
comparator - LuaValue to be called to compare elements.
-
-
-
- -

-keyCount

-
-public int keyCount()
-
-
This may be deprecated in a future release. - It is recommended to count via iteration over next() instead -

-

- -
Returns:
count of keys in the table
-
-
-
- -

-keys

-
-public LuaValue[] keys()
-
-
This may be deprecated in a future release. - It is recommended to use next() instead -

-

- -
Returns:
array of keys in the table
-
-
-
- -

-eq

-
-public LuaValue eq(LuaValue val)
-
-
Description copied from class: LuaValue
-
Equals: Perform equality comparison with another value - including metatag processing using EQ. -

-

-
Overrides:
eq in class LuaValue
-
-
-
Parameters:
val - The value to compare with. -
Returns:
TRUE if values are comparable and (this == rhs), - FALSE if comparable but not equal, - LuaValue if metatag processing occurs.
See Also:
LuaValue.eq_b(LuaValue), -LuaValue.raweq(LuaValue), -LuaValue.neq(LuaValue), -LuaValue.eqmtcall(LuaValue, LuaValue, LuaValue, LuaValue), -LuaValue.EQ
-
-
-
- -

-eq_b

-
-public boolean eq_b(LuaValue val)
-
-
Description copied from class: LuaValue
-
Equals: Perform equality comparison with another value - including metatag processing using EQ, - and return java boolean -

-

-
Overrides:
eq_b in class LuaValue
-
-
-
Parameters:
val - The value to compare with. -
Returns:
true if values are comparable and (this == rhs), - false if comparable but not equal, - result converted to java boolean if metatag processing occurs.
See Also:
LuaValue.eq(LuaValue), -LuaValue.raweq(LuaValue), -LuaValue.neq_b(LuaValue), -LuaValue.eqmtcall(LuaValue, LuaValue, LuaValue, LuaValue), -LuaValue.EQ
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/LuaThread.CallStack.html b/luaj-2.0.3/docs/api/org/luaj/vm2/LuaThread.CallStack.html deleted file mode 100644 index 54d529b15..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/LuaThread.CallStack.html +++ /dev/null @@ -1,279 +0,0 @@ - - - - - - -LuaThread.CallStack (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2 -
-Class LuaThread.CallStack

-
-java.lang.Object
-  extended by org.luaj.vm2.LuaThread.CallStack
-
-
-
Enclosing class:
LuaThread
-
-
-
-
public static class LuaThread.CallStack
extends java.lang.Object
- - -

-


- -

- - - - - - - - - - - -
-Constructor Summary
LuaThread.CallStack() - -
-           
-  - - - - - - - - - - - - - - - -
-Method Summary
- intgetCallstackDepth() - -
-          Get number of calls in stack
- voidonReturn() - -
-          Method to signal the end of a call
- - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-  -

- - - - - - - - -
-Constructor Detail
- -

-LuaThread.CallStack

-
-public LuaThread.CallStack()
-
-
- - - - - - - - -
-Method Detail
- -

-onReturn

-
-public final void onReturn()
-
-
Method to signal the end of a call -

-

-
See Also:
DebugLib
-
-
-
- -

-getCallstackDepth

-
-public final int getCallstackDepth()
-
-
Get number of calls in stack -

-

- -
Returns:
number of calls in current call stack
See Also:
DebugLib
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/LuaThread.html b/luaj-2.0.3/docs/api/org/luaj/vm2/LuaThread.html deleted file mode 100644 index 62c6e6242..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/LuaThread.html +++ /dev/null @@ -1,910 +0,0 @@ - - - - - - -LuaThread (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2 -
-Class LuaThread

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.LuaThread
-
-
-
-
public class LuaThread
extends LuaValue
- - -

-Subclass of LuaValue that implements - a lua coroutine thread using Java Threads. -

- A LuaThread is typically created in response to a scripted call to - coroutine.create() -

- The threads must be initialized with the globals, so that - the global environment may be passed along according to rules of lua. - This is done via a call to setGlobals(LuaValue) - at some point during globals initialization. - See BaseLib for additional documentation and example code. -

- The utility classes JsePlatform and JmePlatform - see to it that this initialization is done properly. - For this reason it is highly recommended to use one of these classes - when initializing globals. -

- The behavior of coroutine threads matches closely the behavior - of C coroutine library. However, because of the use of Java threads - to manage call state, it is possible to yield from anywhere in luaj. -

- Each Java thread wakes up at regular intervals and checks a weak reference - to determine if it can ever be resumed. If not, it throws - OrphanedThread which is an Error. - Applications should not catch OrphanedThread, because it can break - the thread safety of luaj. -

- -

-

-
See Also:
LuaValue, -JsePlatform, -JmePlatform, -CoroutineLib
-
- -

- - - - - - - - - - - -
-Nested Class Summary
-static classLuaThread.CallStack - -
-           
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Field Summary
-static intcoroutine_count - -
-           
- java.lang.ObjectdebugState - -
-          Thread-local used by DebugLib to store debugging state.
- LuaValueerr - -
-          Field to hold state of error condition during debug hook function calls.
-static intGC_INTERVAL - -
-          Interval to check for LuaThread dereferencing.
-static intMAX_CALLSTACK - -
-           
-static LuaValues_metatable - -
-           
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - -
-Constructor Summary
LuaThread(LuaValue func, - LuaValue env) - -
-          Create a LuaThread around a function and environment
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
- LuaThreadcheckthread() - -
-          Check that this is a LuaThread, or throw LuaError if it is not
-static LuaFunctiongetCallstackFunction(int level) - -
-          Get the function called as a specific location on the stack.
- LuaValuegetfenv() - -
-          Get the environemnt for an instance.
-static LuaValuegetGlobals() - -
-          Get the current thread's environment
- LuaValuegetmetatable() - -
-          Get the metatable for this LuaValue
-static LuaThreadgetRunning() - -
-          Get the currently running thread.
- java.lang.StringgetStatus() - -
-           
-static booleanisMainThread(LuaThread r) - -
-          Test if this is the main thread
- booleanisthread() - -
-          Check if this is a thread
-static LuaThread.CallStackonCall(LuaFunction function) - -
-          Callback used at the beginning of a call to prepare for possible getfenv/setfenv calls
- LuaThreadoptthread(LuaThread defval) - -
-          Check that optional argument is a thread and return as LuaThread
- Varargsresume(Varargs args) - -
-          Start or resume this thread
-static LuaValuesetErrorFunc(LuaValue errfunc) - -
-          Replace the error function of the currently running thread.
- voidsetfenv(LuaValue env) - -
-          Set the environment on an object.
-static voidsetGlobals(LuaValue globals) - -
-          Set the globals of the current thread.
- inttype() - -
-          Get the enumeration value for the type of this value.
- java.lang.Stringtypename() - -
-          Get the String name of the type of this value.
-static Varargsyield(Varargs args) - -
-          Yield the current thread with arguments
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
add, add, add, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, call, call, call, call, callmt, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checkmetatag, checknotnil, checknumber, checknumber, checkstring, checktable, checkuserdata, checkuserdata, checkvalidkey, compareerror, compareerror, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, div, div, div, divInto, eq_b, eq, eqmtcall, equals, error, get, get, get, getn, gettable, gt_b, gt_b, gt_b, gt, gt, gt, gteq_b, gteq_b, gteq_b, gteq, gteq, gteq, illegal, inext, invoke, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isfunction, isint, isinttype, islong, isnil, isnumber, isstring, istable, isuserdata, isuserdata, isweaknil, len, lenerror, length, listOf, listOf, load, lt_b, lt_b, lt_b, lt, lt, lt, lteq_b, lteq_b, lteq_b, lteq, lteq, lteq, metatag, method, method, method, method, method, method, mod, mod, mod, modFrom, mul, mul, mul, narg, neg, neq_b, neq, next, not, onInvoke, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optuserdata, optuserdata, optvalue, or, pow, pow, pow, powWith, powWith, presize, raweq, raweq, raweq, raweq, raweq, rawget, rawget, rawget, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setmetatable, settable, strcmp, strcmp, strongkey, strongvalue, strvalue, sub, sub, sub, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, tonumber, toshort, tostring, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Field Detail
- -

-s_metatable

-
-public static LuaValue s_metatable
-
-
-
-
-
- -

-coroutine_count

-
-public static int coroutine_count
-
-
-
-
-
- -

-err

-
-public LuaValue err
-
-
Field to hold state of error condition during debug hook function calls. -

-

-
-
-
- -

-MAX_CALLSTACK

-
-public static final int MAX_CALLSTACK
-
-
-
See Also:
Constant Field Values
-
-
- -

-GC_INTERVAL

-
-public static int GC_INTERVAL
-
-
Interval to check for LuaThread dereferencing. -

-

-
-
-
- -

-debugState

-
-public java.lang.Object debugState
-
-
Thread-local used by DebugLib to store debugging state. -

-

-
-
- - - - - - - - -
-Constructor Detail
- -

-LuaThread

-
-public LuaThread(LuaValue func,
-                 LuaValue env)
-
-
Create a LuaThread around a function and environment -

-

-
Parameters:
func - The function to execute
env - The environment to apply to the thread
-
- - - - - - - - -
-Method Detail
- -

-type

-
-public int type()
-
-
Description copied from class: LuaValue
-
Get the enumeration value for the type of this value. -

-

-
Specified by:
type in class LuaValue
-
-
- -
Returns:
value for this type, one of - TNIL, - TBOOLEAN, - TNUMBER, - TSTRING, - TTABLE, - TFUNCTION, - TUSERDATA, - TTHREAD
See Also:
LuaValue.typename()
-
-
-
- -

-typename

-
-public java.lang.String typename()
-
-
Description copied from class: LuaValue
-
Get the String name of the type of this value. -

-

-

-
Specified by:
typename in class LuaValue
-
-
- -
Returns:
name from type name list LuaValue.TYPE_NAMES - corresponding to the type of this value: - "nil", "boolean", "number", "string", - "table", "function", "userdata", "thread"
See Also:
LuaValue.type()
-
-
-
- -

-isthread

-
-public boolean isthread()
-
-
Description copied from class: LuaValue
-
Check if this is a thread -

-

-
Overrides:
isthread in class LuaValue
-
-
- -
Returns:
true if this is a thread, otherwise false
See Also:
LuaValue.checkthread(), -LuaValue.optthread(LuaThread), -LuaValue.TTHREAD
-
-
-
- -

-optthread

-
-public LuaThread optthread(LuaThread defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a thread and return as LuaThread -

-

-
Overrides:
optthread in class LuaValue
-
-
-
Parameters:
defval - LuaThread to return if this is nil or none -
Returns:
this cast to LuaTable if a thread, - defval if nil or none, - throws LuaError if some other type
See Also:
LuaValue.checkthread(), -LuaValue.isthread(), -LuaValue.TTHREAD
-
-
-
- -

-checkthread

-
-public LuaThread checkthread()
-
-
Description copied from class: LuaValue
-
Check that this is a LuaThread, or throw LuaError if it is not -

-

-
Overrides:
checkthread in class LuaValue
-
-
- -
Returns:
this if it is a LuaThread
See Also:
LuaValue.isthread(), -LuaValue.optthread(LuaThread), -LuaValue.TTHREAD
-
-
-
- -

-getmetatable

-
-public LuaValue getmetatable()
-
-
Description copied from class: LuaValue
-
Get the metatable for this LuaValue -

- For LuaTable and LuaUserdata instances, - the metatable returned is this instance metatable. - For all other types, the class metatable value will be returned. -

-

-
Overrides:
getmetatable in class LuaValue
-
-
- -
Returns:
metatable, or null if it there is none
See Also:
LuaBoolean.s_metatable, -LuaNumber.s_metatable, -LuaNil.s_metatable, -LuaFunction.s_metatable, -s_metatable
-
-
-
- -

-getfenv

-
-public LuaValue getfenv()
-
-
Description copied from class: LuaValue
-
Get the environemnt for an instance. -

-

-
Overrides:
getfenv in class LuaValue
-
-
- -
Returns:
LuaValue currently set as the instances environent.
-
-
-
- -

-setfenv

-
-public void setfenv(LuaValue env)
-
-
Description copied from class: LuaValue
-
Set the environment on an object. -

- Typically the environment is created once per application via a platform - helper method such as JsePlatform.standardGlobals() - However, any object can serve as an environment if it contains suitable metatag - values to implement LuaValue.get(LuaValue) to provide the environment values. -

-

-
Overrides:
setfenv in class LuaValue
-
-
-
Parameters:
env - LuaValue (typically a LuaTable) containing the environment.
See Also:
JmePlatform, -JsePlatform
-
-
-
- -

-getStatus

-
-public java.lang.String getStatus()
-
-
-
-
-
-
- -

-getRunning

-
-public static LuaThread getRunning()
-
-
Get the currently running thread. -

-

- -
Returns:
LuaThread that is currenly running
-
-
-
- -

-isMainThread

-
-public static boolean isMainThread(LuaThread r)
-
-
Test if this is the main thread -

-

- -
Returns:
true if this is the main thread
-
-
-
- -

-setGlobals

-
-public static void setGlobals(LuaValue globals)
-
-
Set the globals of the current thread. -

- This must be done once before any other code executes. -

-

-
Parameters:
globals - The global variables for the main ghread.
-
-
-
- -

-getGlobals

-
-public static LuaValue getGlobals()
-
-
Get the current thread's environment -

-

- -
Returns:
LuaValue containing the global variables of the current thread.
-
-
-
- -

-onCall

-
-public static final LuaThread.CallStack onCall(LuaFunction function)
-
-
Callback used at the beginning of a call to prepare for possible getfenv/setfenv calls -

-

-
Parameters:
function - Function being called -
Returns:
CallStack which is used to signal the return or a tail-call recursion
See Also:
DebugLib
-
-
-
- -

-getCallstackFunction

-
-public static final LuaFunction getCallstackFunction(int level)
-
-
Get the function called as a specific location on the stack. -

-

-
Parameters:
level - 1 for the function calling this one, 2 for the next one. -
Returns:
LuaFunction on the call stack, or null if outside of range of active stack
-
-
-
- -

-setErrorFunc

-
-public static LuaValue setErrorFunc(LuaValue errfunc)
-
-
Replace the error function of the currently running thread. -

-

-
Parameters:
errfunc - the new error function to use. -
Returns:
the previous error function.
-
-
-
- -

-yield

-
-public static Varargs yield(Varargs args)
-
-
Yield the current thread with arguments -

-

-
Parameters:
args - The arguments to send as return values to resume(Varargs) -
Returns:
Varargs provided as arguments to resume(Varargs)
-
-
-
- -

-resume

-
-public Varargs resume(Varargs args)
-
-
Start or resume this thread -

-

-
Parameters:
args - The arguments to send as return values to yield(Varargs) -
Returns:
Varargs provided as arguments to yield(Varargs)
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/LuaUserdata.html b/luaj-2.0.3/docs/api/org/luaj/vm2/LuaUserdata.html deleted file mode 100644 index 237d0088b..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/LuaUserdata.html +++ /dev/null @@ -1,1010 +0,0 @@ - - - - - - -LuaUserdata (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2 -
-Class LuaUserdata

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.LuaUserdata
-
-
-
-
public class LuaUserdata
extends LuaValue
- - -

-


- -

- - - - - - - - - - - - - - - -
-Field Summary
- java.lang.Objectm_instance - -
-           
- LuaValuem_metatable - -
-           
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - - - - -
-Constructor Summary
LuaUserdata(java.lang.Object obj) - -
-           
LuaUserdata(java.lang.Object obj, - LuaValue metatable) - -
-           
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
- java.lang.Objectcheckuserdata() - -
-          Check that this is a LuaUserdata, or throw LuaError if it is not
- java.lang.Objectcheckuserdata(java.lang.Class c) - -
-          Check that this is a LuaUserdata, or throw LuaError if it is not
- booleaneq_b(LuaValue val) - -
-          Equals: Perform equality comparison with another value - including metatag processing using EQ, - and return java boolean
- LuaValueeq(LuaValue val) - -
-          Equals: Perform equality comparison with another value - including metatag processing using EQ.
- booleaneqmt(LuaValue val) - -
-           
- booleanequals(java.lang.Object val) - -
-           
- LuaValueget(LuaValue key) - -
-          Get a value in a table including metatag processing using INDEX.
- LuaValuegetmetatable() - -
-          Get the metatable for this LuaValue
- inthashCode() - -
-           
- booleanisuserdata() - -
-          Check if this is a userdata
- booleanisuserdata(java.lang.Class c) - -
-          Check if this is a userdata of type c
- java.lang.Objectoptuserdata(java.lang.Class c, - java.lang.Object defval) - -
-          Check that optional argument is a userdata whose instance is of a type - and return the Object instance
- java.lang.Objectoptuserdata(java.lang.Object defval) - -
-          Check that optional argument is a userdata and return the Object instance
- booleanraweq(LuaUserdata val) - -
-          Equals: Perform direct equality comparison with a LuaUserdata value - without metatag processing.
- booleanraweq(LuaValue val) - -
-          Equals: Perform direct equality comparison with another value - without metatag processing.
- voidset(LuaValue key, - LuaValue value) - -
-          Set a value in a table without metatag processing using NEWINDEX.
- LuaValuesetmetatable(LuaValue metatable) - -
-          Set the metatable for this LuaValue
- java.lang.Stringtojstring() - -
-          Convert to human readable String for any type.
- java.lang.Objecttouserdata() - -
-          Convert to userdata instance, or null.
- java.lang.Objecttouserdata(java.lang.Class c) - -
-          Convert to userdata instance if specific type, or null.
- inttype() - -
-          Get the enumeration value for the type of this value.
- java.lang.Stringtypename() - -
-          Get the String name of the type of this value.
- java.lang.Objectuserdata() - -
-           
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
add, add, add, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, call, call, call, call, callmt, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checkmetatag, checknotnil, checknumber, checknumber, checkstring, checktable, checkthread, checkvalidkey, compareerror, compareerror, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, div, div, div, divInto, eqmtcall, error, get, get, getfenv, getn, gettable, gt_b, gt_b, gt_b, gt, gt, gt, gteq_b, gteq_b, gteq_b, gteq, gteq, gteq, illegal, inext, invoke, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isfunction, isint, isinttype, islong, isnil, isnumber, isstring, istable, isthread, isweaknil, len, lenerror, length, listOf, listOf, load, lt_b, lt_b, lt_b, lt, lt, lt, lteq_b, lteq_b, lteq_b, lteq, lteq, lteq, metatag, method, method, method, method, method, method, mod, mod, mod, modFrom, mul, mul, mul, narg, neg, neq_b, neq, next, not, onInvoke, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optvalue, or, pow, pow, pow, powWith, powWith, presize, raweq, raweq, raweq, rawget, rawget, rawget, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, setfenv, settable, strcmp, strcmp, strongkey, strongvalue, strvalue, sub, sub, sub, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, tobyte, tochar, todouble, tofloat, toint, tolong, tonumber, toshort, tostring, toString, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Field Detail
- -

-m_instance

-
-public final java.lang.Object m_instance
-
-
-
-
-
- -

-m_metatable

-
-public LuaValue m_metatable
-
-
-
-
- - - - - - - - -
-Constructor Detail
- -

-LuaUserdata

-
-public LuaUserdata(java.lang.Object obj)
-
-
-
- -

-LuaUserdata

-
-public LuaUserdata(java.lang.Object obj,
-                   LuaValue metatable)
-
-
- - - - - - - - -
-Method Detail
- -

-tojstring

-
-public java.lang.String tojstring()
-
-
Description copied from class: LuaValue
-
Convert to human readable String for any type. -

-

-
Overrides:
tojstring in class LuaValue
-
-
- -
Returns:
String for use by human readers based on type.
See Also:
LuaValue.tostring(), -LuaValue.optjstring(String), -LuaValue.checkjstring(), -LuaValue.isstring(), -TSTRING
-
-
-
- -

-type

-
-public int type()
-
-
Description copied from class: LuaValue
-
Get the enumeration value for the type of this value. -

-

-
Specified by:
type in class LuaValue
-
-
- -
Returns:
value for this type, one of - TNIL, - TBOOLEAN, - TNUMBER, - TSTRING, - TTABLE, - TFUNCTION, - TUSERDATA, - TTHREAD
See Also:
LuaValue.typename()
-
-
-
- -

-typename

-
-public java.lang.String typename()
-
-
Description copied from class: LuaValue
-
Get the String name of the type of this value. -

-

-

-
Specified by:
typename in class LuaValue
-
-
- -
Returns:
name from type name list LuaValue.TYPE_NAMES - corresponding to the type of this value: - "nil", "boolean", "number", "string", - "table", "function", "userdata", "thread"
See Also:
LuaValue.type()
-
-
-
- -

-hashCode

-
-public int hashCode()
-
-
-
Overrides:
hashCode in class java.lang.Object
-
-
-
-
-
-
- -

-userdata

-
-public java.lang.Object userdata()
-
-
-
-
-
-
- -

-isuserdata

-
-public boolean isuserdata()
-
-
Description copied from class: LuaValue
-
Check if this is a userdata -

-

-
Overrides:
isuserdata in class LuaValue
-
-
- -
Returns:
true if this is a userdata, otherwise false
See Also:
LuaValue.isuserdata(Class), -LuaValue.touserdata(), -LuaValue.checkuserdata(), -LuaValue.optuserdata(Object), -LuaValue.TUSERDATA
-
-
-
- -

-isuserdata

-
-public boolean isuserdata(java.lang.Class c)
-
-
Description copied from class: LuaValue
-
Check if this is a userdata of type c -

-

-
Overrides:
isuserdata in class LuaValue
-
-
-
Parameters:
c - Class to test instance against -
Returns:
true if this is a userdata - and the instance is assignable to c, - otherwise false
See Also:
LuaValue.isuserdata(), -LuaValue.touserdata(Class), -LuaValue.checkuserdata(Class), -#optuserdata(Object,Class), -LuaValue.TUSERDATA
-
-
-
- -

-touserdata

-
-public java.lang.Object touserdata()
-
-
Description copied from class: LuaValue
-
Convert to userdata instance, or null. -

-

-
Overrides:
touserdata in class LuaValue
-
-
- -
Returns:
userdata instance if userdata, or null if not LuaUserdata
See Also:
LuaValue.optuserdata(Object), -LuaValue.checkuserdata(), -LuaValue.isuserdata(), -LuaValue.TUSERDATA
-
-
-
- -

-touserdata

-
-public java.lang.Object touserdata(java.lang.Class c)
-
-
Description copied from class: LuaValue
-
Convert to userdata instance if specific type, or null. -

-

-
Overrides:
touserdata in class LuaValue
-
-
- -
Returns:
userdata instance if is a userdata whose instance derives from c, - or null if not LuaUserdata
See Also:
LuaValue.optuserdata(Class,Object), -LuaValue.checkuserdata(Class), -LuaValue.isuserdata(Class), -LuaValue.TUSERDATA
-
-
-
- -

-optuserdata

-
-public java.lang.Object optuserdata(java.lang.Object defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a userdata and return the Object instance -

-

-
Overrides:
optuserdata in class LuaValue
-
-
-
Parameters:
defval - Object to return if this is nil or none -
Returns:
Object instance of the userdata if a LuaUserdata, - defval if nil or none, - throws LuaError if some other type
See Also:
LuaValue.checkuserdata(), -LuaValue.isuserdata(), -LuaValue.optuserdata(Class, Object), -LuaValue.TUSERDATA
-
-
-
- -

-optuserdata

-
-public java.lang.Object optuserdata(java.lang.Class c,
-                                    java.lang.Object defval)
-
-
Description copied from class: LuaValue
-
Check that optional argument is a userdata whose instance is of a type - and return the Object instance -

-

-
Overrides:
optuserdata in class LuaValue
-
-
-
Parameters:
c - Class to test userdata instance against
defval - Object to return if this is nil or none -
Returns:
Object instance of the userdata if a LuaUserdata and instance is assignable to c, - defval if nil or none, - throws LuaError if some other type
See Also:
LuaValue.checkuserdata(Class), -LuaValue.isuserdata(Class), -LuaValue.optuserdata(Object), -LuaValue.TUSERDATA
-
-
-
- -

-getmetatable

-
-public LuaValue getmetatable()
-
-
Description copied from class: LuaValue
-
Get the metatable for this LuaValue -

- For LuaTable and LuaUserdata instances, - the metatable returned is this instance metatable. - For all other types, the class metatable value will be returned. -

-

-
Overrides:
getmetatable in class LuaValue
-
-
- -
Returns:
metatable, or null if it there is none
See Also:
LuaBoolean.s_metatable, -LuaNumber.s_metatable, -LuaNil.s_metatable, -LuaFunction.s_metatable, -LuaThread.s_metatable
-
-
-
- -

-setmetatable

-
-public LuaValue setmetatable(LuaValue metatable)
-
-
Description copied from class: LuaValue
-
Set the metatable for this LuaValue -

- For LuaTable and LuaUserdata instances, the metatable is per instance. - For all other types, there is one metatable per type that can be set directly from java -

-

-
Overrides:
setmetatable in class LuaValue
-
-
-
Parameters:
metatable - LuaValue instance to serve as the metatable, or null to reset it. -
Returns:
this to allow chaining of Java function calls
See Also:
LuaBoolean.s_metatable, -LuaNumber.s_metatable, -LuaNil.s_metatable, -LuaFunction.s_metatable, -LuaThread.s_metatable
-
-
-
- -

-checkuserdata

-
-public java.lang.Object checkuserdata()
-
-
Description copied from class: LuaValue
-
Check that this is a LuaUserdata, or throw LuaError if it is not -

-

-
Overrides:
checkuserdata in class LuaValue
-
-
- -
Returns:
this if it is a LuaUserdata
See Also:
LuaValue.isuserdata(), -LuaValue.optuserdata(Object), -LuaValue.checkuserdata(Class), -LuaValue.TUSERDATA
-
-
-
- -

-checkuserdata

-
-public java.lang.Object checkuserdata(java.lang.Class c)
-
-
Description copied from class: LuaValue
-
Check that this is a LuaUserdata, or throw LuaError if it is not -

-

-
Overrides:
checkuserdata in class LuaValue
-
-
- -
Returns:
this if it is a LuaUserdata
See Also:
LuaValue.isuserdata(Class), -LuaValue.optuserdata(Class, Object), -LuaValue.checkuserdata(), -LuaValue.TUSERDATA
-
-
-
- -

-get

-
-public LuaValue get(LuaValue key)
-
-
Description copied from class: LuaValue
-
Get a value in a table including metatag processing using INDEX. -

-

-
Overrides:
get in class LuaValue
-
-
-
Parameters:
key - the key to look up, must not be NIL or null -
Returns:
LuaValue for that key, or NIL if not found and no metatag
See Also:
LuaValue.get(int), -LuaValue.get(String), -LuaValue.rawget(LuaValue)
-
-
-
- -

-set

-
-public void set(LuaValue key,
-                LuaValue value)
-
-
Description copied from class: LuaValue
-
Set a value in a table without metatag processing using NEWINDEX. -

-

-
Overrides:
set in class LuaValue
-
-
-
Parameters:
key - the key to use, must not be NIL or null
value - the value to use, can be NIL, must not be null
-
-
-
- -

-equals

-
-public boolean equals(java.lang.Object val)
-
-
-
Overrides:
equals in class LuaValue
-
-
-
-
-
-
- -

-eq

-
-public LuaValue eq(LuaValue val)
-
-
Description copied from class: LuaValue
-
Equals: Perform equality comparison with another value - including metatag processing using EQ. -

-

-
Overrides:
eq in class LuaValue
-
-
-
Parameters:
val - The value to compare with. -
Returns:
TRUE if values are comparable and (this == rhs), - FALSE if comparable but not equal, - LuaValue if metatag processing occurs.
See Also:
LuaValue.eq_b(LuaValue), -LuaValue.raweq(LuaValue), -LuaValue.neq(LuaValue), -LuaValue.eqmtcall(LuaValue, LuaValue, LuaValue, LuaValue), -LuaValue.EQ
-
-
-
- -

-eq_b

-
-public boolean eq_b(LuaValue val)
-
-
Description copied from class: LuaValue
-
Equals: Perform equality comparison with another value - including metatag processing using EQ, - and return java boolean -

-

-
Overrides:
eq_b in class LuaValue
-
-
-
Parameters:
val - The value to compare with. -
Returns:
true if values are comparable and (this == rhs), - false if comparable but not equal, - result converted to java boolean if metatag processing occurs.
See Also:
LuaValue.eq(LuaValue), -LuaValue.raweq(LuaValue), -LuaValue.neq_b(LuaValue), -LuaValue.eqmtcall(LuaValue, LuaValue, LuaValue, LuaValue), -LuaValue.EQ
-
-
-
- -

-raweq

-
-public boolean raweq(LuaValue val)
-
-
Description copied from class: LuaValue
-
Equals: Perform direct equality comparison with another value - without metatag processing. -

-

-
Overrides:
raweq in class LuaValue
-
-
-
Parameters:
val - The value to compare with. -
Returns:
true if (this == rhs), false otherwise
See Also:
LuaValue.eq(LuaValue), -LuaValue.raweq(LuaUserdata), -LuaValue.raweq(LuaString), -LuaValue.raweq(double), -LuaValue.raweq(int), -LuaValue.EQ
-
-
-
- -

-raweq

-
-public boolean raweq(LuaUserdata val)
-
-
Description copied from class: LuaValue
-
Equals: Perform direct equality comparison with a LuaUserdata value - without metatag processing. -

-

-
Overrides:
raweq in class LuaValue
-
-
-
Parameters:
val - The LuaUserdata to compare with. -
Returns:
true if this is userdata - and their metatables are the same using == - and their instances are equal using LuaValue.equals(Object), - otherwise false
See Also:
LuaValue.eq(LuaValue), -LuaValue.raweq(LuaValue)
-
-
-
- -

-eqmt

-
-public boolean eqmt(LuaValue val)
-
-
-
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/LuaValue.html b/luaj-2.0.3/docs/api/org/luaj/vm2/LuaValue.html deleted file mode 100644 index 95ab7ad66..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/LuaValue.html +++ /dev/null @@ -1,8292 +0,0 @@ - - - - - - -LuaValue (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2 -
-Class LuaValue

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-
-
-
Direct Known Subclasses:
IoLib.File, LuaBoolean, LuaFunction, LuaNil, LuaNumber, LuaString, LuaTable, LuaThread, LuaUserdata
-
-
-
-
public abstract class LuaValue
extends Varargs
- - -

-Base class for all concrete lua type values. -

- Establishes base implementations for all the operations on lua types. - This allows Java clients to deal essentially with one type for all Java values, namely LuaValue. -

- Constructors are provided as static methods for common Java types, such as - valueOf(int) or valueOf(String) - to allow for instance pooling. -

- Constants are defined for the lua values - NIL, TRUE, and FALSE. - A constant NONE is defined which is a Varargs list having no values. -

- Operations are performed on values directly via their Java methods. - For example, the following code divides two numbers: -

 LuaValue a = LuaValue.valueOf( 5 );
- LuaValue b = LuaValue.valueOf( 4 );
- LuaValue c = a.div(b);
-  
- Note that in this example, c will be a LuaDouble, but would be a LuaInteger - if the value of a were changed to 8, say. - In general the value of c in practice will vary depending on both the types and values of a and b - as well as any metatable/metatag processing that occurs. -

- Field access and function calls are similar, with common overloads to simplify Java usage: -

 LuaValue globals = JsePlatform.standardGlobals();
- LuaValue sqrt = globals.get("math").get("sqrt");
- LuaValue print = globals.get("print");
- LuaValue d = sqrt.call( a );
- print.call( LuaValue.valueOf("sqrt(5):"), a );
-  
-

- To supply variable arguments or get multiple return values, use - invoke(Varargs) or invokemethod(LuaValue, Varargs) methods: -

 LuaValue modf = globals.get("math").get("modf");
- Varargs r = modf.invoke( d );
- print.call( r.arg(1), r.arg(2) );
-  
-

- To load and run a script, LoadState is used: -

 LoadState.load( new FileInputStream("main.lua"), "main.lua", globals ).call();
-  
-

- although require could also be used: -

 globals.get("require").call(LuaValue.valueOf("main"));
-  
- For this to work the file must be in the current directory, or in the class path, - dependening on the platform. - See JsePlatform and JmePlatform for details. -

- In general a LuaError may be thrown on any operation when the - types supplied to any operation are illegal from a lua perspective. - Examples could be attempting to concatenate a NIL value, or attempting arithmetic - on values that are not number. -

- There are several methods for preinitializing tables, such as: -

-

- Predefined constants exist for the standard lua type constants - TNIL, TBOOLEAN, TLIGHTUSERDATA, TNUMBER, TSTRING, - TTABLE, TFUNCTION, TUSERDATA, TTHREAD, - and extended lua type constants - TINT, TNONE, TVALUE -

- Predefined constants exist for all strings used as metatags: - INDEX, NEWINDEX, CALL, MODE, METATABLE, - ADD, SUB, DIV, MUL, POW, - MOD, UNM, LEN, EQ, LT, - LE, TOSTRING, and CONCAT. -

- -

-

-
See Also:
JsePlatform, -JmePlatform, -LoadState, -Varargs
-
- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Field Summary
-static LuaStringADD - -
-          LuaString constant with value "__add" for use as metatag
-static LuaStringCALL - -
-          LuaString constant with value "__call" for use as metatag
-static LuaStringCONCAT - -
-          LuaString constant with value "__concat" for use as metatag
-static LuaStringDIV - -
-          LuaString constant with value "__div" for use as metatag
-static LuaStringEMPTYSTRING - -
-          LuaString constant with value ""
-static LuaStringEQ - -
-          LuaString constant with value "__eq" for use as metatag
-static LuaBooleanFALSE - -
-          LuaBoolean constant corresponding to lua false
-static LuaStringINDEX - -
-          LuaString constant with value "__index" for use as metatag
-static LuaStringLE - -
-          LuaString constant with value "__le" for use as metatag
-static LuaStringLEN - -
-          LuaString constant with value "__len" for use as metatag
-static LuaStringLT - -
-          LuaString constant with value "__lt" for use as metatag
-static LuaStringMETATABLE - -
-          LuaString constant with value "__metatable" for use as metatag
-static LuaNumberMINUSONE - -
-          LuaValue number constant equal to -1
-static LuaStringMOD - -
-          LuaString constant with value "__mod" for use as metatag
-static LuaStringMODE - -
-          LuaString constant with value "__mode" for use as metatag
-static LuaStringMUL - -
-          LuaString constant with value "__mul" for use as metatag
-static LuaStringNEWINDEX - -
-          LuaString constant with value "__newindex" for use as metatag
-static LuaValueNIL - -
-          LuaValue constant corresponding to lua nil
-static LuaValue[]NILS - -
-          Array of NIL values to optimize filling stacks using System.arraycopy().
-static LuaValueNONE - -
-          LuaValue constant corresponding to a Varargs list of no values
-static LuaValue[]NOVALS - -
-          LuaValue array constant with no values
-static LuaNumberONE - -
-          LuaValue number constant equal to 1
-static LuaStringPOW - -
-          LuaString constant with value "__pow" for use as metatag
-static LuaStringSUB - -
-          LuaString constant with value "__sub" for use as metatag
-static intTBOOLEAN - -
-          Type enumeration constant for lua booleans
-static intTFUNCTION - -
-          Type enumeration constant for lua functions
-static intTINT - -
-          Type enumeration constant for lua numbers that are ints, for compatibility with lua 5.1 number patch only
-static intTLIGHTUSERDATA - -
-          Type enumeration constant for lua light userdata, for compatibility with C-based lua only
-static intTNIL - -
-          Type enumeration constant for lua nil
-static intTNONE - -
-          Type enumeration constant for lua values that have no type, for example weak table entries
-static intTNUMBER - -
-          Type enumeration constant for lua numbers
-static LuaStringTOSTRING - -
-          LuaString constant with value "__tostring" for use as metatag
-static LuaBooleanTRUE - -
-          LuaBoolean constant corresponding to lua true
-static intTSTRING - -
-          Type enumeration constant for lua strings
-static intTTABLE - -
-          Type enumeration constant for lua tables
-static intTTHREAD - -
-          Type enumeration constant for lua threads
-static intTUSERDATA - -
-          Type enumeration constant for lua userdatas
-static intTVALUE - -
-          Type enumeration constant for unknown values, for compatibility with C-based lua only
-static java.lang.String[]TYPE_NAMES - -
-          String array constant containing names of each of the lua value types
-static LuaStringUNM - -
-          LuaString constant with value "__unm" for use as metatag
-static LuaNumberZERO - -
-          LuaValue number constant equal to 0
-  - - - - - - - - - - -
-Constructor Summary
LuaValue() - -
-           
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
- LuaValueadd(double rhs) - -
-          Add: Perform numeric add operation with another value - of double type with metatag processing
- LuaValueadd(int rhs) - -
-          Add: Perform numeric add operation with another value - of int type with metatag processing
- LuaValueadd(LuaValue rhs) - -
-          Add: Perform numeric add operation with another value - including metatag processing.
- LuaValueand(LuaValue rhs) - -
-          Perform boolean and with another operand, based on lua rules for boolean evaluation.
- LuaValuearg(int index) - -
-          Get the n-th argument value (1-based).
- LuaValuearg1() - -
-          Get the first argument in the list.
-static LuaValueargerror(int iarg, - java.lang.String msg) - -
-          Throw a LuaError indicating an invalid argument was supplied to a function
-protected  LuaValueargerror(java.lang.String expected) - -
-          Throw a LuaError indicating an invalid argument was supplied to a function
-protected  LuaValuearitherror() - -
-          Throw a LuaError based on an arithmetic error such as add, or pow, - typically due to an invalid operand type
-protected  LuaValuearitherror(java.lang.String fun) - -
-          Throw a LuaError based on an arithmetic error such as add, or pow, - typically due to an invalid operand type
-protected  LuaValuearithmt(LuaValue tag, - LuaValue op2) - -
-          Perform metatag processing for arithmetic operations.
-protected  LuaValuearithmtwith(LuaValue tag, - double op1) - -
-          Perform metatag processing for arithmetic operations when the left-hand-side is a number.
-static voidassert_(boolean b, - java.lang.String msg) - -
-          Assert a condition is true, or throw a LuaError if not
- Bufferbuffer() - -
-          Convert the value to a Buffer for more efficient concatenation of - multiple strings.
- LuaValuecall() - -
-          Call this with 0 arguments, including metatag processing, - and return only the first return value.
- LuaValuecall(LuaValue arg) - -
-          Call this with 1 argument, including metatag processing, - and return only the first return value.
- LuaValuecall(LuaValue arg1, - LuaValue arg2) - -
-          Call this with 2 arguments, including metatag processing, - and return only the first return value.
- LuaValuecall(LuaValue arg1, - LuaValue arg2, - LuaValue arg3) - -
-          Call this with 3 arguments, including metatag processing, - and return only the first return value.
-protected  LuaValuecallmt() - -
-          Get the metatag value for the CALL metatag, if it exists.
- booleancheckboolean() - -
-          Check that the value is a LuaBoolean, - or throw LuaError if not
- LuaClosurecheckclosure() - -
-          Check that the value is a LuaClosure , - or throw LuaError if not
- doublecheckdouble() - -
-          Check that the value is numeric and return the value as a double, - or throw LuaError if not numeric
- LuaValuecheckfunction() - -
-          Check that the value is a function , or throw LuaError if not
- intcheckint() - -
-          Check that the value is numeric, and convert and cast value to int, or throw LuaError if not numeric
- LuaIntegercheckinteger() - -
-          Check that the value is numeric, and convert and cast value to int, or throw LuaError if not numeric
- java.lang.Stringcheckjstring() - -
-          Convert this value to a Java String.
- longchecklong() - -
-          Check that the value is numeric, and convert and cast value to long, or throw LuaError if not numeric
-protected  LuaValuecheckmetatag(LuaValue tag, - java.lang.String reason) - -
-          Get particular metatag, or throw LuaError if it doesn't exist
- LuaValuechecknotnil() - -
-          Check that this is not the value NIL, or throw LuaError if it is
- LuaNumberchecknumber() - -
-          Check that the value is numeric, and return as a LuaNumber if so, or throw LuaError
- LuaNumberchecknumber(java.lang.String msg) - -
-          Check that the value is numeric, and return as a LuaNumber if so, or throw LuaError
- LuaStringcheckstring() - -
-          Check that this is a lua string, or throw LuaError if it is not.
- LuaTablechecktable() - -
-          Check that this is a LuaTable, or throw LuaError if it is not
- LuaThreadcheckthread() - -
-          Check that this is a LuaThread, or throw LuaError if it is not
- java.lang.Objectcheckuserdata() - -
-          Check that this is a LuaUserdata, or throw LuaError if it is not
- java.lang.Objectcheckuserdata(java.lang.Class c) - -
-          Check that this is a LuaUserdata, or throw LuaError if it is not
- LuaValuecheckvalidkey() - -
-          Check that this is a valid key in a table index operation, or throw LuaError if not
-protected  LuaValuecompareerror(LuaValue rhs) - -
-          Throw a LuaError based on a comparison error such as greater-than or less-than, - typically due to an invalid operand type
-protected  LuaValuecompareerror(java.lang.String rhs) - -
-          Throw a LuaError based on a comparison error such as greater-than or less-than, - typically due to an invalid operand type
- LuaValuecomparemt(LuaValue tag, - LuaValue op1) - -
-          Perform metatag processing for comparison operations.
- Bufferconcat(Buffer rhs) - -
-          Concatenate a Buffer onto this value and return the result - using rules of lua string concatenation including metatag processing.
- LuaValueconcat(LuaValue rhs) - -
-          Concatenate another value onto this value and return the result - using rules of lua string concatenation including metatag processing.
- LuaValueconcatmt(LuaValue rhs) - -
-          Perform metatag processing for concatenation operations.
- LuaValueconcatTo(LuaNumber lhs) - -
-          Reverse-concatenation: concatenate this value onto another value - known to be a LuaNumber - and return the result using rules of lua string concatenation including - metatag processing.
- LuaValueconcatTo(LuaString lhs) - -
-          Reverse-concatenation: concatenate this value onto another value - known to be a LuaString - and return the result using rules of lua string concatenation including - metatag processing.
- LuaValueconcatTo(LuaValue lhs) - -
-          Reverse-concatenation: concatenate this value onto another value - whose type is unknwon - and return the result using rules of lua string concatenation including - metatag processing.
- LuaValuediv(double rhs) - -
-          Divide: Perform numeric divide operation by another value - of double type without metatag processing
- LuaValuediv(int rhs) - -
-          Divide: Perform numeric divide operation by another value - of int type without metatag processing
- LuaValuediv(LuaValue rhs) - -
-          Divide: Perform numeric divide operation by another value - of unknown type, - including metatag processing.
- LuaValuedivInto(double lhs) - -
-          Reverse-divide: Perform numeric divide operation into another value - with metatag processing
- booleaneq_b(LuaValue val) - -
-          Equals: Perform equality comparison with another value - including metatag processing using EQ, - and return java boolean
- LuaValueeq(LuaValue val) - -
-          Equals: Perform equality comparison with another value - including metatag processing using EQ.
-static booleaneqmtcall(LuaValue lhs, - LuaValue lhsmt, - LuaValue rhs, - LuaValue rhsmt) - -
-          Perform equality testing metatag processing
- booleanequals(java.lang.Object obj) - -
-           
-static LuaValueerror(java.lang.String message) - -
-          Throw a LuaError with a particular message
- LuaValueget(int key) - -
-          Get a value in a table including metatag processing using INDEX.
- LuaValueget(LuaValue key) - -
-          Get a value in a table including metatag processing using INDEX.
- LuaValueget(java.lang.String key) - -
-          Get a value in a table including metatag processing using INDEX.
- LuaValuegetfenv() - -
-          Get the environemnt for an instance.
- LuaValuegetmetatable() - -
-          Get the metatable for this LuaValue
- LuaValuegetn() - -
-          Implementation of lua 5.0 getn() function.
-protected static LuaValuegettable(LuaValue t, - LuaValue key) - -
-          get value from metatable operations, or NIL if not defined by metatables
- booleangt_b(double rhs) - -
-          Greater than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean.
- booleangt_b(int rhs) - -
-          Greater than: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean.
- booleangt_b(LuaValue rhs) - -
-          Greater than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean.
- LuaValuegt(double rhs) - -
-          Greater than: Perform numeric comparison with another value - of double type, - including metatag processing, and returning LuaValue.
- LuaValuegt(int rhs) - -
-          Greater than: Perform numeric comparison with another value - of int type, - including metatag processing, and returning LuaValue.
- LuaValuegt(LuaValue rhs) - -
-          Greater than: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue.
- booleangteq_b(double rhs) - -
-          Greater than or equals: Perform numeric comparison with another value - of double type, - including metatag processing, - and returning java boolean.
- booleangteq_b(int rhs) - -
-          Greater than or equals: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean.
- booleangteq_b(LuaValue rhs) - -
-          Greater than or equals: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean.
- LuaValuegteq(double rhs) - -
-          Greater than or equals: Perform numeric comparison with another value - of double type, - including metatag processing, and returning LuaValue.
- LuaValuegteq(int rhs) - -
-          Greater than or equals: Perform numeric comparison with another value - of int type, - including metatag processing, and returning LuaValue.
- LuaValuegteq(LuaValue rhs) - -
-          Greater than or equals: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue.
-protected  LuaValueillegal(java.lang.String op, - java.lang.String typename) - -
-          Throw a LuaError indicating an illegal operation occurred, - typically involved in managing weak references
- Varargsinext(LuaValue index) - -
-          Find the next integer-key,value pair if this is a table, - return NIL if there are no more, or throw a LuaError if not a table.
- Varargsinvoke() - -
-          Call this with 0 arguments, including metatag processing, - and retain all return values in a Varargs.
- Varargsinvoke(LuaValue[] args) - -
-          Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs.
- Varargsinvoke(LuaValue[] args, - Varargs varargs) - -
-          Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs.
- Varargsinvoke(LuaValue arg1, - LuaValue arg2, - Varargs varargs) - -
-          Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs.
- Varargsinvoke(LuaValue arg, - Varargs varargs) - -
-          Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs.
- Varargsinvoke(Varargs args) - -
-          Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs.
- Varargsinvokemethod(LuaValue name) - -
-          Call named method on this with 0 arguments, including metatag processing, - and retain all return values in a Varargs.
- Varargsinvokemethod(LuaValue name, - LuaValue[] args) - -
-          Call named method on this with variable arguments, including metatag processing, - and retain all return values in a Varargs.
- Varargsinvokemethod(LuaValue name, - Varargs args) - -
-          Call named method on this with variable arguments, including metatag processing, - and retain all return values in a Varargs.
- Varargsinvokemethod(java.lang.String name) - -
-          Call named method on this with 0 arguments, including metatag processing, - and retain all return values in a Varargs.
- Varargsinvokemethod(java.lang.String name, - LuaValue[] args) - -
-          Call named method on this with 1 argument, including metatag processing, - and retain all return values in a Varargs.
- Varargsinvokemethod(java.lang.String name, - Varargs args) - -
-          Call named method on this with 1 argument, including metatag processing, - and retain all return values in a Varargs.
- booleanisboolean() - -
-          Check if this is a boolean
- booleanisclosure() - -
-          Check if this is a function that is a closure, - meaning interprets lua bytecode for its execution
- booleanisfunction() - -
-          Check if this is a function
- booleanisint() - -
-          Check if this is a number and is representable by java int - without rounding or truncation
- booleanisinttype() - -
-          Check if this is a LuaInteger
- booleanislong() - -
-          Check if this is a number and is representable by java long - without rounding or truncation
- booleanisnil() - -
-          Check if this is nil
- booleanisnumber() - -
-          Check if this is a number
- booleanisstring() - -
-          Check if this is a string
- booleanistable() - -
-          Check if this is a table
- booleanisthread() - -
-          Check if this is a thread
- booleanisuserdata() - -
-          Check if this is a userdata
- booleanisuserdata(java.lang.Class c) - -
-          Check if this is a userdata of type c
- booleanisweaknil() - -
-          Test if this is a weak reference and its value no longer is referenced.
- LuaValuelen() - -
-          Length operator: return lua length of object (#this) including metatag processing as java int
-protected  LuaValuelenerror() - -
-          Throw a LuaError based on the len operator, - typically due to an invalid operand type
- intlength() - -
-          Length operator: return lua length of object (#this) including metatag processing as java int
-static LuaTablelistOf(LuaValue[] unnamedValues) - -
-          Construct a LuaTable initialized with supplied array values.
-static LuaTablelistOf(LuaValue[] unnamedValues, - Varargs lastarg) - -
-          Construct a LuaTable initialized with supplied array values.
- LuaValueload(LuaValue library) - -
-          Load a library instance by setting its environment to this - and calling it, which should iniitalize the library instance and - install itself into this instance.
- booleanlt_b(double rhs) - -
-          Less than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean.
- booleanlt_b(int rhs) - -
-          Less than: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean.
- booleanlt_b(LuaValue rhs) - -
-          Less than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean.
- LuaValuelt(double rhs) - -
-          Less than: Perform numeric comparison with another value - of double type, - including metatag processing, and returning LuaValue.
- LuaValuelt(int rhs) - -
-          Less than: Perform numeric comparison with another value - of int type, - including metatag processing, and returning LuaValue.
- LuaValuelt(LuaValue rhs) - -
-          Less than: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue.
- booleanlteq_b(double rhs) - -
-          Less than or equals: Perform numeric comparison with another value - of double type, - including metatag processing, - and returning java boolean.
- booleanlteq_b(int rhs) - -
-          Less than or equals: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean.
- booleanlteq_b(LuaValue rhs) - -
-          Less than or equals: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean.
- LuaValuelteq(double rhs) - -
-          Less than or equals: Perform numeric comparison with another value - of double type, - including metatag processing, and returning LuaValue.
- LuaValuelteq(int rhs) - -
-          Less than or equals: Perform numeric comparison with another value - of int type, - including metatag processing, and returning LuaValue.
- LuaValuelteq(LuaValue rhs) - -
-          Less than or equals: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue.
- LuaValuemetatag(LuaValue tag) - -
-          Get particular metatag, or return NIL if it doesn't exist
- LuaValuemethod(LuaValue name) - -
-          Call named method on this with 0 arguments, including metatag processing, - and return only the first return value.
- LuaValuemethod(LuaValue name, - LuaValue arg) - -
-          Call named method on this with 1 argument, including metatag processing, - and return only the first return value.
- LuaValuemethod(LuaValue name, - LuaValue arg1, - LuaValue arg2) - -
-          Call named method on this with 2 arguments, including metatag processing, - and return only the first return value.
- LuaValuemethod(java.lang.String name) - -
-          Call named method on this with 0 arguments, including metatag processing, - and return only the first return value.
- LuaValuemethod(java.lang.String name, - LuaValue arg) - -
-          Call named method on this with 1 argument, including metatag processing, - and return only the first return value.
- LuaValuemethod(java.lang.String name, - LuaValue arg1, - LuaValue arg2) - -
-          Call named method on this with 2 arguments, including metatag processing, - and return only the first return value.
- LuaValuemod(double rhs) - -
-          Modulo: Perform numeric modulo operation with another value - of double type without metatag processing
- LuaValuemod(int rhs) - -
-          Modulo: Perform numeric modulo operation with another value - of int type without metatag processing
- LuaValuemod(LuaValue rhs) - -
-          Modulo: Perform numeric modulo operation with another value - of unknown type, - including metatag processing.
- LuaValuemodFrom(double lhs) - -
-          Reverse-modulo: Perform numeric modulo operation from another value - with metatag processing
- LuaValuemul(double rhs) - -
-          Multiply: Perform numeric multiply operation with another value - of double type with metatag processing
- LuaValuemul(int rhs) - -
-          Multiply: Perform numeric multiply operation with another value - of int type with metatag processing
- LuaValuemul(LuaValue rhs) - -
-          Multiply: Perform numeric multiply operation with another value - of unknown type, - including metatag processing.
- intnarg() - -
-          Get the number of arguments, or 0 if there are none.
- LuaValueneg() - -
-          Unary minus: return negative value (-this) as defined by lua unary minus operator
- booleanneq_b(LuaValue val) - -
-          Notquals: Perform inequality comparison with another value - including metatag processing using EQ.
- LuaValueneq(LuaValue val) - -
-          Notquals: Perform inequality comparison with another value - including metatag processing using EQ.
- Varargsnext(LuaValue index) - -
-          Find the next key,value pair if this is a table, - return NIL if there are no more, or throw a LuaError if not a table.
- LuaValuenot() - -
-          Unary not: return inverse boolean value (~this) as defined by lua not operator
- VarargsonInvoke(Varargs args) - -
-          Callback used during tail call processing to invoke the function once.
- booleanoptboolean(boolean defval) - -
-          Check that optional argument is a boolean and return its boolean value
- LuaClosureoptclosure(LuaClosure defval) - -
-          Check that optional argument is a closure and return as LuaClosure
- doubleoptdouble(double defval) - -
-          Check that optional argument is a number or string convertible to number and return as double
- LuaFunctionoptfunction(LuaFunction defval) - -
-          Check that optional argument is a function and return as LuaFunction
- intoptint(int defval) - -
-          Check that optional argument is a number or string convertible to number and return as int
- LuaIntegeroptinteger(LuaInteger defval) - -
-          Check that optional argument is a number or string convertible to number and return as LuaInteger
- java.lang.Stringoptjstring(java.lang.String defval) - -
-          Check that optional argument is a string or number and return as Java String
- longoptlong(long defval) - -
-          Check that optional argument is a number or string convertible to number and return as long
- LuaNumberoptnumber(LuaNumber defval) - -
-          Check that optional argument is a number or string convertible to number and return as LuaNumber
- LuaStringoptstring(LuaString defval) - -
-          Check that optional argument is a string or number and return as LuaString
- LuaTableopttable(LuaTable defval) - -
-          Check that optional argument is a table and return as LuaTable
- LuaThreadoptthread(LuaThread defval) - -
-          Check that optional argument is a thread and return as LuaThread
- java.lang.Objectoptuserdata(java.lang.Class c, - java.lang.Object defval) - -
-          Check that optional argument is a userdata whose instance is of a type - and return the Object instance
- java.lang.Objectoptuserdata(java.lang.Object defval) - -
-          Check that optional argument is a userdata and return the Object instance
- LuaValueoptvalue(LuaValue defval) - -
-          Perform argument check that this is not nil or none.
- LuaValueor(LuaValue rhs) - -
-          Perform boolean or with another operand, based on lua rules for boolean evaluation.
- LuaValuepow(double rhs) - -
-          Raise to power: Raise this value to a power - of double type with metatag processing
- LuaValuepow(int rhs) - -
-          Raise to power: Raise this value to a power - of int type with metatag processing
- LuaValuepow(LuaValue rhs) - -
-          Raise to power: Raise this value to a power - including metatag processing.
- LuaValuepowWith(double lhs) - -
-          Reverse-raise to power: Raise another value of double type to this power - with metatag processing
- LuaValuepowWith(int lhs) - -
-          Reverse-raise to power: Raise another value of double type to this power - with metatag processing
- voidpresize(int i) - -
-          Preallocate the array part of a table to be a certain size,
- booleanraweq(double val) - -
-          Equals: Perform direct equality comparison with a double value - without metatag processing.
- booleanraweq(int val) - -
-          Equals: Perform direct equality comparison with a int value - without metatag processing.
- booleanraweq(LuaString val) - -
-          Equals: Perform direct equality comparison with a LuaString value - without metatag processing.
- booleanraweq(LuaUserdata val) - -
-          Equals: Perform direct equality comparison with a LuaUserdata value - without metatag processing.
- booleanraweq(LuaValue val) - -
-          Equals: Perform direct equality comparison with another value - without metatag processing.
- LuaValuerawget(int key) - -
-          Get a value in a table without metatag processing.
- LuaValuerawget(LuaValue key) - -
-          Get a value in a table without metatag processing.
- LuaValuerawget(java.lang.String key) - -
-          Get a value in a table without metatag processing.
- voidrawset(int key, - LuaValue value) - -
-          Set a value in a table without metatag processing.
- voidrawset(int key, - java.lang.String value) - -
-          Set a value in a table without metatag processing.
- voidrawset(LuaValue key, - LuaValue value) - -
-          Set a value in a table without metatag processing.
- voidrawset(java.lang.String key, - double value) - -
-          Set a value in a table without metatag processing.
- voidrawset(java.lang.String key, - int value) - -
-          Set a value in a table without metatag processing.
- voidrawset(java.lang.String key, - LuaValue value) - -
-          Set a value in a table without metatag processing.
- voidrawset(java.lang.String key, - java.lang.String value) - -
-          Set a value in a table without metatag processing.
- voidrawsetlist(int key0, - Varargs values) - -
-          Set list values in a table without invoking metatag processing
- voidset(int key, - LuaValue value) - -
-          Set a value in a table without metatag processing using NEWINDEX.
- voidset(int key, - java.lang.String value) - -
-          Set a value in a table without metatag processing using NEWINDEX.
- voidset(LuaValue key, - LuaValue value) - -
-          Set a value in a table without metatag processing using NEWINDEX.
- voidset(java.lang.String key, - double value) - -
-          Set a value in a table without metatag processing using NEWINDEX.
- voidset(java.lang.String key, - int value) - -
-          Set a value in a table without metatag processing using NEWINDEX.
- voidset(java.lang.String key, - LuaValue value) - -
-          Set a value in a table without metatag processing using NEWINDEX.
- voidset(java.lang.String key, - java.lang.String value) - -
-          Set a value in a table without metatag processing using NEWINDEX.
- voidsetfenv(LuaValue env) - -
-          Set the environment on an object.
- LuaValuesetmetatable(LuaValue metatable) - -
-          Set the metatable for this LuaValue
-protected static booleansettable(LuaValue t, - LuaValue key, - LuaValue value) - -
-          Perform field assignment including metatag processing.
- intstrcmp(LuaString rhs) - -
-          Perform string comparison with another value - known to be a LuaString - using string comparison based on byte values.
- intstrcmp(LuaValue rhs) - -
-          Perform string comparison with another value - of any type - using string comparison based on byte values.
- LuaValuestrongkey() - -
-          Return the key part of this value if it is a weak table entry, or NIL if it was weak and is no longer referenced.
- LuaValuestrongvalue() - -
-          Return this value as a strong reference, or NIL if it was weak and is no longer referenced.
- LuaStringstrvalue() - -
-          Convert this value to a string if it is a LuaString or LuaNumber, - or throw a LuaError if it is not
- LuaValuesub(double rhs) - -
-          Subtract: Perform numeric subtract operation with another value - of double type with metatag processing
- LuaValuesub(int rhs) - -
-          Subtract: Perform numeric subtract operation with another value - of int type with metatag processing
- LuaValuesub(LuaValue rhs) - -
-          Subtract: Perform numeric subtract operation with another value - of unknown type, - including metatag processing.
- LuaValuesubFrom(double lhs) - -
-          Reverse-subtract: Perform numeric subtract operation from an int value - with metatag processing
- LuaValuesubFrom(int lhs) - -
-          Reverse-subtract: Perform numeric subtract operation from a double value - without metatag processing
-static LuaTabletableOf() - -
-          Construct an empty LuaTable.
-static LuaTabletableOf(int narray, - int nhash) - -
-          Construct an empty LuaTable preallocated to hold array and hashed elements
-static LuaTabletableOf(LuaValue[] namedValues) - -
-          Construct a LuaTable initialized with supplied named values.
-static LuaTabletableOf(LuaValue[] namedValues, - LuaValue[] unnamedValues) - -
-          Construct a LuaTable initialized with supplied named values and sequential elements.
-static LuaTabletableOf(LuaValue[] namedValues, - LuaValue[] unnamedValues, - Varargs lastarg) - -
-          Construct a LuaTable initialized with supplied named values and sequential elements in an array part and as varargs.
-static LuaTabletableOf(Varargs varargs, - int firstarg) - -
-          Construct a LuaTable initialized with supplied array values.
-static VarargstailcallOf(LuaValue func, - Varargs args) - -
-          Construct a TailcallVarargs around a function and arguments.
- booleantestfor_b(LuaValue limit, - LuaValue step) - -
-          Perform end-condition test in for-loop processing.
- booleantoboolean() - -
-          Convert to boolean false if NIL or FALSE, true if anything else
- bytetobyte() - -
-          Convert to byte if numeric, or 0 if not.
- chartochar() - -
-          Convert to char if numeric, or 0 if not.
- doubletodouble() - -
-          Convert to double if numeric, or 0 if not.
- floattofloat() - -
-          Convert to float if numeric, or 0 if not.
- inttoint() - -
-          Convert to int if numeric, or 0 if not.
- java.lang.Stringtojstring() - -
-          Convert to human readable String for any type.
- longtolong() - -
-          Convert to long if numeric, or 0 if not.
- LuaValuetonumber() - -
-          Conditionally convert to lua number without throwing errors.
- shorttoshort() - -
-          Convert to short if numeric, or 0 if not.
- LuaValuetostring() - -
-          Conditionally convert to lua string without throwing errors.
- java.lang.StringtoString() - -
-          Convert the value to a human readable string using tojstring()
- java.lang.Objecttouserdata() - -
-          Convert to userdata instance, or null.
- java.lang.Objecttouserdata(java.lang.Class c) - -
-          Convert to userdata instance if specific type, or null.
-abstract  inttype() - -
-          Get the enumeration value for the type of this value.
-abstract  java.lang.Stringtypename() - -
-          Get the String name of the type of this value.
-protected  LuaValuetyperror(java.lang.String expected) - -
-          Throw a LuaError indicating an invalid type was supplied to a function
-protected  LuaValueunimplemented(java.lang.String fun) - -
-          Throw a LuaError indicating an operation is not implemented
-static LuaUserdatauserdataOf(java.lang.Object o) - -
-          Construct a LuaUserdata for an object.
-static LuaUserdatauserdataOf(java.lang.Object o, - LuaValue metatable) - -
-          Construct a LuaUserdata for an object with a user supplied metatable.
-static LuaBooleanvalueOf(boolean b) - -
-          Convert java boolean to a LuaValue.
-static LuaStringvalueOf(byte[] bytes) - -
-          Convert bytes in an array to a LuaValue.
-static LuaStringvalueOf(byte[] bytes, - int off, - int len) - -
-          Convert bytes in an array to a LuaValue.
-static LuaNumbervalueOf(double d) - -
-          Convert java double to a LuaValue.
-static LuaIntegervalueOf(int i) - -
-          Convert java int to a LuaValue.
-static LuaStringvalueOf(java.lang.String s) - -
-          Convert java string to a LuaValue.
-static VarargsvarargsOf(LuaValue[] v) - -
-          Construct a Varargs around an array of LuaValues.
-static VarargsvarargsOf(LuaValue[] v, - int offset, - int length) - -
-          Construct a Varargs around an array of LuaValues.
-static VarargsvarargsOf(LuaValue[] v, - int offset, - int length, - Varargs more) - -
-          Construct a Varargs around an array of LuaValues.
-static VarargsvarargsOf(LuaValue[] v, - Varargs r) - -
-          Construct a Varargs around an array of LuaValues.
-static VarargsvarargsOf(LuaValue v1, - LuaValue v2, - Varargs v3) - -
-          Construct a Varargs around a set of 3 or more LuaValues.
-static VarargsvarargsOf(LuaValue v, - Varargs r) - -
-          Construct a Varargs around a set of 2 or more LuaValues.
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Field Detail
- -

-TINT

-
-public static final int TINT
-
-
Type enumeration constant for lua numbers that are ints, for compatibility with lua 5.1 number patch only -

-

-
See Also:
Constant Field Values
-
-
- -

-TNONE

-
-public static final int TNONE
-
-
Type enumeration constant for lua values that have no type, for example weak table entries -

-

-
See Also:
Constant Field Values
-
-
- -

-TNIL

-
-public static final int TNIL
-
-
Type enumeration constant for lua nil -

-

-
See Also:
Constant Field Values
-
-
- -

-TBOOLEAN

-
-public static final int TBOOLEAN
-
-
Type enumeration constant for lua booleans -

-

-
See Also:
Constant Field Values
-
-
- -

-TLIGHTUSERDATA

-
-public static final int TLIGHTUSERDATA
-
-
Type enumeration constant for lua light userdata, for compatibility with C-based lua only -

-

-
See Also:
Constant Field Values
-
-
- -

-TNUMBER

-
-public static final int TNUMBER
-
-
Type enumeration constant for lua numbers -

-

-
See Also:
Constant Field Values
-
-
- -

-TSTRING

-
-public static final int TSTRING
-
-
Type enumeration constant for lua strings -

-

-
See Also:
Constant Field Values
-
-
- -

-TTABLE

-
-public static final int TTABLE
-
-
Type enumeration constant for lua tables -

-

-
See Also:
Constant Field Values
-
-
- -

-TFUNCTION

-
-public static final int TFUNCTION
-
-
Type enumeration constant for lua functions -

-

-
See Also:
Constant Field Values
-
-
- -

-TUSERDATA

-
-public static final int TUSERDATA
-
-
Type enumeration constant for lua userdatas -

-

-
See Also:
Constant Field Values
-
-
- -

-TTHREAD

-
-public static final int TTHREAD
-
-
Type enumeration constant for lua threads -

-

-
See Also:
Constant Field Values
-
-
- -

-TVALUE

-
-public static final int TVALUE
-
-
Type enumeration constant for unknown values, for compatibility with C-based lua only -

-

-
See Also:
Constant Field Values
-
-
- -

-TYPE_NAMES

-
-public static final java.lang.String[] TYPE_NAMES
-
-
String array constant containing names of each of the lua value types -

-

-
See Also:
type(), -typename()
-
-
- -

-NIL

-
-public static final LuaValue NIL
-
-
LuaValue constant corresponding to lua nil -

-

-
-
-
- -

-TRUE

-
-public static final LuaBoolean TRUE
-
-
LuaBoolean constant corresponding to lua true -

-

-
-
-
- -

-FALSE

-
-public static final LuaBoolean FALSE
-
-
LuaBoolean constant corresponding to lua false -

-

-
-
-
- -

-NONE

-
-public static final LuaValue NONE
-
-
LuaValue constant corresponding to a Varargs list of no values -

-

-
-
-
- -

-ZERO

-
-public static final LuaNumber ZERO
-
-
LuaValue number constant equal to 0 -

-

-
-
-
- -

-ONE

-
-public static final LuaNumber ONE
-
-
LuaValue number constant equal to 1 -

-

-
-
-
- -

-MINUSONE

-
-public static final LuaNumber MINUSONE
-
-
LuaValue number constant equal to -1 -

-

-
-
-
- -

-NOVALS

-
-public static final LuaValue[] NOVALS
-
-
LuaValue array constant with no values -

-

-
-
-
- -

-INDEX

-
-public static final LuaString INDEX
-
-
LuaString constant with value "__index" for use as metatag -

-

-
-
-
- -

-NEWINDEX

-
-public static final LuaString NEWINDEX
-
-
LuaString constant with value "__newindex" for use as metatag -

-

-
-
-
- -

-CALL

-
-public static final LuaString CALL
-
-
LuaString constant with value "__call" for use as metatag -

-

-
-
-
- -

-MODE

-
-public static final LuaString MODE
-
-
LuaString constant with value "__mode" for use as metatag -

-

-
-
-
- -

-METATABLE

-
-public static final LuaString METATABLE
-
-
LuaString constant with value "__metatable" for use as metatag -

-

-
-
-
- -

-ADD

-
-public static final LuaString ADD
-
-
LuaString constant with value "__add" for use as metatag -

-

-
-
-
- -

-SUB

-
-public static final LuaString SUB
-
-
LuaString constant with value "__sub" for use as metatag -

-

-
-
-
- -

-DIV

-
-public static final LuaString DIV
-
-
LuaString constant with value "__div" for use as metatag -

-

-
-
-
- -

-MUL

-
-public static final LuaString MUL
-
-
LuaString constant with value "__mul" for use as metatag -

-

-
-
-
- -

-POW

-
-public static final LuaString POW
-
-
LuaString constant with value "__pow" for use as metatag -

-

-
-
-
- -

-MOD

-
-public static final LuaString MOD
-
-
LuaString constant with value "__mod" for use as metatag -

-

-
-
-
- -

-UNM

-
-public static final LuaString UNM
-
-
LuaString constant with value "__unm" for use as metatag -

-

-
-
-
- -

-LEN

-
-public static final LuaString LEN
-
-
LuaString constant with value "__len" for use as metatag -

-

-
-
-
- -

-EQ

-
-public static final LuaString EQ
-
-
LuaString constant with value "__eq" for use as metatag -

-

-
-
-
- -

-LT

-
-public static final LuaString LT
-
-
LuaString constant with value "__lt" for use as metatag -

-

-
-
-
- -

-LE

-
-public static final LuaString LE
-
-
LuaString constant with value "__le" for use as metatag -

-

-
-
-
- -

-TOSTRING

-
-public static final LuaString TOSTRING
-
-
LuaString constant with value "__tostring" for use as metatag -

-

-
-
-
- -

-CONCAT

-
-public static final LuaString CONCAT
-
-
LuaString constant with value "__concat" for use as metatag -

-

-
-
-
- -

-EMPTYSTRING

-
-public static final LuaString EMPTYSTRING
-
-
LuaString constant with value "" -

-

-
-
-
- -

-NILS

-
-public static final LuaValue[] NILS
-
-
Array of NIL values to optimize filling stacks using System.arraycopy(). - Must not be modified. -

-

-
-
- - - - - - - - -
-Constructor Detail
- -

-LuaValue

-
-public LuaValue()
-
-
- - - - - - - - -
-Method Detail
- -

-type

-
-public abstract int type()
-
-
Get the enumeration value for the type of this value. -

-

- -
Returns:
value for this type, one of - TNIL, - TBOOLEAN, - TNUMBER, - TSTRING, - TTABLE, - TFUNCTION, - TUSERDATA, - TTHREAD
See Also:
typename()
-
-
-
- -

-typename

-
-public abstract java.lang.String typename()
-
-
Get the String name of the type of this value. -

-

-

- -
Returns:
name from type name list TYPE_NAMES - corresponding to the type of this value: - "nil", "boolean", "number", "string", - "table", "function", "userdata", "thread"
See Also:
type()
-
-
-
- -

-isboolean

-
-public boolean isboolean()
-
-
Check if this is a boolean -

-

- -
Returns:
true if this is a boolean, otherwise false
See Also:
isboolean(), -toboolean(), -checkboolean(), -optboolean(boolean), -#TOBOLEAN
-
-
-
- -

-isclosure

-
-public boolean isclosure()
-
-
Check if this is a function that is a closure, - meaning interprets lua bytecode for its execution -

-

- -
Returns:
true if this is a closure, otherwise false
See Also:
isfunction(), -checkclosure(), -optclosure(LuaClosure), -TFUNCTION
-
-
-
- -

-isfunction

-
-public boolean isfunction()
-
-
Check if this is a function -

-

- -
Returns:
true if this is a function, otherwise false
See Also:
isclosure(), -checkfunction(), -#optfunciton(LuaFunction), -TFUNCTION
-
-
-
- -

-isint

-
-public boolean isint()
-
-
Check if this is a number and is representable by java int - without rounding or truncation -

-

- -
Returns:
true if this is a number - meaning derives from LuaNumber - or derives from LuaString and is convertible to a number, - and can be represented by int, - otherwise false
See Also:
isinttype(), -islong(), -tonumber(), -checkint(), -optint(int), -TNUMBER
-
-
-
- -

-isinttype

-
-public boolean isinttype()
-
-
Check if this is a LuaInteger -

- No attempt to convert from string will be made by this call. -

-

- -
Returns:
true if this is a LuaInteger, - otherwise false
See Also:
isint(), -isnumber(), -tonumber(), -TNUMBER
-
-
-
- -

-islong

-
-public boolean islong()
-
-
Check if this is a number and is representable by java long - without rounding or truncation -

-

- -
Returns:
true if this is a number - meaning derives from LuaNumber - or derives from LuaString and is convertible to a number, - and can be represented by long, - otherwise false
See Also:
tonumber(), -checklong(), -optlong(long), -TNUMBER
-
-
-
- -

-isnil

-
-public boolean isnil()
-
-
Check if this is nil -

-

- -
Returns:
true if this is nil, otherwise false
See Also:
NIL, -NONE, -checknotnil(), -optvalue(LuaValue), -Varargs.isnoneornil(int), -TNIL, -TNONE
-
-
-
- -

-isnumber

-
-public boolean isnumber()
-
-
Check if this is a number -

-

- -
Returns:
true if this is a number, - meaning derives from LuaNumber - or derives from LuaString and is convertible to a number, - otherwise false
See Also:
tonumber(), -checknumber(), -optnumber(LuaNumber), -TNUMBER
-
-
-
- -

-isstring

-
-public boolean isstring()
-
-
Check if this is a string -

-

- -
Returns:
true if this is a string, - meaning derives from LuaString or LuaNumber, - otherwise false
See Also:
tostring(), -checkstring(), -optstring(LuaString), -TSTRING
-
-
-
- -

-isthread

-
-public boolean isthread()
-
-
Check if this is a thread -

-

- -
Returns:
true if this is a thread, otherwise false
See Also:
checkthread(), -optthread(LuaThread), -TTHREAD
-
-
-
- -

-istable

-
-public boolean istable()
-
-
Check if this is a table -

-

- -
Returns:
true if this is a table, otherwise false
See Also:
checktable(), -opttable(LuaTable), -TTABLE
-
-
-
- -

-isuserdata

-
-public boolean isuserdata()
-
-
Check if this is a userdata -

-

- -
Returns:
true if this is a userdata, otherwise false
See Also:
isuserdata(Class), -touserdata(), -checkuserdata(), -optuserdata(Object), -TUSERDATA
-
-
-
- -

-isuserdata

-
-public boolean isuserdata(java.lang.Class c)
-
-
Check if this is a userdata of type c -

-

-
Parameters:
c - Class to test instance against -
Returns:
true if this is a userdata - and the instance is assignable to c, - otherwise false
See Also:
isuserdata(), -touserdata(Class), -checkuserdata(Class), -#optuserdata(Object,Class), -TUSERDATA
-
-
-
- -

-toboolean

-
-public boolean toboolean()
-
-
Convert to boolean false if NIL or FALSE, true if anything else -

-

- -
Returns:
Value cast to byte if number or string convertible to number, otherwise 0
See Also:
optboolean(boolean), -checkboolean(), -isboolean(), -TBOOLEAN
-
-
-
- -

-tobyte

-
-public byte tobyte()
-
-
Convert to byte if numeric, or 0 if not. -

-

- -
Returns:
Value cast to byte if number or string convertible to number, otherwise 0
See Also:
toint(), -todouble(), -#optbyte(byte), -checknumber(), -isnumber(), -TNUMBER
-
-
-
- -

-tochar

-
-public char tochar()
-
-
Convert to char if numeric, or 0 if not. -

-

- -
Returns:
Value cast to char if number or string convertible to number, otherwise 0
See Also:
toint(), -todouble(), -#optchar(char), -checknumber(), -isnumber(), -TNUMBER
-
-
-
- -

-todouble

-
-public double todouble()
-
-
Convert to double if numeric, or 0 if not. -

-

- -
Returns:
Value cast to double if number or string convertible to number, otherwise 0
See Also:
toint(), -tobyte(), -tochar(), -toshort(), -tolong(), -tofloat(), -optdouble(double), -checknumber(), -isnumber(), -TNUMBER
-
-
-
- -

-tofloat

-
-public float tofloat()
-
-
Convert to float if numeric, or 0 if not. -

-

- -
Returns:
Value cast to float if number or string convertible to number, otherwise 0
See Also:
toint(), -todouble(), -#optfloat(float), -checknumber(), -isnumber(), -TNUMBER
-
-
-
- -

-toint

-
-public int toint()
-
-
Convert to int if numeric, or 0 if not. -

-

- -
Returns:
Value cast to int if number or string convertible to number, otherwise 0
See Also:
tobyte(), -tochar(), -toshort(), -tolong(), -tofloat(), -todouble(), -optint(int), -checknumber(), -isnumber(), -TNUMBER
-
-
-
- -

-tolong

-
-public long tolong()
-
-
Convert to long if numeric, or 0 if not. -

-

- -
Returns:
Value cast to long if number or string convertible to number, otherwise 0
See Also:
isint(), -isinttype(), -toint(), -todouble(), -optlong(long), -checknumber(), -isnumber(), -TNUMBER
-
-
-
- -

-toshort

-
-public short toshort()
-
-
Convert to short if numeric, or 0 if not. -

-

- -
Returns:
Value cast to short if number or string convertible to number, otherwise 0
See Also:
toint(), -todouble(), -#optshort(short), -checknumber(), -isnumber(), -TNUMBER
-
-
-
- -

-tojstring

-
-public java.lang.String tojstring()
-
-
Convert to human readable String for any type. -

-

-
Overrides:
tojstring in class Varargs
-
-
- -
Returns:
String for use by human readers based on type.
See Also:
tostring(), -optjstring(String), -checkjstring(), -isstring(), -TSTRING
-
-
-
- -

-touserdata

-
-public java.lang.Object touserdata()
-
-
Convert to userdata instance, or null. -

-

- -
Returns:
userdata instance if userdata, or null if not LuaUserdata
See Also:
optuserdata(Object), -checkuserdata(), -isuserdata(), -TUSERDATA
-
-
-
- -

-touserdata

-
-public java.lang.Object touserdata(java.lang.Class c)
-
-
Convert to userdata instance if specific type, or null. -

-

- -
Returns:
userdata instance if is a userdata whose instance derives from c, - or null if not LuaUserdata
See Also:
optuserdata(Class,Object), -checkuserdata(Class), -isuserdata(Class), -TUSERDATA
-
-
-
- -

-toString

-
-public java.lang.String toString()
-
-
Convert the value to a human readable string using tojstring() -

-

-
Overrides:
toString in class Varargs
-
-
- -
Returns:
String value intended to be human readible.
See Also:
tostring(), -tojstring(), -optstring(LuaString), -checkstring(), -toString()
-
-
-
- -

-tonumber

-
-public LuaValue tonumber()
-
-
Conditionally convert to lua number without throwing errors. -

- In lua all numbers are strings, but not all strings are numbers. - This function will return - the LuaValue this if it is a number - or a string convertible to a number, - and NIL for all other cases. -

- This allows values to be tested for their "numeric-ness" without - the penalty of throwing exceptions, - nor the cost of converting the type and creating storage for it. -

-

- -
Returns:
this if it is a LuaNumber - or LuaString that can be converted to a number, - otherwise NIL
See Also:
tostring(), -optnumber(LuaNumber), -checknumber(), -toint(), -todouble()
-
-
-
- -

-tostring

-
-public LuaValue tostring()
-
-
Conditionally convert to lua string without throwing errors. -

- In lua all numbers are strings, so this function will return - the LuaValue this if it is a string or number, - and NIL for all other cases. -

- This allows values to be tested for their "string-ness" without - the penalty of throwing exceptions. -

-

- -
Returns:
this if it is a LuaString or LuaNumber, - otherwise NIL
See Also:
tonumber(), -tojstring(), -optstring(LuaString), -checkstring(), -toString()
-
-
-
- -

-optboolean

-
-public boolean optboolean(boolean defval)
-
-
Check that optional argument is a boolean and return its boolean value -

-

-
Parameters:
defval - boolean value to return if this is nil or none -
Returns:
this cast to boolean if a , - defval if nil or none, - throws LuaError otherwise -
Throws: -
LuaError - if was not a boolean or nil or none.
See Also:
checkboolean(), -isboolean(), -TBOOLEAN
-
-
-
- -

-optclosure

-
-public LuaClosure optclosure(LuaClosure defval)
-
-
Check that optional argument is a closure and return as LuaClosure -

- A LuaClosure is a that executes lua byteccode. -

-

-
Parameters:
defval - LuaClosure to return if this is nil or none -
Returns:
this cast to LuaClosure if a function, - defval if nil or none, - throws LuaError otherwise -
Throws: -
LuaError - if was not a closure or nil or none.
See Also:
checkclosure(), -isclosure(), -TFUNCTION
-
-
-
- -

-optdouble

-
-public double optdouble(double defval)
-
-
Check that optional argument is a number or string convertible to number and return as double -

-

-
Parameters:
defval - double to return if this is nil or none -
Returns:
this cast to double if numeric, - defval if nil or none, - throws LuaError otherwise -
Throws: -
LuaError - if was not numeric or nil or none.
See Also:
optint(int), -optinteger(LuaInteger), -checkdouble(), -todouble(), -tonumber(), -isnumber(), -TNUMBER
-
-
-
- -

-optfunction

-
-public LuaFunction optfunction(LuaFunction defval)
-
-
Check that optional argument is a function and return as LuaFunction -

- A LuaFunction may either be a Java function that implements - functionality directly in Java, - or a LuaClosure - which is a LuaFunction that executes lua bytecode. -

-

-
Parameters:
defval - LuaFunction to return if this is nil or none -
Returns:
this cast to LuaFunction if a function, - defval if nil or none, - throws LuaError otherwise -
Throws: -
LuaError - if was not a function or nil or none.
See Also:
checkfunction(), -isfunction(), -TFUNCTION
-
-
-
- -

-optint

-
-public int optint(int defval)
-
-
Check that optional argument is a number or string convertible to number and return as int -

-

-
Parameters:
defval - int to return if this is nil or none -
Returns:
this cast to int if numeric, - defval if nil or none, - throws LuaError otherwise -
Throws: -
LuaError - if was not numeric or nil or none.
See Also:
optdouble(double), -optlong(long), -optinteger(LuaInteger), -checkint(), -toint(), -tonumber(), -isnumber(), -TNUMBER
-
-
-
- -

-optinteger

-
-public LuaInteger optinteger(LuaInteger defval)
-
-
Check that optional argument is a number or string convertible to number and return as LuaInteger -

-

-
Parameters:
defval - LuaInteger to return if this is nil or none -
Returns:
this converted and wrapped in LuaInteger if numeric, - defval if nil or none, - throws LuaError otherwise -
Throws: -
LuaError - if was not numeric or nil or none.
See Also:
optdouble(double), -optint(int), -checkint(), -toint(), -tonumber(), -isnumber(), -TNUMBER
-
-
-
- -

-optlong

-
-public long optlong(long defval)
-
-
Check that optional argument is a number or string convertible to number and return as long -

-

-
Parameters:
defval - long to return if this is nil or none -
Returns:
this cast to long if numeric, - defval if nil or none, - throws LuaError otherwise -
Throws: -
LuaError - if was not numeric or nil or none.
See Also:
optdouble(double), -optint(int), -checkint(), -toint(), -tonumber(), -isnumber(), -TNUMBER
-
-
-
- -

-optnumber

-
-public LuaNumber optnumber(LuaNumber defval)
-
-
Check that optional argument is a number or string convertible to number and return as LuaNumber -

-

-
Parameters:
defval - LuaNumber to return if this is nil or none -
Returns:
this cast to LuaNumber if numeric, - defval if nil or none, - throws LuaError otherwise -
Throws: -
LuaError - if was not numeric or nil or none.
See Also:
optdouble(double), -optlong(long), -optint(int), -checkint(), -toint(), -tonumber(), -isnumber(), -TNUMBER
-
-
-
- -

-optjstring

-
-public java.lang.String optjstring(java.lang.String defval)
-
-
Check that optional argument is a string or number and return as Java String -

-

-
Parameters:
defval - LuaString to return if this is nil or none -
Returns:
this converted to String if a string or number, - defval if nil or none, - throws LuaError if some other type -
Throws: -
LuaError - if was not a string or number or nil or none.
See Also:
tojstring(), -optstring(LuaString), -checkjstring(), -toString(), -TSTRING
-
-
-
- -

-optstring

-
-public LuaString optstring(LuaString defval)
-
-
Check that optional argument is a string or number and return as LuaString -

-

-
Parameters:
defval - LuaString to return if this is nil or none -
Returns:
this converted to LuaString if a string or number, - defval if nil or none, - throws LuaError if some other type -
Throws: -
LuaError - if was not a string or number or nil or none.
See Also:
tojstring(), -optjstring(String), -checkstring(), -toString(), -TSTRING
-
-
-
- -

-opttable

-
-public LuaTable opttable(LuaTable defval)
-
-
Check that optional argument is a table and return as LuaTable -

-

-
Parameters:
defval - LuaTable to return if this is nil or none -
Returns:
this cast to LuaTable if a table, - defval if nil or none, - throws LuaError if some other type -
Throws: -
LuaError - if was not a table or nil or none.
See Also:
checktable(), -istable(), -TTABLE
-
-
-
- -

-optthread

-
-public LuaThread optthread(LuaThread defval)
-
-
Check that optional argument is a thread and return as LuaThread -

-

-
Parameters:
defval - LuaThread to return if this is nil or none -
Returns:
this cast to LuaTable if a thread, - defval if nil or none, - throws LuaError if some other type -
Throws: -
LuaError - if was not a thread or nil or none.
See Also:
checkthread(), -isthread(), -TTHREAD
-
-
-
- -

-optuserdata

-
-public java.lang.Object optuserdata(java.lang.Object defval)
-
-
Check that optional argument is a userdata and return the Object instance -

-

-
Parameters:
defval - Object to return if this is nil or none -
Returns:
Object instance of the userdata if a LuaUserdata, - defval if nil or none, - throws LuaError if some other type -
Throws: -
LuaError - if was not a userdata or nil or none.
See Also:
checkuserdata(), -isuserdata(), -optuserdata(Class, Object), -TUSERDATA
-
-
-
- -

-optuserdata

-
-public java.lang.Object optuserdata(java.lang.Class c,
-                                    java.lang.Object defval)
-
-
Check that optional argument is a userdata whose instance is of a type - and return the Object instance -

-

-
Parameters:
c - Class to test userdata instance against
defval - Object to return if this is nil or none -
Returns:
Object instance of the userdata if a LuaUserdata and instance is assignable to c, - defval if nil or none, - throws LuaError if some other type -
Throws: -
LuaError - if was not a userdata whose instance is assignable to c or nil or none.
See Also:
checkuserdata(Class), -isuserdata(Class), -optuserdata(Object), -TUSERDATA
-
-
-
- -

-optvalue

-
-public LuaValue optvalue(LuaValue defval)
-
-
Perform argument check that this is not nil or none. -

-

-
Parameters:
defval - LuaValue to return if this is nil or none -
Returns:
this if not nil or none, else defval
See Also:
NIL, -NONE, -isnil(), -Varargs.isnoneornil(int), -TNIL, -TNONE
-
-
-
- -

-checkboolean

-
-public boolean checkboolean()
-
-
Check that the value is a LuaBoolean, - or throw LuaError if not -

-

- -
Returns:
boolean value for this if it is a LuaBoolean -
Throws: -
LuaError - if not a LuaBoolean
See Also:
optboolean(boolean), -TBOOLEAN
-
-
-
- -

-checkclosure

-
-public LuaClosure checkclosure()
-
-
Check that the value is a LuaClosure , - or throw LuaError if not -

- LuaClosure is a subclass of that interprets lua bytecode. -

-

- -
Returns:
this cast as LuaClosure -
Throws: -
LuaError - if not a LuaClosure
See Also:
checkfunction(), -optclosure(LuaClosure), -isclosure(), -TFUNCTION
-
-
-
- -

-checkdouble

-
-public double checkdouble()
-
-
Check that the value is numeric and return the value as a double, - or throw LuaError if not numeric -

- Values that are LuaNumber and values that are LuaString - that can be converted to a number will be converted to double. -

-

- -
Returns:
value cast to a double if numeric -
Throws: -
LuaError - if not a LuaNumber or is a LuaString that can't be converted to number
See Also:
checkint(), -checkinteger(), -checklong(), -optdouble(double), -TNUMBER
-
-
-
- -

-checkfunction

-
-public LuaValue checkfunction()
-
-
Check that the value is a function , or throw LuaError if not -

- A function is considered anything whose type() returns TFUNCTION. - In practice it will be either a built-in Java function, typically deriving from - LuaFunction or a LuaClosure which represents lua source compiled - into lua bytecode. -

-

- -
Returns:
this if if a lua function or closure -
Throws: -
LuaError - if not a function
See Also:
checkclosure()
-
-
-
- -

-checkint

-
-public int checkint()
-
-
Check that the value is numeric, and convert and cast value to int, or throw LuaError if not numeric -

- Values that are LuaNumber will be cast to int and may lose precision. - Values that are LuaString that can be converted to a number will be converted, - then cast to int, so may also lose precision. -

-

- -
Returns:
value cast to a int if numeric -
Throws: -
LuaError - if not a LuaNumber or is a LuaString that can't be converted to number
See Also:
checkinteger(), -checklong(), -checkdouble(), -optint(int), -TNUMBER
-
-
-
- -

-checkinteger

-
-public LuaInteger checkinteger()
-
-
Check that the value is numeric, and convert and cast value to int, or throw LuaError if not numeric -

- Values that are LuaNumber will be cast to int and may lose precision. - Values that are LuaString that can be converted to a number will be converted, - then cast to int, so may also lose precision. -

-

- -
Returns:
value cast to a int and wrapped in LuaInteger if numeric -
Throws: -
LuaError - if not a LuaNumber or is a LuaString that can't be converted to number
See Also:
checkint(), -checklong(), -checkdouble(), -optinteger(LuaInteger), -TNUMBER
-
-
-
- -

-checklong

-
-public long checklong()
-
-
Check that the value is numeric, and convert and cast value to long, or throw LuaError if not numeric -

- Values that are LuaNumber will be cast to long and may lose precision. - Values that are LuaString that can be converted to a number will be converted, - then cast to long, so may also lose precision. -

-

- -
Returns:
value cast to a long if numeric -
Throws: -
LuaError - if not a LuaNumber or is a LuaString that can't be converted to number
See Also:
checkint(), -checkinteger(), -checkdouble(), -optlong(long), -TNUMBER
-
-
-
- -

-checknumber

-
-public LuaNumber checknumber()
-
-
Check that the value is numeric, and return as a LuaNumber if so, or throw LuaError -

- Values that are LuaString that can be converted to a number will be converted and returned. -

-

- -
Returns:
value as a LuaNumber if numeric -
Throws: -
LuaError - if not a LuaNumber or is a LuaString that can't be converted to number
See Also:
checkint(), -checkinteger(), -checkdouble(), -checklong(), -optnumber(LuaNumber), -TNUMBER
-
-
-
- -

-checknumber

-
-public LuaNumber checknumber(java.lang.String msg)
-
-
Check that the value is numeric, and return as a LuaNumber if so, or throw LuaError -

- Values that are LuaString that can be converted to a number will be converted and returned. -

-

-
Parameters:
msg - String message to supply if conversion fails -
Returns:
value as a LuaNumber if numeric -
Throws: -
LuaError - if not a LuaNumber or is a LuaString that can't be converted to number
See Also:
checkint(), -checkinteger(), -checkdouble(), -checklong(), -optnumber(LuaNumber), -TNUMBER
-
-
-
- -

-checkjstring

-
-public java.lang.String checkjstring()
-
-
Convert this value to a Java String. -

- The string representations here will roughly match what is produced by the - C lua distribution, however hash codes have no relationship, - and there may be differences in number formatting. -

-

- -
Returns:
String representation of the value
See Also:
checkstring(), -optjstring(String), -tojstring(), -isstring(), -TSTRING
-
-
-
- -

-checkstring

-
-public LuaString checkstring()
-
-
Check that this is a lua string, or throw LuaError if it is not. -

- In lua all numbers are strings, so this will succeed for - anything that derives from LuaString or LuaNumber. - Numbers will be converted to LuaString. -

-

- -
Returns:
LuaString representation of the value if it is a LuaString or LuaNumber -
Throws: -
LuaError - if this is not a LuaTable
See Also:
checkjstring(), -optstring(LuaString), -tostring(), -isstring(), -TSTRING
-
-
-
- -

-checktable

-
-public LuaTable checktable()
-
-
Check that this is a LuaTable, or throw LuaError if it is not -

-

- -
Returns:
this if it is a LuaTable -
Throws: -
LuaError - if this is not a LuaTable
See Also:
istable(), -opttable(LuaTable), -TTABLE
-
-
-
- -

-checkthread

-
-public LuaThread checkthread()
-
-
Check that this is a LuaThread, or throw LuaError if it is not -

-

- -
Returns:
this if it is a LuaThread -
Throws: -
LuaError - if this is not a LuaThread
See Also:
isthread(), -optthread(LuaThread), -TTHREAD
-
-
-
- -

-checkuserdata

-
-public java.lang.Object checkuserdata()
-
-
Check that this is a LuaUserdata, or throw LuaError if it is not -

-

- -
Returns:
this if it is a LuaUserdata -
Throws: -
LuaError - if this is not a LuaUserdata
See Also:
isuserdata(), -optuserdata(Object), -checkuserdata(Class), -TUSERDATA
-
-
-
- -

-checkuserdata

-
-public java.lang.Object checkuserdata(java.lang.Class c)
-
-
Check that this is a LuaUserdata, or throw LuaError if it is not -

-

- -
Returns:
this if it is a LuaUserdata -
Throws: -
LuaError - if this is not a LuaUserdata
See Also:
isuserdata(Class), -optuserdata(Class, Object), -checkuserdata(), -TUSERDATA
-
-
-
- -

-checknotnil

-
-public LuaValue checknotnil()
-
-
Check that this is not the value NIL, or throw LuaError if it is -

-

- -
Returns:
this if it is not NIL -
Throws: -
LuaError - if this is NIL
See Also:
optvalue(LuaValue)
-
-
-
- -

-checkvalidkey

-
-public LuaValue checkvalidkey()
-
-
Check that this is a valid key in a table index operation, or throw LuaError if not -

-

- -
Returns:
this if valid as a table key -
Throws: -
LuaError - if not valid as a table key
See Also:
isnil(), -isinttype()
-
-
-
- -

-error

-
-public static LuaValue error(java.lang.String message)
-
-
Throw a LuaError with a particular message -

-

-
Parameters:
message - String providing message details -
Throws: -
LuaError - in all cases
-
-
-
- -

-assert_

-
-public static void assert_(boolean b,
-                           java.lang.String msg)
-
-
Assert a condition is true, or throw a LuaError if not -

-

-
Parameters:
b - condition to test -
Throws: -
LuaError - if b is not true
-
-
-
- -

-argerror

-
-protected LuaValue argerror(java.lang.String expected)
-
-
Throw a LuaError indicating an invalid argument was supplied to a function -

-

-
Parameters:
expected - String naming the type that was expected -
Throws: -
LuaError - in all cases
-
-
-
- -

-argerror

-
-public static LuaValue argerror(int iarg,
-                                java.lang.String msg)
-
-
Throw a LuaError indicating an invalid argument was supplied to a function -

-

-
Parameters:
iarg - index of the argument that was invalid, first index is 1
msg - String providing information about the invalid argument -
Throws: -
LuaError - in all cases
-
-
-
- -

-typerror

-
-protected LuaValue typerror(java.lang.String expected)
-
-
Throw a LuaError indicating an invalid type was supplied to a function -

-

-
Parameters:
expected - String naming the type that was expected -
Throws: -
LuaError - in all cases
-
-
-
- -

-unimplemented

-
-protected LuaValue unimplemented(java.lang.String fun)
-
-
Throw a LuaError indicating an operation is not implemented -

-

- -
Throws: -
LuaError - in all cases
-
-
-
- -

-illegal

-
-protected LuaValue illegal(java.lang.String op,
-                           java.lang.String typename)
-
-
Throw a LuaError indicating an illegal operation occurred, - typically involved in managing weak references -

-

- -
Throws: -
LuaError - in all cases
-
-
-
- -

-lenerror

-
-protected LuaValue lenerror()
-
-
Throw a LuaError based on the len operator, - typically due to an invalid operand type -

-

- -
Throws: -
LuaError - in all cases
-
-
-
- -

-aritherror

-
-protected LuaValue aritherror()
-
-
Throw a LuaError based on an arithmetic error such as add, or pow, - typically due to an invalid operand type -

-

- -
Throws: -
LuaError - in all cases
-
-
-
- -

-aritherror

-
-protected LuaValue aritherror(java.lang.String fun)
-
-
Throw a LuaError based on an arithmetic error such as add, or pow, - typically due to an invalid operand type -

-

-
Parameters:
fun - String description of the function that was attempted -
Throws: -
LuaError - in all cases
-
-
-
- -

-compareerror

-
-protected LuaValue compareerror(java.lang.String rhs)
-
-
Throw a LuaError based on a comparison error such as greater-than or less-than, - typically due to an invalid operand type -

-

-
Parameters:
rhs - String description of what was on the right-hand-side of the comparison that resulted in the error. -
Throws: -
LuaError - in all cases
-
-
-
- -

-compareerror

-
-protected LuaValue compareerror(LuaValue rhs)
-
-
Throw a LuaError based on a comparison error such as greater-than or less-than, - typically due to an invalid operand type -

-

-
Parameters:
rhs - Right-hand-side of the comparison that resulted in the error. -
Throws: -
LuaError - in all cases
-
-
-
- -

-get

-
-public LuaValue get(LuaValue key)
-
-
Get a value in a table including metatag processing using INDEX. -

-

-
Parameters:
key - the key to look up, must not be NIL or null -
Returns:
LuaValue for that key, or NIL if not found and no metatag -
Throws: -
LuaError - if this is not a table, - or there is no INDEX metatag, - or key is NIL
See Also:
get(int), -get(String), -rawget(LuaValue)
-
-
-
- -

-get

-
-public LuaValue get(int key)
-
-
Get a value in a table including metatag processing using INDEX. -

-

-
Parameters:
key - the key to look up -
Returns:
LuaValue for that key, or NIL if not found -
Throws: -
LuaError - if this is not a table, - or there is no INDEX metatag
See Also:
get(LuaValue), -rawget(int)
-
-
-
- -

-get

-
-public LuaValue get(java.lang.String key)
-
-
Get a value in a table including metatag processing using INDEX. -

-

-
Parameters:
key - the key to look up, must not be null -
Returns:
LuaValue for that key, or NIL if not found -
Throws: -
LuaError - if this is not a table, - or there is no INDEX metatag
See Also:
get(LuaValue), -rawget(String)
-
-
-
- -

-set

-
-public void set(LuaValue key,
-                LuaValue value)
-
-
Set a value in a table without metatag processing using NEWINDEX. -

-

-
Parameters:
key - the key to use, must not be NIL or null
value - the value to use, can be NIL, must not be null -
Throws: -
LuaError - if this is not a table, - or key is NIL, - or there is no NEWINDEX metatag
-
-
-
- -

-set

-
-public void set(int key,
-                LuaValue value)
-
-
Set a value in a table without metatag processing using NEWINDEX. -

-

-
Parameters:
key - the key to use
value - the value to use, can be NIL, must not be null -
Throws: -
LuaError - if this is not a table, - or there is no NEWINDEX metatag
-
-
-
- -

-set

-
-public void set(int key,
-                java.lang.String value)
-
-
Set a value in a table without metatag processing using NEWINDEX. -

-

-
Parameters:
key - the key to use
value - the value to use, must not be null -
Throws: -
LuaError - if this is not a table, - or there is no NEWINDEX metatag
-
-
-
- -

-set

-
-public void set(java.lang.String key,
-                LuaValue value)
-
-
Set a value in a table without metatag processing using NEWINDEX. -

-

-
Parameters:
key - the key to use, must not be NIL or null
value - the value to use, can be NIL, must not be null -
Throws: -
LuaError - if this is not a table, - or there is no NEWINDEX metatag
-
-
-
- -

-set

-
-public void set(java.lang.String key,
-                double value)
-
-
Set a value in a table without metatag processing using NEWINDEX. -

-

-
Parameters:
key - the key to use, must not be null
value - the value to use -
Throws: -
LuaError - if this is not a table, - or there is no NEWINDEX metatag
-
-
-
- -

-set

-
-public void set(java.lang.String key,
-                int value)
-
-
Set a value in a table without metatag processing using NEWINDEX. -

-

-
Parameters:
key - the key to use, must not be null
value - the value to use -
Throws: -
LuaError - if this is not a table, - or there is no NEWINDEX metatag
-
-
-
- -

-set

-
-public void set(java.lang.String key,
-                java.lang.String value)
-
-
Set a value in a table without metatag processing using NEWINDEX. -

-

-
Parameters:
key - the key to use, must not be null
value - the value to use, must not be null -
Throws: -
LuaError - if this is not a table, - or there is no NEWINDEX metatag
-
-
-
- -

-rawget

-
-public LuaValue rawget(LuaValue key)
-
-
Get a value in a table without metatag processing. -

-

-
Parameters:
key - the key to look up, must not be NIL or null -
Returns:
LuaValue for that key, or NIL if not found -
Throws: -
LuaError - if this is not a table, or key is NIL
-
-
-
- -

-rawget

-
-public LuaValue rawget(int key)
-
-
Get a value in a table without metatag processing. -

-

-
Parameters:
key - the key to look up -
Returns:
LuaValue for that key, or NIL if not found -
Throws: -
LuaError - if this is not a table
-
-
-
- -

-rawget

-
-public LuaValue rawget(java.lang.String key)
-
-
Get a value in a table without metatag processing. -

-

-
Parameters:
key - the key to look up, must not be null -
Returns:
LuaValue for that key, or NIL if not found -
Throws: -
LuaError - if this is not a table
-
-
-
- -

-rawset

-
-public void rawset(LuaValue key,
-                   LuaValue value)
-
-
Set a value in a table without metatag processing. -

-

-
Parameters:
key - the key to use, must not be NIL or null
value - the value to use, can be NIL, must not be null -
Throws: -
LuaError - if this is not a table, or key is NIL
-
-
-
- -

-rawset

-
-public void rawset(int key,
-                   LuaValue value)
-
-
Set a value in a table without metatag processing. -

-

-
Parameters:
key - the key to use
value - the value to use, can be NIL, must not be null -
Throws: -
LuaError - if this is not a table
-
-
-
- -

-rawset

-
-public void rawset(int key,
-                   java.lang.String value)
-
-
Set a value in a table without metatag processing. -

-

-
Parameters:
key - the key to use
value - the value to use, can be NIL, must not be null -
Throws: -
LuaError - if this is not a table
-
-
-
- -

-rawset

-
-public void rawset(java.lang.String key,
-                   LuaValue value)
-
-
Set a value in a table without metatag processing. -

-

-
Parameters:
key - the key to use, must not be null
value - the value to use, can be NIL, must not be null -
Throws: -
LuaError - if this is not a table
-
-
-
- -

-rawset

-
-public void rawset(java.lang.String key,
-                   double value)
-
-
Set a value in a table without metatag processing. -

-

-
Parameters:
key - the key to use, must not be null
value - the value to use -
Throws: -
LuaError - if this is not a table
-
-
-
- -

-rawset

-
-public void rawset(java.lang.String key,
-                   int value)
-
-
Set a value in a table without metatag processing. -

-

-
Parameters:
key - the key to use, must not be null
value - the value to use -
Throws: -
LuaError - if this is not a table
-
-
-
- -

-rawset

-
-public void rawset(java.lang.String key,
-                   java.lang.String value)
-
-
Set a value in a table without metatag processing. -

-

-
Parameters:
key - the key to use, must not be null
value - the value to use, must not be null -
Throws: -
LuaError - if this is not a table
-
-
-
- -

-rawsetlist

-
-public void rawsetlist(int key0,
-                       Varargs values)
-
-
Set list values in a table without invoking metatag processing -

- Primarily used internally in response to a SETLIST bytecode. -

-

-
Parameters:
key0 - the first key to set in the table
values - the list of values to set -
Throws: -
LuaError - if this is not a table.
-
-
-
- -

-presize

-
-public void presize(int i)
-
-
Preallocate the array part of a table to be a certain size, -

- Primarily used internally in response to a SETLIST bytecode. -

-

-
Parameters:
i - the number of array slots to preallocate in the table. -
Throws: -
LuaError - if this is not a table.
-
-
-
- -

-next

-
-public Varargs next(LuaValue index)
-
-
Find the next key,value pair if this is a table, - return NIL if there are no more, or throw a LuaError if not a table. -

- To iterate over all key-value pairs in a table you can use -

 LuaValue k = LuaValue.NIL;
- while ( true ) {
-    Varargs n = table.next(k);
-    if ( (k = n.arg1()).isnil() )
-       break;
-    LuaValue v = n.arg(2)
-    process( k, v )
- }
-

-

-
Parameters:
index - LuaInteger value identifying a key to start from, - or NIL to start at the beginning -
Returns:
Varargs containing {key,value} for the next entry, - or NIL if there are no more. -
Throws: -
LuaError - if this is not a table, or the supplied key is invalid.
See Also:
LuaTable, -#inext(), -valueOf(int), -Varargs.arg1(), -Varargs.arg(int), -isnil()
-
-
-
- -

-inext

-
-public Varargs inext(LuaValue index)
-
-
Find the next integer-key,value pair if this is a table, - return NIL if there are no more, or throw a LuaError if not a table. -

- To iterate over integer keys in a table you can use -

 LuaValue k = LuaValue.NIL;
-   while ( true ) {
-      Varargs n = table.inext(k);
-      if ( (k = n.arg1()).isnil() )
-         break;
-      LuaValue v = n.arg(2)
-      process( k, v )
-   }
-  
-

-

-
Parameters:
index - LuaInteger value identifying a key to start from, - or NIL to start at the beginning -
Returns:
Varargs containing (key,value) for the next entry, - or NONE if there are no more. -
Throws: -
LuaError - if this is not a table, or the supplied key is invalid.
See Also:
LuaTable, -#next(), -valueOf(int), -Varargs.arg1(), -Varargs.arg(int), -isnil()
-
-
-
- -

-load

-
-public LuaValue load(LuaValue library)
-
-
Load a library instance by setting its environment to this - and calling it, which should iniitalize the library instance and - install itself into this instance. -

-

-
Parameters:
library - The callable LuaValue to load into this -
Returns:
LuaValue containing the result of the initialization call.
-
-
-
- -

-arg

-
-public LuaValue arg(int index)
-
-
Description copied from class: Varargs
-
Get the n-th argument value (1-based). -

-

-
Specified by:
arg in class Varargs
-
-
-
Parameters:
index - the index of the argument to get, 1 is the first argument -
Returns:
Value at position i, or LuaValue.NIL if there is none.
See Also:
Varargs.arg1(), -NIL
-
-
-
- -

-narg

-
-public int narg()
-
-
Description copied from class: Varargs
-
Get the number of arguments, or 0 if there are none. -

-

-
Specified by:
narg in class Varargs
-
-
- -
Returns:
number of arguments.
-
-
-
- -

-arg1

-
-public LuaValue arg1()
-
-
Description copied from class: Varargs
-
Get the first argument in the list. -

-

-
Specified by:
arg1 in class Varargs
-
-
- -
Returns:
LuaValue which is first in the list, or LuaValue.NIL if there are no values.
See Also:
Varargs.arg(int), -NIL
-
-
-
- -

-getmetatable

-
-public LuaValue getmetatable()
-
-
Get the metatable for this LuaValue -

- For LuaTable and LuaUserdata instances, - the metatable returned is this instance metatable. - For all other types, the class metatable value will be returned. -

-

- -
Returns:
metatable, or null if it there is none
See Also:
LuaBoolean.s_metatable, -LuaNumber.s_metatable, -LuaNil.s_metatable, -LuaFunction.s_metatable, -LuaThread.s_metatable
-
-
-
- -

-setmetatable

-
-public LuaValue setmetatable(LuaValue metatable)
-
-
Set the metatable for this LuaValue -

- For LuaTable and LuaUserdata instances, the metatable is per instance. - For all other types, there is one metatable per type that can be set directly from java -

-

-
Parameters:
metatable - LuaValue instance to serve as the metatable, or null to reset it. -
Returns:
this to allow chaining of Java function calls
See Also:
LuaBoolean.s_metatable, -LuaNumber.s_metatable, -LuaNil.s_metatable, -LuaFunction.s_metatable, -LuaThread.s_metatable
-
-
-
- -

-getfenv

-
-public LuaValue getfenv()
-
-
Get the environemnt for an instance. -

-

- -
Returns:
LuaValue currently set as the instances environent.
-
-
-
- -

-setfenv

-
-public void setfenv(LuaValue env)
-
-
Set the environment on an object. -

- Typically the environment is created once per application via a platform - helper method such as JsePlatform.standardGlobals() - However, any object can serve as an environment if it contains suitable metatag - values to implement get(LuaValue) to provide the environment values. -

-

-
Parameters:
env - LuaValue (typically a LuaTable) containing the environment.
See Also:
JmePlatform, -JsePlatform
-
-
-
- -

-call

-
-public LuaValue call()
-
-
Call this with 0 arguments, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use invoke() instead. -

- To call this as a method call, use method(LuaValue) instead. -

-

- -
Returns:
First return value (this()), or NIL if there were none. -
Throws: -
LuaError - if not a function and CALL is not defined, - or the invoked function throws a LuaError - or the invoked closure throw a lua error
See Also:
call(LuaValue), -call(LuaValue,LuaValue), -call(LuaValue, LuaValue, LuaValue), -invoke(), -method(String), -method(LuaValue)
-
-
-
- -

-call

-
-public LuaValue call(LuaValue arg)
-
-
Call this with 1 argument, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use invoke() instead. -

- To call this as a method call, use method(LuaValue) instead. -

-

-
Parameters:
arg - First argument to supply to the called function -
Returns:
First return value (this(arg)), or NIL if there were none. -
Throws: -
LuaError - if not a function and CALL is not defined, - or the invoked function throws a LuaError - or the invoked closure throw a lua error
See Also:
call(), -call(LuaValue,LuaValue), -call(LuaValue, LuaValue, LuaValue), -#invoke(LuaValue), -method(String,LuaValue), -method(LuaValue,LuaValue)
-
-
-
- -

-call

-
-public LuaValue call(LuaValue arg1,
-                     LuaValue arg2)
-
-
Call this with 2 arguments, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use invoke() instead. -

- To call this as a method call, use method(LuaValue) instead. -

-

-
Parameters:
arg1 - First argument to supply to the called function
arg2 - Second argument to supply to the called function -
Returns:
First return value (this(arg1,arg2)), or NIL if there were none. -
Throws: -
LuaError - if not a function and CALL is not defined, - or the invoked function throws a LuaError - or the invoked closure throw a lua error
See Also:
call(), -call(LuaValue), -call(LuaValue, LuaValue, LuaValue), -#invoke(LuaValue,LuaValue), -method(String,LuaValue,LuaValue), -method(LuaValue,LuaValue,LuaValue)
-
-
-
- -

-call

-
-public LuaValue call(LuaValue arg1,
-                     LuaValue arg2,
-                     LuaValue arg3)
-
-
Call this with 3 arguments, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use invoke() instead. -

- To call this as a method call, use method(LuaValue) instead. -

-

-
Parameters:
arg1 - First argument to supply to the called function
arg2 - Second argument to supply to the called function
arg3 - Second argument to supply to the called function -
Returns:
First return value (this(arg1,arg2,arg3)), or NIL if there were none. -
Throws: -
LuaError - if not a function and CALL is not defined, - or the invoked function throws a LuaError - or the invoked closure throw a lua error
See Also:
call(), -call(LuaValue), -call(LuaValue, LuaValue), -#invoke(LuaValue,LuaValue, LuaValue), -invokemethod(String,Varargs), -invokemethod(LuaValue,Varargs)
-
-
-
- -

-method

-
-public LuaValue method(java.lang.String name)
-
-
Call named method on this with 0 arguments, including metatag processing, - and return only the first return value. -

- Look up this[name] and if it is a LuaFunction, - call it inserting this as an additional first argument. - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use invoke() instead. -

- To call this as a plain call, use call() instead. -

-

-
Parameters:
name - Name of the method to look up for invocation -
Returns:
All values returned from this:name() as a Varargs instance -
Throws: -
LuaError - if not a function and CALL is not defined, - or the invoked function throws a LuaError - or the invoked closure throw a lua error
See Also:
call(), -invoke(), -method(LuaValue), -method(String,LuaValue), -method(String,LuaValue,LuaValue)
-
-
-
- -

-method

-
-public LuaValue method(LuaValue name)
-
-
Call named method on this with 0 arguments, including metatag processing, - and return only the first return value. -

- Look up this[name] and if it is a LuaFunction, - call it inserting this as an additional first argument, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use invoke() instead. -

- To call this as a plain call, use call() instead. -

-

-
Parameters:
name - Name of the method to look up for invocation -
Returns:
All values returned from this:name() as a Varargs instance -
Throws: -
LuaError - if not a function and CALL is not defined, - or the invoked function throws a LuaError - or the invoked closure throw a lua error
See Also:
call(), -invoke(), -method(String), -method(LuaValue,LuaValue), -method(LuaValue,LuaValue,LuaValue)
-
-
-
- -

-method

-
-public LuaValue method(java.lang.String name,
-                       LuaValue arg)
-
-
Call named method on this with 1 argument, including metatag processing, - and return only the first return value. -

- Look up this[name] and if it is a LuaFunction, - call it inserting this as an additional first argument, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use invoke() instead. -

- To call this as a plain call, use call(LuaValue) instead. -

-

-
Parameters:
name - Name of the method to look up for invocation
arg - Argument to supply to the method -
Returns:
All values returned from this:name(arg) as a Varargs instance -
Throws: -
LuaError - if not a function and CALL is not defined, - or the invoked function throws a LuaError - or the invoked closure throw a lua error
See Also:
call(LuaValue), -#invoke(LuaValue), -method(LuaValue,LuaValue), -method(String), -method(String,LuaValue,LuaValue)
-
-
-
- -

-method

-
-public LuaValue method(LuaValue name,
-                       LuaValue arg)
-
-
Call named method on this with 1 argument, including metatag processing, - and return only the first return value. -

- Look up this[name] and if it is a LuaFunction, - call it inserting this as an additional first argument, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use invoke() instead. -

- To call this as a plain call, use call(LuaValue) instead. -

-

-
Parameters:
name - Name of the method to look up for invocation
arg - Argument to supply to the method -
Returns:
All values returned from this:name(arg) as a Varargs instance -
Throws: -
LuaError - if not a function and CALL is not defined, - or the invoked function throws a LuaError - or the invoked closure throw a lua error
See Also:
call(LuaValue), -#invoke(LuaValue), -method(String,LuaValue), -method(LuaValue), -method(LuaValue,LuaValue,LuaValue)
-
-
-
- -

-method

-
-public LuaValue method(java.lang.String name,
-                       LuaValue arg1,
-                       LuaValue arg2)
-
-
Call named method on this with 2 arguments, including metatag processing, - and return only the first return value. -

- Look up this[name] and if it is a LuaFunction, - call it inserting this as an additional first argument, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use invoke() instead. -

- To call this as a plain call, use call(LuaValue,LuaValue) instead. -

-

-
Parameters:
name - Name of the method to look up for invocation
arg1 - First argument to supply to the method
arg2 - Second argument to supply to the method -
Returns:
All values returned from this:name(arg1,arg2) as a Varargs instance -
Throws: -
LuaError - if not a function and CALL is not defined, - or the invoked function throws a LuaError - or the invoked closure throw a lua error
See Also:
call(LuaValue,LuaValue), -invoke(LuaValue,Varargs), -method(String,LuaValue), -method(LuaValue,LuaValue,LuaValue)
-
-
-
- -

-method

-
-public LuaValue method(LuaValue name,
-                       LuaValue arg1,
-                       LuaValue arg2)
-
-
Call named method on this with 2 arguments, including metatag processing, - and return only the first return value. -

- Look up this[name] and if it is a LuaFunction, - call it inserting this as an additional first argument, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use invoke() instead. -

- To call this as a plain call, use call(LuaValue,LuaValue) instead. -

-

-
Parameters:
name - Name of the method to look up for invocation
arg1 - First argument to supply to the method
arg2 - Second argument to supply to the method -
Returns:
All values returned from this:name(arg1,arg2) as a Varargs instance -
Throws: -
LuaError - if not a function and CALL is not defined, - or the invoked function throws a LuaError - or the invoked closure throw a lua error
See Also:
call(LuaValue,LuaValue), -invoke(LuaValue,Varargs), -method(LuaValue,LuaValue), -method(String,LuaValue,LuaValue)
-
-
-
- -

-invoke

-
-public Varargs invoke()
-
-
Call this with 0 arguments, including metatag processing, - and retain all return values in a Varargs. -

- If this is a LuaFunction, call it, and return all values. - Otherwise, look for the CALL metatag and call that. -

- To get a particular return value, us Varargs.arg(int) -

- To call this as a method call, use invokemethod(LuaValue) instead. -

-

- -
Returns:
All return values as a Varargs instance. -
Throws: -
LuaError - if not a function and CALL is not defined, - or the invoked function throws a LuaError - or the invoked closure throw a lua error
See Also:
call(), -invoke(Varargs), -invokemethod(String), -invokemethod(LuaValue)
-
-
-
- -

-invoke

-
-public Varargs invoke(Varargs args)
-
-
Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs. -

- If this is a LuaFunction, call it, and return all values. - Otherwise, look for the CALL metatag and call that. -

- To get a particular return value, us Varargs.arg(int) -

- To call this as a method call, use invokemethod(LuaValue) instead. -

-

-
Parameters:
args - Varargs containing the arguments to supply to the called function -
Returns:
All return values as a Varargs instance. -
Throws: -
LuaError - if not a function and CALL is not defined, - or the invoked function throws a LuaError - or the invoked closure throw a lua error
See Also:
varargsOf(LuaValue[]), -call(LuaValue), -invoke(), -invoke(LuaValue,Varargs), -invokemethod(String,Varargs), -invokemethod(LuaValue,Varargs)
-
-
-
- -

-invoke

-
-public Varargs invoke(LuaValue arg,
-                      Varargs varargs)
-
-
Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs. -

- If this is a LuaFunction, call it, and return all values. - Otherwise, look for the CALL metatag and call that. -

- To get a particular return value, us Varargs.arg(int) -

- To call this as a method call, use invokemethod(LuaValue,Varargs) instead. -

-

-
Parameters:
arg - The first argument to supply to the called function
varargs - Varargs containing the remaining arguments to supply to the called function -
Returns:
All return values as a Varargs instance. -
Throws: -
LuaError - if not a function and CALL is not defined, - or the invoked function throws a LuaError - or the invoked closure throw a lua error
See Also:
varargsOf(LuaValue[]), -call(LuaValue,LuaValue), -invoke(LuaValue,Varargs), -invokemethod(String,Varargs), -invokemethod(LuaValue,Varargs)
-
-
-
- -

-invoke

-
-public Varargs invoke(LuaValue arg1,
-                      LuaValue arg2,
-                      Varargs varargs)
-
-
Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs. -

- If this is a LuaFunction, call it, and return all values. - Otherwise, look for the CALL metatag and call that. -

- To get a particular return value, us Varargs.arg(int) -

- To call this as a method call, use invokemethod(LuaValue,Varargs) instead. -

-

-
Parameters:
arg1 - The first argument to supply to the called function
arg2 - The second argument to supply to the called function
varargs - Varargs containing the remaining arguments to supply to the called function -
Returns:
All return values as a Varargs instance. -
Throws: -
LuaError - if not a function and CALL is not defined, - or the invoked function throws a LuaError - or the invoked closure throw a lua error
See Also:
varargsOf(LuaValue[]), -call(LuaValue,LuaValue,LuaValue), -invoke(LuaValue,LuaValue,Varargs), -invokemethod(String,Varargs), -invokemethod(LuaValue,Varargs)
-
-
-
- -

-invoke

-
-public Varargs invoke(LuaValue[] args)
-
-
Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs. -

- If this is a LuaFunction, call it, and return all values. - Otherwise, look for the CALL metatag and call that. -

- To get a particular return value, us Varargs.arg(int) -

- To call this as a method call, use invokemethod(LuaValue,Varargs) instead. -

-

-
Parameters:
args - Array of arguments to supply to the called function -
Returns:
All return values as a Varargs instance. -
Throws: -
LuaError - if not a function and CALL is not defined, - or the invoked function throws a LuaError - or the invoked closure throw a lua error
See Also:
varargsOf(LuaValue[]), -call(LuaValue,LuaValue,LuaValue), -invoke(LuaValue,LuaValue,Varargs), -invokemethod(String,LuaValue[]), -invokemethod(LuaValue,LuaValue[])
-
-
-
- -

-invoke

-
-public Varargs invoke(LuaValue[] args,
-                      Varargs varargs)
-
-
Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs. -

- If this is a LuaFunction, call it, and return all values. - Otherwise, look for the CALL metatag and call that. -

- To get a particular return value, us Varargs.arg(int) -

- To call this as a method call, use invokemethod(LuaValue,Varargs) instead. -

-

-
Parameters:
args - Array of arguments to supply to the called function
varargs - Varargs containing additional arguments to supply to the called function -
Returns:
All return values as a Varargs instance. -
Throws: -
LuaError - if not a function and CALL is not defined, - or the invoked function throws a LuaError - or the invoked closure throw a lua error
See Also:
varargsOf(LuaValue[]), -call(LuaValue,LuaValue,LuaValue), -invoke(LuaValue,LuaValue,Varargs), -invokemethod(String,LuaValue[]), -invokemethod(LuaValue,LuaValue[]), -invokemethod(String,Varargs), -invokemethod(LuaValue,Varargs)
-
-
-
- -

-invokemethod

-
-public Varargs invokemethod(java.lang.String name)
-
-
Call named method on this with 0 arguments, including metatag processing, - and retain all return values in a Varargs. -

- Look up this[name] and if it is a LuaFunction, - call it inserting this as an additional first argument, - and return all return values as a Varargs instance. - Otherwise, look for the CALL metatag and call that. -

- To get a particular return value, us Varargs.arg(int) -

- To call this as a plain call, use invoke() instead. -

-

-
Parameters:
name - Name of the method to look up for invocation -
Returns:
All values returned from this:name() as a Varargs instance -
Throws: -
LuaError - if not a function and CALL is not defined, - or the invoked function throws a LuaError - or the invoked closure throw a lua error
See Also:
call(), -invoke(), -method(String), -invokemethod(LuaValue), -#invokemethod(String,LuaValue)
-
-
-
- -

-invokemethod

-
-public Varargs invokemethod(LuaValue name)
-
-
Call named method on this with 0 arguments, including metatag processing, - and retain all return values in a Varargs. -

- Look up this[name] and if it is a LuaFunction, - call it inserting this as an additional first argument, - and return all return values as a Varargs instance. - Otherwise, look for the CALL metatag and call that. -

- To get a particular return value, us Varargs.arg(int) -

- To call this as a plain call, use invoke() instead. -

-

-
Parameters:
name - Name of the method to look up for invocation -
Returns:
All values returned from this:name() as a Varargs instance -
Throws: -
LuaError - if not a function and CALL is not defined, - or the invoked function throws a LuaError - or the invoked closure throw a lua error
See Also:
call(), -invoke(), -method(LuaValue), -invokemethod(String), -#invokemethod(LuaValue,LuaValue)
-
-
-
- -

-invokemethod

-
-public Varargs invokemethod(java.lang.String name,
-                            Varargs args)
-
-
Call named method on this with 1 argument, including metatag processing, - and retain all return values in a Varargs. -

- Look up this[name] and if it is a LuaFunction, - call it inserting this as an additional first argument, - and return all return values as a Varargs instance. - Otherwise, look for the CALL metatag and call that. -

- To get a particular return value, us Varargs.arg(int) -

- To call this as a plain call, use invoke(Varargs) instead. -

-

-
Parameters:
name - Name of the method to look up for invocation
args - Varargs containing arguments to supply to the called function after this -
Returns:
All values returned from this:name(args) as a Varargs instance -
Throws: -
LuaError - if not a function and CALL is not defined, - or the invoked function throws a LuaError - or the invoked closure throw a lua error
See Also:
call(), -invoke(Varargs), -method(String), -invokemethod(LuaValue,Varargs), -invokemethod(String,LuaValue[])
-
-
-
- -

-invokemethod

-
-public Varargs invokemethod(LuaValue name,
-                            Varargs args)
-
-
Call named method on this with variable arguments, including metatag processing, - and retain all return values in a Varargs. -

- Look up this[name] and if it is a LuaFunction, - call it inserting this as an additional first argument, - and return all return values as a Varargs instance. - Otherwise, look for the CALL metatag and call that. -

- To get a particular return value, us Varargs.arg(int) -

- To call this as a plain call, use invoke(Varargs) instead. -

-

-
Parameters:
name - Name of the method to look up for invocation
args - Varargs containing arguments to supply to the called function after this -
Returns:
All values returned from this:name(args) as a Varargs instance -
Throws: -
LuaError - if not a function and CALL is not defined, - or the invoked function throws a LuaError - or the invoked closure throw a lua error
See Also:
call(), -invoke(Varargs), -method(String), -invokemethod(String,Varargs), -invokemethod(LuaValue,LuaValue[])
-
-
-
- -

-invokemethod

-
-public Varargs invokemethod(java.lang.String name,
-                            LuaValue[] args)
-
-
Call named method on this with 1 argument, including metatag processing, - and retain all return values in a Varargs. -

- Look up this[name] and if it is a LuaFunction, - call it inserting this as an additional first argument, - and return all return values as a Varargs instance. - Otherwise, look for the CALL metatag and call that. -

- To get a particular return value, us Varargs.arg(int) -

- To call this as a plain call, use invoke(Varargs) instead. -

-

-
Parameters:
name - Name of the method to look up for invocation
args - Array of LuaValue containing arguments to supply to the called function after this -
Returns:
All values returned from this:name(args) as a Varargs instance -
Throws: -
LuaError - if not a function and CALL is not defined, - or the invoked function throws a LuaError - or the invoked closure throw a lua error
See Also:
call(), -invoke(Varargs), -method(String), -invokemethod(LuaValue,LuaValue[]), -invokemethod(String,Varargs), -varargsOf(LuaValue[])
-
-
-
- -

-invokemethod

-
-public Varargs invokemethod(LuaValue name,
-                            LuaValue[] args)
-
-
Call named method on this with variable arguments, including metatag processing, - and retain all return values in a Varargs. -

- Look up this[name] and if it is a LuaFunction, - call it inserting this as an additional first argument, - and return all return values as a Varargs instance. - Otherwise, look for the CALL metatag and call that. -

- To get a particular return value, us Varargs.arg(int) -

- To call this as a plain call, use invoke(Varargs) instead. -

-

-
Parameters:
name - Name of the method to look up for invocation
args - Array of LuaValue containing arguments to supply to the called function after this -
Returns:
All values returned from this:name(args) as a Varargs instance -
Throws: -
LuaError - if not a function and CALL is not defined, - or the invoked function throws a LuaError - or the invoked closure throw a lua error
See Also:
call(), -invoke(Varargs), -method(String), -invokemethod(String,LuaValue[]), -invokemethod(LuaValue,Varargs), -varargsOf(LuaValue[])
-
-
-
- -

-callmt

-
-protected LuaValue callmt()
-
-
Get the metatag value for the CALL metatag, if it exists. -

-

- -
Returns:
LuaValue value if metatag is defined -
Throws: -
LuaError - if CALL metatag is not defined.
-
-
-
- -

-not

-
-public LuaValue not()
-
-
Unary not: return inverse boolean value (~this) as defined by lua not operator -

-

- -
Returns:
TRUE if NIL or FALSE, otherwise FALSE
-
-
-
- -

-neg

-
-public LuaValue neg()
-
-
Unary minus: return negative value (-this) as defined by lua unary minus operator -

-

- -
Returns:
boolean inverse as LuaBoolean if boolean or nil, - numeric inverse as if numeric, - or metatag processing result if UNM metatag is defined -
Throws: -
LuaError - if this is not a table or string, and has no UNM metatag
-
-
-
- -

-len

-
-public LuaValue len()
-
-
Length operator: return lua length of object (#this) including metatag processing as java int -

-

- -
Returns:
length as defined by the lua # operator - or metatag processing result -
Throws: -
LuaError - if this is not a table or string, and has no LEN metatag
-
-
-
- -

-length

-
-public int length()
-
-
Length operator: return lua length of object (#this) including metatag processing as java int -

-

- -
Returns:
length as defined by the lua # operator - or metatag processing result converted to java int using toint() -
Throws: -
LuaError - if this is not a table or string, and has no LEN metatag
-
-
-
- -

-getn

-
-public LuaValue getn()
-
-
Implementation of lua 5.0 getn() function. -

-

- -
Returns:
value of getn() as defined in lua 5.0 spec if this is a LuaTable -
Throws: -
LuaError - if this is not a LuaTable
-
-
-
- -

-equals

-
-public boolean equals(java.lang.Object obj)
-
-
-
Overrides:
equals in class java.lang.Object
-
-
-
-
-
-
- -

-eq

-
-public LuaValue eq(LuaValue val)
-
-
Equals: Perform equality comparison with another value - including metatag processing using EQ. -

-

-
Parameters:
val - The value to compare with. -
Returns:
TRUE if values are comparable and (this == rhs), - FALSE if comparable but not equal, - LuaValue if metatag processing occurs.
See Also:
eq_b(LuaValue), -raweq(LuaValue), -neq(LuaValue), -eqmtcall(LuaValue, LuaValue, LuaValue, LuaValue), -EQ
-
-
-
- -

-eq_b

-
-public boolean eq_b(LuaValue val)
-
-
Equals: Perform equality comparison with another value - including metatag processing using EQ, - and return java boolean -

-

-
Parameters:
val - The value to compare with. -
Returns:
true if values are comparable and (this == rhs), - false if comparable but not equal, - result converted to java boolean if metatag processing occurs.
See Also:
eq(LuaValue), -raweq(LuaValue), -neq_b(LuaValue), -eqmtcall(LuaValue, LuaValue, LuaValue, LuaValue), -EQ
-
-
-
- -

-neq

-
-public LuaValue neq(LuaValue val)
-
-
Notquals: Perform inequality comparison with another value - including metatag processing using EQ. -

-

-
Parameters:
val - The value to compare with. -
Returns:
TRUE if values are comparable and (this != rhs), - FALSE if comparable but equal, - inverse of LuaValue converted to LuaBoolean if metatag processing occurs.
See Also:
eq(LuaValue), -raweq(LuaValue), -eqmtcall(LuaValue, LuaValue, LuaValue, LuaValue), -EQ
-
-
-
- -

-neq_b

-
-public boolean neq_b(LuaValue val)
-
-
Notquals: Perform inequality comparison with another value - including metatag processing using EQ. -

-

-
Parameters:
val - The value to compare with. -
Returns:
true if values are comparable and (this != rhs), - false if comparable but equal, - inverse of result converted to boolean if metatag processing occurs.
See Also:
eq_b(LuaValue), -raweq(LuaValue), -eqmtcall(LuaValue, LuaValue, LuaValue, LuaValue), -EQ
-
-
-
- -

-raweq

-
-public boolean raweq(LuaValue val)
-
-
Equals: Perform direct equality comparison with another value - without metatag processing. -

-

-
Parameters:
val - The value to compare with. -
Returns:
true if (this == rhs), false otherwise
See Also:
eq(LuaValue), -raweq(LuaUserdata), -raweq(LuaString), -raweq(double), -raweq(int), -EQ
-
-
-
- -

-raweq

-
-public boolean raweq(LuaUserdata val)
-
-
Equals: Perform direct equality comparison with a LuaUserdata value - without metatag processing. -

-

-
Parameters:
val - The LuaUserdata to compare with. -
Returns:
true if this is userdata - and their metatables are the same using == - and their instances are equal using equals(Object), - otherwise false
See Also:
eq(LuaValue), -raweq(LuaValue)
-
-
-
- -

-raweq

-
-public boolean raweq(LuaString val)
-
-
Equals: Perform direct equality comparison with a LuaString value - without metatag processing. -

-

-
Parameters:
val - The LuaString to compare with. -
Returns:
true if this is a LuaString - and their byte sequences match, - otherwise false
-
-
-
- -

-raweq

-
-public boolean raweq(double val)
-
-
Equals: Perform direct equality comparison with a double value - without metatag processing. -

-

-
Parameters:
val - The double value to compare with. -
Returns:
true if this is a LuaNumber - whose value equals val, - otherwise false
-
-
-
- -

-raweq

-
-public boolean raweq(int val)
-
-
Equals: Perform direct equality comparison with a int value - without metatag processing. -

-

-
Parameters:
val - The double value to compare with. -
Returns:
true if this is a LuaNumber - whose value equals val, - otherwise false
-
-
-
- -

-eqmtcall

-
-public static final boolean eqmtcall(LuaValue lhs,
-                                     LuaValue lhsmt,
-                                     LuaValue rhs,
-                                     LuaValue rhsmt)
-
-
Perform equality testing metatag processing -

-

-
Parameters:
lhs - left-hand-side of equality expression
lhsmt - metatag value for left-hand-side
rhs - right-hand-side of equality expression
rhsmt - metatag value for right-hand-side -
Returns:
true if metatag processing result is not NIL or FALSE -
Throws: -
LuaError - if metatag was not defined for either operand
See Also:
equals(Object), -eq(LuaValue), -raweq(LuaValue), -EQ
-
-
-
- -

-add

-
-public LuaValue add(LuaValue rhs)
-
-
Add: Perform numeric add operation with another value - including metatag processing. -

- Each operand must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Parameters:
rhs - The right-hand-side value to perform the add with -
Returns:
value of (this + rhs) if both are numeric, - or LuaValue if metatag processing occurs -
Throws: -
LuaError - if either operand is not a number or string convertible to number, - and neither has the ADD metatag defined
See Also:
arithmt(LuaValue, LuaValue)
-
-
-
- -

-add

-
-public LuaValue add(double rhs)
-
-
Add: Perform numeric add operation with another value - of double type with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Parameters:
rhs - The right-hand-side value to perform the add with -
Returns:
value of (this + rhs) if this is numeric -
Throws: -
LuaError - if this is not a number or string convertible to number
See Also:
add(LuaValue)
-
-
-
- -

-add

-
-public LuaValue add(int rhs)
-
-
Add: Perform numeric add operation with another value - of int type with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Parameters:
rhs - The right-hand-side value to perform the add with -
Returns:
value of (this + rhs) if this is numeric -
Throws: -
LuaError - if this is not a number or string convertible to number
See Also:
add(LuaValue)
-
-
-
- -

-sub

-
-public LuaValue sub(LuaValue rhs)
-
-
Subtract: Perform numeric subtract operation with another value - of unknown type, - including metatag processing. -

- Each operand must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Parameters:
rhs - The right-hand-side value to perform the subtract with -
Returns:
value of (this - rhs) if both are numeric, - or LuaValue if metatag processing occurs -
Throws: -
LuaError - if either operand is not a number or string convertible to number, - and neither has the SUB metatag defined
See Also:
arithmt(LuaValue, LuaValue)
-
-
-
- -

-sub

-
-public LuaValue sub(double rhs)
-
-
Subtract: Perform numeric subtract operation with another value - of double type with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Parameters:
rhs - The right-hand-side value to perform the subtract with -
Returns:
value of (this - rhs) if this is numeric -
Throws: -
LuaError - if this is not a number or string convertible to number
See Also:
sub(LuaValue)
-
-
-
- -

-sub

-
-public LuaValue sub(int rhs)
-
-
Subtract: Perform numeric subtract operation with another value - of int type with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Parameters:
rhs - The right-hand-side value to perform the subtract with -
Returns:
value of (this - rhs) if this is numeric -
Throws: -
LuaError - if this is not a number or string convertible to number
See Also:
sub(LuaValue)
-
-
-
- -

-subFrom

-
-public LuaValue subFrom(double lhs)
-
-
Reverse-subtract: Perform numeric subtract operation from an int value - with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Parameters:
lhs - The left-hand-side value from which to perform the subtraction -
Returns:
value of (lhs - this) if this is numeric -
Throws: -
LuaError - if this is not a number or string convertible to number
See Also:
sub(LuaValue), -sub(double), -sub(int)
-
-
-
- -

-subFrom

-
-public LuaValue subFrom(int lhs)
-
-
Reverse-subtract: Perform numeric subtract operation from a double value - without metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

- For metatag processing sub(LuaValue) must be used -

-

-
Parameters:
lhs - The left-hand-side value from which to perform the subtraction -
Returns:
value of (lhs - this) if this is numeric -
Throws: -
LuaError - if this is not a number or string convertible to number
See Also:
sub(LuaValue), -sub(double), -sub(int)
-
-
-
- -

-mul

-
-public LuaValue mul(LuaValue rhs)
-
-
Multiply: Perform numeric multiply operation with another value - of unknown type, - including metatag processing. -

- Each operand must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Parameters:
rhs - The right-hand-side value to perform the multiply with -
Returns:
value of (this * rhs) if both are numeric, - or LuaValue if metatag processing occurs -
Throws: -
LuaError - if either operand is not a number or string convertible to number, - and neither has the MUL metatag defined
See Also:
arithmt(LuaValue, LuaValue)
-
-
-
- -

-mul

-
-public LuaValue mul(double rhs)
-
-
Multiply: Perform numeric multiply operation with another value - of double type with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Parameters:
rhs - The right-hand-side value to perform the multiply with -
Returns:
value of (this * rhs) if this is numeric -
Throws: -
LuaError - if this is not a number or string convertible to number
See Also:
mul(LuaValue)
-
-
-
- -

-mul

-
-public LuaValue mul(int rhs)
-
-
Multiply: Perform numeric multiply operation with another value - of int type with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Parameters:
rhs - The right-hand-side value to perform the multiply with -
Returns:
value of (this * rhs) if this is numeric -
Throws: -
LuaError - if this is not a number or string convertible to number
See Also:
mul(LuaValue)
-
-
-
- -

-pow

-
-public LuaValue pow(LuaValue rhs)
-
-
Raise to power: Raise this value to a power - including metatag processing. -

- Each operand must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Parameters:
rhs - The power to raise this value to -
Returns:
value of (this ^ rhs) if both are numeric, - or LuaValue if metatag processing occurs -
Throws: -
LuaError - if either operand is not a number or string convertible to number, - and neither has the POW metatag defined
See Also:
arithmt(LuaValue, LuaValue)
-
-
-
- -

-pow

-
-public LuaValue pow(double rhs)
-
-
Raise to power: Raise this value to a power - of double type with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Parameters:
rhs - The power to raise this value to -
Returns:
value of (this ^ rhs) if this is numeric -
Throws: -
LuaError - if this is not a number or string convertible to number
See Also:
pow(LuaValue)
-
-
-
- -

-pow

-
-public LuaValue pow(int rhs)
-
-
Raise to power: Raise this value to a power - of int type with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Parameters:
rhs - The power to raise this value to -
Returns:
value of (this ^ rhs) if this is numeric -
Throws: -
LuaError - if this is not a number or string convertible to number
See Also:
pow(LuaValue)
-
-
-
- -

-powWith

-
-public LuaValue powWith(double lhs)
-
-
Reverse-raise to power: Raise another value of double type to this power - with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Parameters:
lhs - The left-hand-side value which will be raised to this power -
Returns:
value of (lhs ^ this) if this is numeric -
Throws: -
LuaError - if this is not a number or string convertible to number
See Also:
pow(LuaValue), -pow(double), -pow(int)
-
-
-
- -

-powWith

-
-public LuaValue powWith(int lhs)
-
-
Reverse-raise to power: Raise another value of double type to this power - with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Parameters:
lhs - The left-hand-side value which will be raised to this power -
Returns:
value of (lhs ^ this) if this is numeric -
Throws: -
LuaError - if this is not a number or string convertible to number
See Also:
pow(LuaValue), -pow(double), -pow(int)
-
-
-
- -

-div

-
-public LuaValue div(LuaValue rhs)
-
-
Divide: Perform numeric divide operation by another value - of unknown type, - including metatag processing. -

- Each operand must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Parameters:
rhs - The right-hand-side value to perform the divulo with -
Returns:
value of (this / rhs) if both are numeric, - or LuaValue if metatag processing occurs -
Throws: -
LuaError - if either operand is not a number or string convertible to number, - and neither has the DIV metatag defined
See Also:
arithmt(LuaValue, LuaValue)
-
-
-
- -

-div

-
-public LuaValue div(double rhs)
-
-
Divide: Perform numeric divide operation by another value - of double type without metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

- For metatag processing div(LuaValue) must be used -

-

-
Parameters:
rhs - The right-hand-side value to perform the divulo with -
Returns:
value of (this / rhs) if this is numeric -
Throws: -
LuaError - if this is not a number or string convertible to number
See Also:
div(LuaValue)
-
-
-
- -

-div

-
-public LuaValue div(int rhs)
-
-
Divide: Perform numeric divide operation by another value - of int type without metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

- For metatag processing div(LuaValue) must be used -

-

-
Parameters:
rhs - The right-hand-side value to perform the divulo with -
Returns:
value of (this / rhs) if this is numeric -
Throws: -
LuaError - if this is not a number or string convertible to number
See Also:
div(LuaValue)
-
-
-
- -

-divInto

-
-public LuaValue divInto(double lhs)
-
-
Reverse-divide: Perform numeric divide operation into another value - with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Parameters:
lhs - The left-hand-side value which will be divided by this -
Returns:
value of (lhs / this) if this is numeric -
Throws: -
LuaError - if this is not a number or string convertible to number
See Also:
div(LuaValue), -div(double), -div(int)
-
-
-
- -

-mod

-
-public LuaValue mod(LuaValue rhs)
-
-
Modulo: Perform numeric modulo operation with another value - of unknown type, - including metatag processing. -

- Each operand must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Parameters:
rhs - The right-hand-side value to perform the modulo with -
Returns:
value of (this % rhs) if both are numeric, - or LuaValue if metatag processing occurs -
Throws: -
LuaError - if either operand is not a number or string convertible to number, - and neither has the MOD metatag defined
See Also:
arithmt(LuaValue, LuaValue)
-
-
-
- -

-mod

-
-public LuaValue mod(double rhs)
-
-
Modulo: Perform numeric modulo operation with another value - of double type without metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

- For metatag processing mod(LuaValue) must be used -

-

-
Parameters:
rhs - The right-hand-side value to perform the modulo with -
Returns:
value of (this % rhs) if this is numeric -
Throws: -
LuaError - if this is not a number or string convertible to number
See Also:
mod(LuaValue)
-
-
-
- -

-mod

-
-public LuaValue mod(int rhs)
-
-
Modulo: Perform numeric modulo operation with another value - of int type without metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

- For metatag processing mod(LuaValue) must be used -

-

-
Parameters:
rhs - The right-hand-side value to perform the modulo with -
Returns:
value of (this % rhs) if this is numeric -
Throws: -
LuaError - if this is not a number or string convertible to number
See Also:
mod(LuaValue)
-
-
-
- -

-modFrom

-
-public LuaValue modFrom(double lhs)
-
-
Reverse-modulo: Perform numeric modulo operation from another value - with metatag processing -

- this must derive from LuaNumber - or derive from LuaString and be convertible to a number -

-

-
Parameters:
lhs - The left-hand-side value which will be modulo'ed by this -
Returns:
value of (lhs % this) if this is numeric -
Throws: -
LuaError - if this is not a number or string convertible to number
See Also:
mod(LuaValue), -mod(double), -mod(int)
-
-
-
- -

-arithmt

-
-protected LuaValue arithmt(LuaValue tag,
-                           LuaValue op2)
-
-
Perform metatag processing for arithmetic operations. -

- Finds the supplied metatag value for this or op2 and invokes it, - or throws LuaError if neither is defined. -

-

-
Parameters:
tag - The metatag to look up
op2 - The other operand value to perform the operation with -
Returns:
LuaValue resulting from metatag processing -
Throws: -
LuaError - if metatag was not defined for either operand
See Also:
add(LuaValue), -sub(LuaValue), -mul(LuaValue), -pow(LuaValue), -div(LuaValue), -mod(LuaValue), -ADD, -SUB, -MUL, -POW, -DIV, -MOD
-
-
-
- -

-arithmtwith

-
-protected LuaValue arithmtwith(LuaValue tag,
-                               double op1)
-
-
Perform metatag processing for arithmetic operations when the left-hand-side is a number. -

- Finds the supplied metatag value for this and invokes it, - or throws LuaError if neither is defined. -

-

-
Parameters:
tag - The metatag to look up
op1 - The value of the left-hand-side to perform the operation with -
Returns:
LuaValue resulting from metatag processing -
Throws: -
LuaError - if metatag was not defined for either operand
See Also:
add(LuaValue), -sub(LuaValue), -mul(LuaValue), -pow(LuaValue), -div(LuaValue), -mod(LuaValue), -ADD, -SUB, -MUL, -POW, -DIV, -MOD
-
-
-
- -

-lt

-
-public LuaValue lt(LuaValue rhs)
-
-
Less than: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this < rhs), FALSE if not, - or LuaValue if metatag processing occurs -
Throws: -
LuaError - if either both operands are not a strings or both are not numbers - and no LT metatag is defined.
See Also:
gteq_b(LuaValue), -comparemt(LuaValue, LuaValue)
-
-
-
- -

-lt

-
-public LuaValue lt(double rhs)
-
-
Less than: Perform numeric comparison with another value - of double type, - including metatag processing, and returning LuaValue. -

- To be comparable, this must derive from LuaNumber. -

-

-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this < rhs), FALSE if not, - or LuaValue if metatag processing occurs -
Throws: -
LuaError - if this is not a number - and no LT metatag is defined.
See Also:
gteq_b(double), -comparemt(LuaValue, LuaValue)
-
-
-
- -

-lt

-
-public LuaValue lt(int rhs)
-
-
Less than: Perform numeric comparison with another value - of int type, - including metatag processing, and returning LuaValue. -

- To be comparable, this must derive from LuaNumber. -

-

-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this < rhs), FALSE if not, - or LuaValue if metatag processing occurs -
Throws: -
LuaError - if this is not a number - and no LT metatag is defined.
See Also:
gteq_b(int), -comparemt(LuaValue, LuaValue)
-
-
-
- -

-lt_b

-
-public boolean lt_b(LuaValue rhs)
-
-
Less than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this < rhs), false if not, - and boolean interpreation of result if metatag processing occurs. -
Throws: -
LuaError - if either both operands are not a strings or both are not numbers - and no LT metatag is defined.
See Also:
gteq(LuaValue), -comparemt(LuaValue, LuaValue)
-
-
-
- -

-lt_b

-
-public boolean lt_b(int rhs)
-
-
Less than: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean. -

- To be comparable, this must derive from LuaNumber. -

-

-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this < rhs), false if not, - and boolean interpreation of result if metatag processing occurs. -
Throws: -
LuaError - if this is not a number - and no LT metatag is defined.
See Also:
gteq(int), -comparemt(LuaValue, LuaValue)
-
-
-
- -

-lt_b

-
-public boolean lt_b(double rhs)
-
-
Less than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this < rhs), false if not, - and boolean interpreation of result if metatag processing occurs. -
Throws: -
LuaError - if either both operands are not a strings or both are not numbers - and no LT metatag is defined.
See Also:
gteq(LuaValue), -comparemt(LuaValue, LuaValue)
-
-
-
- -

-lteq

-
-public LuaValue lteq(LuaValue rhs)
-
-
Less than or equals: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this <= rhs), FALSE if not, - or LuaValue if metatag processing occurs -
Throws: -
LuaError - if either both operands are not a strings or both are not numbers - and no LE metatag is defined.
See Also:
gteq_b(LuaValue), -comparemt(LuaValue, LuaValue)
-
-
-
- -

-lteq

-
-public LuaValue lteq(double rhs)
-
-
Less than or equals: Perform numeric comparison with another value - of double type, - including metatag processing, and returning LuaValue. -

- To be comparable, this must derive from LuaNumber. -

-

-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this <= rhs), FALSE if not, - or LuaValue if metatag processing occurs -
Throws: -
LuaError - if this is not a number - and no LE metatag is defined.
See Also:
gteq_b(double), -comparemt(LuaValue, LuaValue)
-
-
-
- -

-lteq

-
-public LuaValue lteq(int rhs)
-
-
Less than or equals: Perform numeric comparison with another value - of int type, - including metatag processing, and returning LuaValue. -

- To be comparable, this must derive from LuaNumber. -

-

-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this <= rhs), FALSE if not, - or LuaValue if metatag processing occurs -
Throws: -
LuaError - if this is not a number - and no LE metatag is defined.
See Also:
gteq_b(int), -comparemt(LuaValue, LuaValue)
-
-
-
- -

-lteq_b

-
-public boolean lteq_b(LuaValue rhs)
-
-
Less than or equals: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this <= rhs), false if not, - and boolean interpreation of result if metatag processing occurs. -
Throws: -
LuaError - if either both operands are not a strings or both are not numbers - and no LE metatag is defined.
See Also:
gteq(LuaValue), -comparemt(LuaValue, LuaValue)
-
-
-
- -

-lteq_b

-
-public boolean lteq_b(int rhs)
-
-
Less than or equals: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean. -

- To be comparable, this must derive from LuaNumber. -

-

-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this <= rhs), false if not, - and boolean interpreation of result if metatag processing occurs. -
Throws: -
LuaError - if this is not a number - and no LE metatag is defined.
See Also:
gteq(int), -comparemt(LuaValue, LuaValue)
-
-
-
- -

-lteq_b

-
-public boolean lteq_b(double rhs)
-
-
Less than or equals: Perform numeric comparison with another value - of double type, - including metatag processing, - and returning java boolean. -

- To be comparable, this must derive from LuaNumber. -

-

-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this <= rhs), false if not, - and boolean interpreation of result if metatag processing occurs. -
Throws: -
LuaError - if this is not a number - and no LE metatag is defined.
See Also:
gteq(double), -comparemt(LuaValue, LuaValue)
-
-
-
- -

-gt

-
-public LuaValue gt(LuaValue rhs)
-
-
Greater than: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this > rhs), FALSE if not, - or LuaValue if metatag processing occurs -
Throws: -
LuaError - if either both operands are not a strings or both are not numbers - and no LE metatag is defined.
See Also:
gteq_b(LuaValue), -comparemt(LuaValue, LuaValue)
-
-
-
- -

-gt

-
-public LuaValue gt(double rhs)
-
-
Greater than: Perform numeric comparison with another value - of double type, - including metatag processing, and returning LuaValue. -

- To be comparable, this must derive from LuaNumber. -

-

-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this > rhs), FALSE if not, - or LuaValue if metatag processing occurs -
Throws: -
LuaError - if this is not a number - and no LE metatag is defined.
See Also:
gteq_b(double), -comparemt(LuaValue, LuaValue)
-
-
-
- -

-gt

-
-public LuaValue gt(int rhs)
-
-
Greater than: Perform numeric comparison with another value - of int type, - including metatag processing, and returning LuaValue. -

- To be comparable, this must derive from LuaNumber. -

-

-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this > rhs), FALSE if not, - or LuaValue if metatag processing occurs -
Throws: -
LuaError - if this is not a number - and no LE metatag is defined.
See Also:
gteq_b(int), -comparemt(LuaValue, LuaValue)
-
-
-
- -

-gt_b

-
-public boolean gt_b(LuaValue rhs)
-
-
Greater than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this > rhs), false if not, - and boolean interpreation of result if metatag processing occurs. -
Throws: -
LuaError - if either both operands are not a strings or both are not numbers - and no LE metatag is defined.
See Also:
gteq(LuaValue), -comparemt(LuaValue, LuaValue)
-
-
-
- -

-gt_b

-
-public boolean gt_b(int rhs)
-
-
Greater than: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean. -

- To be comparable, this must derive from LuaNumber. -

-

-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this > rhs), false if not, - and boolean interpreation of result if metatag processing occurs. -
Throws: -
LuaError - if this is not a number - and no LE metatag is defined.
See Also:
gteq(int), -comparemt(LuaValue, LuaValue)
-
-
-
- -

-gt_b

-
-public boolean gt_b(double rhs)
-
-
Greater than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this > rhs), false if not, - and boolean interpreation of result if metatag processing occurs. -
Throws: -
LuaError - if either both operands are not a strings or both are not numbers - and no LE metatag is defined.
See Also:
gteq(LuaValue), -comparemt(LuaValue, LuaValue)
-
-
-
- -

-gteq

-
-public LuaValue gteq(LuaValue rhs)
-
-
Greater than or equals: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this >= rhs), FALSE if not, - or LuaValue if metatag processing occurs -
Throws: -
LuaError - if either both operands are not a strings or both are not numbers - and no LT metatag is defined.
See Also:
gteq_b(LuaValue), -comparemt(LuaValue, LuaValue)
-
-
-
- -

-gteq

-
-public LuaValue gteq(double rhs)
-
-
Greater than or equals: Perform numeric comparison with another value - of double type, - including metatag processing, and returning LuaValue. -

- To be comparable, this must derive from LuaNumber. -

-

-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this >= rhs), FALSE if not, - or LuaValue if metatag processing occurs -
Throws: -
LuaError - if this is not a number - and no LT metatag is defined.
See Also:
gteq_b(double), -comparemt(LuaValue, LuaValue)
-
-
-
- -

-gteq

-
-public LuaValue gteq(int rhs)
-
-
Greater than or equals: Perform numeric comparison with another value - of int type, - including metatag processing, and returning LuaValue. -

- To be comparable, this must derive from LuaNumber. -

-

-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
TRUE if (this >= rhs), FALSE if not, - or LuaValue if metatag processing occurs -
Throws: -
LuaError - if this is not a number - and no LT metatag is defined.
See Also:
gteq_b(int), -comparemt(LuaValue, LuaValue)
-
-
-
- -

-gteq_b

-
-public boolean gteq_b(LuaValue rhs)
-
-
Greater than or equals: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean. -

- To be comparable, both operands must derive from LuaString - or both must derive from LuaNumber. -

-

-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this >= rhs), false if not, - and boolean interpreation of result if metatag processing occurs. -
Throws: -
LuaError - if either both operands are not a strings or both are not numbers - and no LT metatag is defined.
See Also:
gteq(LuaValue), -comparemt(LuaValue, LuaValue)
-
-
-
- -

-gteq_b

-
-public boolean gteq_b(int rhs)
-
-
Greater than or equals: Perform numeric comparison with another value - of int type, - including metatag processing, - and returning java boolean. -

- To be comparable, this must derive from LuaNumber. -

-

-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this >= rhs), false if not, - and boolean interpreation of result if metatag processing occurs. -
Throws: -
LuaError - if this is not a number - and no LT metatag is defined.
See Also:
gteq(int), -comparemt(LuaValue, LuaValue)
-
-
-
- -

-gteq_b

-
-public boolean gteq_b(double rhs)
-
-
Greater than or equals: Perform numeric comparison with another value - of double type, - including metatag processing, - and returning java boolean. -

- To be comparable, this must derive from LuaNumber. -

-

-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Returns:
true if (this >= rhs), false if not, - and boolean interpreation of result if metatag processing occurs. -
Throws: -
LuaError - if this is not a number - and no LT metatag is defined.
See Also:
gteq(double), -comparemt(LuaValue, LuaValue)
-
-
-
- -

-comparemt

-
-public LuaValue comparemt(LuaValue tag,
-                          LuaValue op1)
-
-
Perform metatag processing for comparison operations. -

- Finds the supplied metatag value and invokes it, - or throws LuaError if none applies. -

-

-
Parameters:
tag - The metatag to look up
rhs - The right-hand-side value to perform the operation with -
Returns:
LuaValue resulting from metatag processing -
Throws: -
LuaError - if metatag was not defined for either operand, - or if the operands are not the same type, - or the metatag values for the two operands are different.
See Also:
gt(LuaValue), -gteq(LuaValue), -lt(LuaValue), -lteq(LuaValue)
-
-
-
- -

-strcmp

-
-public int strcmp(LuaValue rhs)
-
-
Perform string comparison with another value - of any type - using string comparison based on byte values. -

- Only strings can be compared, meaning - each operand must derive from LuaString. -

-

-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Throws: -
LuaError - if either operand is not a string
-
-
-
- -

-strcmp

-
-public int strcmp(LuaString rhs)
-
-
Perform string comparison with another value - known to be a LuaString - using string comparison based on byte values. -

- Only strings can be compared, meaning - each operand must derive from LuaString. -

-

-
Parameters:
rhs - The right-hand-side value to perform the comparison with -
Throws: -
LuaError - if this is not a string
-
-
-
- -

-concat

-
-public LuaValue concat(LuaValue rhs)
-
-
Concatenate another value onto this value and return the result - using rules of lua string concatenation including metatag processing. -

- Only strings and numbers as represented can be concatenated, meaning - each operand must derive from LuaString or LuaNumber. -

-

-
Parameters:
rhs - The right-hand-side value to perform the operation with -
Throws: -
LuaError - if either operand is not of an appropriate type, - such as nil or a table
-
-
-
- -

-concatTo

-
-public LuaValue concatTo(LuaValue lhs)
-
-
Reverse-concatenation: concatenate this value onto another value - whose type is unknwon - and return the result using rules of lua string concatenation including - metatag processing. -

- Only strings and numbers as represented can be concatenated, meaning - each operand must derive from LuaString or LuaNumber. -

-

-
Parameters:
lhs - The left-hand-side value onto which this will be concatenated -
Throws: -
LuaError - if either operand is not of an appropriate type, - such as nil or a table
See Also:
concat(LuaValue)
-
-
-
- -

-concatTo

-
-public LuaValue concatTo(LuaNumber lhs)
-
-
Reverse-concatenation: concatenate this value onto another value - known to be a LuaNumber - and return the result using rules of lua string concatenation including - metatag processing. -

- Only strings and numbers as represented can be concatenated, meaning - each operand must derive from LuaString or LuaNumber. -

-

-
Parameters:
lhs - The left-hand-side value onto which this will be concatenated -
Throws: -
LuaError - if either operand is not of an appropriate type, - such as nil or a table
See Also:
concat(LuaValue)
-
-
-
- -

-concatTo

-
-public LuaValue concatTo(LuaString lhs)
-
-
Reverse-concatenation: concatenate this value onto another value - known to be a LuaString - and return the result using rules of lua string concatenation including - metatag processing. -

- Only strings and numbers as represented can be concatenated, meaning - each operand must derive from LuaString or LuaNumber. -

-

-
Parameters:
lhs - The left-hand-side value onto which this will be concatenated -
Throws: -
LuaError - if either operand is not of an appropriate type, - such as nil or a table
See Also:
concat(LuaValue)
-
-
-
- -

-buffer

-
-public Buffer buffer()
-
-
Convert the value to a Buffer for more efficient concatenation of - multiple strings. -

-

- -
Returns:
Buffer instance containing the string or number
-
-
-
- -

-concat

-
-public Buffer concat(Buffer rhs)
-
-
Concatenate a Buffer onto this value and return the result - using rules of lua string concatenation including metatag processing. -

- Only strings and numbers as represented can be concatenated, meaning - each operand must derive from LuaString or LuaNumber. -

-

-
Parameters:
rhs - The right-hand-side Buffer to perform the operation with -
Returns:
LuaString resulting from concatenation of (this .. rhs) -
Throws: -
LuaError - if either operand is not of an appropriate type, - such as nil or a table
-
-
-
- -

-concatmt

-
-public LuaValue concatmt(LuaValue rhs)
-
-
Perform metatag processing for concatenation operations. -

- Finds the CONCAT metatag value and invokes it, - or throws LuaError if it doesn't exist. -

-

-
Parameters:
rhs - The right-hand-side value to perform the operation with -
Returns:
LuaValue resulting from metatag processing for CONCAT metatag. -
Throws: -
LuaError - if metatag was not defined for either operand
-
-
-
- -

-and

-
-public LuaValue and(LuaValue rhs)
-
-
Perform boolean and with another operand, based on lua rules for boolean evaluation. - This returns either this or rhs depending on the boolean value for this. -

-

-
Parameters:
rhs - The right-hand-side value to perform the operation with -
Returns:
this if this.toboolean() is false, rhs otherwise.
-
-
-
- -

-or

-
-public LuaValue or(LuaValue rhs)
-
-
Perform boolean or with another operand, based on lua rules for boolean evaluation. - This returns either this or rhs depending on the boolean value for this. -

-

-
Parameters:
rhs - The right-hand-side value to perform the operation with -
Returns:
this if this.toboolean() is true, rhs otherwise.
-
-
-
- -

-testfor_b

-
-public boolean testfor_b(LuaValue limit,
-                         LuaValue step)
-
-
Perform end-condition test in for-loop processing. -

- Used in lua-bytecode to Java-bytecode conversion. -

-

-
Parameters:
limit - the numerical limit to complete the for loop
step - the numberical step size to use. -
Returns:
true if limit has not been reached, false otherwise.
-
-
-
- -

-strvalue

-
-public LuaString strvalue()
-
-
Convert this value to a string if it is a LuaString or LuaNumber, - or throw a LuaError if it is not -

-

- -
Returns:
LuaString corresponding to the value if a string or number -
Throws: -
LuaError - if not a string or number
-
-
-
- -

-strongkey

-
-public LuaValue strongkey()
-
-
Return the key part of this value if it is a weak table entry, or NIL if it was weak and is no longer referenced. -

-

- -
Returns:
LuaValue key, or NIL if it was weak and is no longer referenced.
See Also:
WeakTable
-
-
-
- -

-strongvalue

-
-public LuaValue strongvalue()
-
-
Return this value as a strong reference, or NIL if it was weak and is no longer referenced. -

-

- -
Returns:
LuaValue referred to, or NIL if it was weak and is no longer referenced.
See Also:
WeakTable
-
-
-
- -

-isweaknil

-
-public boolean isweaknil()
-
-
Test if this is a weak reference and its value no longer is referenced. -

-

- -
Returns:
true if this is a weak reference whose value no longer is referenced
See Also:
WeakTable
-
-
-
- -

-valueOf

-
-public static LuaBoolean valueOf(boolean b)
-
-
Convert java boolean to a LuaValue. -

-

-
Parameters:
b - boolean value to convert -
Returns:
TRUE if not or FALSE if false
-
-
-
- -

-valueOf

-
-public static LuaInteger valueOf(int i)
-
-
Convert java int to a LuaValue. -

-

-
Parameters:
i - int value to convert -
Returns:
LuaInteger instance, possibly pooled, whose value is i
-
-
-
- -

-valueOf

-
-public static LuaNumber valueOf(double d)
-
-
Convert java double to a LuaValue. - This may return a LuaInteger or LuaDouble depending - on the value supplied. -

-

-
Parameters:
d - double value to convert -
Returns:
LuaNumber instance, possibly pooled, whose value is d
-
-
-
- -

-valueOf

-
-public static LuaString valueOf(java.lang.String s)
-
-
Convert java string to a LuaValue. -

-

-
Parameters:
s - String value to convert -
Returns:
LuaString instance, possibly pooled, whose value is s
-
-
-
- -

-valueOf

-
-public static LuaString valueOf(byte[] bytes)
-
-
Convert bytes in an array to a LuaValue. -

-

-
Parameters:
bytes - byte array to convert -
Returns:
LuaString instance, possibly pooled, whose bytes are those in the supplied array
-
-
-
- -

-valueOf

-
-public static LuaString valueOf(byte[] bytes,
-                                int off,
-                                int len)
-
-
Convert bytes in an array to a LuaValue. -

-

-
Parameters:
bytes - byte array to convert
off - offset into the byte array, starting at 0
len - number of bytes to include in the LuaString -
Returns:
LuaString instance, possibly pooled, whose bytes are those in the supplied array
-
-
-
- -

-tableOf

-
-public static LuaTable tableOf()
-
-
Construct an empty LuaTable. -

-

- -
Returns:
new LuaTable instance with no values and no metatable.
-
-
-
- -

-tableOf

-
-public static LuaTable tableOf(Varargs varargs,
-                               int firstarg)
-
-
Construct a LuaTable initialized with supplied array values. -

-

-
Parameters:
varargs - Varargs containing the values to use in initialization
firstarg - the index of the first argument to use from the varargs, 1 being the first. -
Returns:
new LuaTable instance with sequential elements coming from the varargs.
-
-
-
- -

-tableOf

-
-public static LuaTable tableOf(int narray,
-                               int nhash)
-
-
Construct an empty LuaTable preallocated to hold array and hashed elements -

-

-
Parameters:
narray - Number of array elements to preallocate
nhash - Number of hash elements to preallocate -
Returns:
new LuaTable instance with no values and no metatable, but preallocated for array and hashed elements.
-
-
-
- -

-listOf

-
-public static LuaTable listOf(LuaValue[] unnamedValues)
-
-
Construct a LuaTable initialized with supplied array values. -

-

-
Parameters:
unnamedValues - array of LuaValue containing the values to use in initialization -
Returns:
new LuaTable instance with sequential elements coming from the array.
-
-
-
- -

-listOf

-
-public static LuaTable listOf(LuaValue[] unnamedValues,
-                              Varargs lastarg)
-
-
Construct a LuaTable initialized with supplied array values. -

-

-
Parameters:
unnamedValues - array of LuaValue containing the first values to use in initialization
lastarg - Varargs containing additional values to use in initialization - to be put after the last unnamedValues element -
Returns:
new LuaTable instance with sequential elements coming from the array and varargs.
-
-
-
- -

-tableOf

-
-public static LuaTable tableOf(LuaValue[] namedValues)
-
-
Construct a LuaTable initialized with supplied named values. -

-

-
Parameters:
namedValues - array of LuaValue containing the keys and values to use in initialization - in order {key-a, value-a, key-b, value-b, ...} -
Returns:
new LuaTable instance with non-sequential keys coming from the supplied array.
-
-
-
- -

-tableOf

-
-public static LuaTable tableOf(LuaValue[] namedValues,
-                               LuaValue[] unnamedValues)
-
-
Construct a LuaTable initialized with supplied named values and sequential elements. - The named values will be assigned first, and the sequential elements will be assigned later, - possibly overwriting named values at the same slot if there are conflicts. -

-

-
Parameters:
namedValues - array of LuaValue containing the keys and values to use in initialization - in order {key-a, value-a, key-b, value-b, ...}
unnamedValues - array of LuaValue containing the sequenctial elements to use in initialization - in order {value-1, value-2, ...} , or null if there are none -
Returns:
new LuaTable instance with named and sequential values supplied.
-
-
-
- -

-tableOf

-
-public static LuaTable tableOf(LuaValue[] namedValues,
-                               LuaValue[] unnamedValues,
-                               Varargs lastarg)
-
-
Construct a LuaTable initialized with supplied named values and sequential elements in an array part and as varargs. - The named values will be assigned first, and the sequential elements will be assigned later, - possibly overwriting named values at the same slot if there are conflicts. -

-

-
Parameters:
namedValues - array of LuaValue containing the keys and values to use in initialization - in order {key-a, value-a, key-b, value-b, ...}
unnamedValues - array of LuaValue containing the first sequenctial elements to use in initialization - in order {value-1, value-2, ...} , or null if there are none
lastarg - Varargs containing additional values to use in the sequential part of the initialization, - to be put after the last unnamedValues element -
Returns:
new LuaTable instance with named and sequential values supplied.
-
-
-
- -

-userdataOf

-
-public static LuaUserdata userdataOf(java.lang.Object o)
-
-
Construct a LuaUserdata for an object. -

-

-
Parameters:
o - The java instance to be wrapped as userdata -
Returns:
LuaUserdata value wrapping the java instance.
-
-
-
- -

-userdataOf

-
-public static LuaUserdata userdataOf(java.lang.Object o,
-                                     LuaValue metatable)
-
-
Construct a LuaUserdata for an object with a user supplied metatable. -

-

-
Parameters:
o - The java instance to be wrapped as userdata
metatable - The metatble to associate with the userdata instance. -
Returns:
LuaUserdata value wrapping the java instance.
-
-
-
- -

-gettable

-
-protected static LuaValue gettable(LuaValue t,
-                                   LuaValue key)
-
-
get value from metatable operations, or NIL if not defined by metatables -

-

-
-
-
-
- -

-settable

-
-protected static boolean settable(LuaValue t,
-                                  LuaValue key,
-                                  LuaValue value)
-
-
Perform field assignment including metatag processing. -

-

-
Parameters:
t - LuaValue on which value is being set, typically a table or something with the metatag NEWINDEX defined
key - LuaValue naming the field to assign
value - LuaValue the new value to assign to key -
Returns:
true if assignment or metatag processing succeeded, false otherwise -
Throws: -
LuaError - if there is a loop in metatag processing
-
-
-
- -

-metatag

-
-public LuaValue metatag(LuaValue tag)
-
-
Get particular metatag, or return NIL if it doesn't exist -

-

-
Parameters:
tag - Metatag name to look up, typically a string such as - INDEX or NEWINDEX
reason - Description of error when tag lookup fails. -
Returns:
LuaValue for tag reason, or NIL
-
-
-
- -

-checkmetatag

-
-protected LuaValue checkmetatag(LuaValue tag,
-                                java.lang.String reason)
-
-
Get particular metatag, or throw LuaError if it doesn't exist -

-

-
Parameters:
tag - Metatag name to look up, typically a string such as - INDEX or NEWINDEX
reason - Description of error when tag lookup fails. -
Returns:
LuaValue that can be called -
Throws: -
LuaError - when the lookup fails.
-
-
-
- -

-varargsOf

-
-public static Varargs varargsOf(LuaValue[] v)
-
-
Construct a Varargs around an array of LuaValues. -

-

-
Parameters:
v - The array of LuaValues
more - Varargs contain values to include at the end -
Returns:
Varargs wrapping the supplied values.
See Also:
varargsOf(LuaValue, Varargs), -varargsOf(LuaValue[], int, int)
-
-
-
- -

-varargsOf

-
-public static Varargs varargsOf(LuaValue[] v,
-                                Varargs r)
-
-
Construct a Varargs around an array of LuaValues. -

-

-
Parameters:
v - The array of LuaValues
more - Varargs contain values to include at the end -
Returns:
Varargs wrapping the supplied values.
See Also:
varargsOf(LuaValue[]), -varargsOf(LuaValue[], int, int, Varargs)
-
-
-
- -

-varargsOf

-
-public static Varargs varargsOf(LuaValue[] v,
-                                int offset,
-                                int length)
-
-
Construct a Varargs around an array of LuaValues. -

-

-
Parameters:
v - The array of LuaValues
offset - number of initial values to skip in the array
length - number of values to include from the array -
Returns:
Varargs wrapping the supplied values.
See Also:
varargsOf(LuaValue[]), -varargsOf(LuaValue[], int, int, Varargs)
-
-
-
- -

-varargsOf

-
-public static Varargs varargsOf(LuaValue[] v,
-                                int offset,
-                                int length,
-                                Varargs more)
-
-
Construct a Varargs around an array of LuaValues. -

-

-
Parameters:
v - The array of LuaValues
offset - number of initial values to skip in the array
length - number of values to include from the array
more - Varargs contain values to include at the end -
Returns:
Varargs wrapping the supplied values.
See Also:
varargsOf(LuaValue[], Varargs), -varargsOf(LuaValue[], int, int)
-
-
-
- -

-varargsOf

-
-public static Varargs varargsOf(LuaValue v,
-                                Varargs r)
-
-
Construct a Varargs around a set of 2 or more LuaValues. -

- This can be used to wrap exactly 2 values, or a list consisting of 1 initial value - followed by another variable list of remaining values. -

-

-
Parameters:
v1 - First LuaValue in the Varargs
v2 - LuaValue supplying the 2rd value, - or Varargss supplying all values beyond the first -
Returns:
Varargs wrapping the supplied values.
-
-
-
- -

-varargsOf

-
-public static Varargs varargsOf(LuaValue v1,
-                                LuaValue v2,
-                                Varargs v3)
-
-
Construct a Varargs around a set of 3 or more LuaValues. -

- This can be used to wrap exactly 3 values, or a list consisting of 2 initial values - followed by another variable list of remaining values. -

-

-
Parameters:
v1 - First LuaValue in the Varargs
v2 - Second LuaValue in the Varargs
v3 - LuaValue supplying the 3rd value, - or Varargss supplying all values beyond the second -
Returns:
Varargs wrapping the supplied values.
-
-
-
- -

-tailcallOf

-
-public static Varargs tailcallOf(LuaValue func,
-                                 Varargs args)
-
-
Construct a TailcallVarargs around a function and arguments. -

- The tail call is not yet called or processing until the client invokes - TailcallVarargs.eval() which performs the tail call processing. -

- This method is typically not used directly by client code. - Instead use one of the function invocation methods. -

-

-
Parameters:
func - LuaValue to be called as a tail call
args - Varargs containing the arguments to the call -
Returns:
TailcallVarargs to be used in tailcall oprocessing.
See Also:
call(), -invoke(), -method(LuaValue), -invokemethod(LuaValue)
-
-
-
- -

-onInvoke

-
-public Varargs onInvoke(Varargs args)
-
-
Callback used during tail call processing to invoke the function once. -

- This may return a TailcallVarargs to be evaluated by the client. -

- This should not be called directly, instead use on of the call invocation functions. -

-

-
Parameters:
args - the arguments to the call invocation. -
Returns:
Varargs the return values, possible a TailcallVarargs.
See Also:
call(), -invoke(), -method(LuaValue), -invokemethod(LuaValue)
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/OrphanedThread.html b/luaj-2.0.3/docs/api/org/luaj/vm2/OrphanedThread.html deleted file mode 100644 index ceb24e533..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/OrphanedThread.html +++ /dev/null @@ -1,256 +0,0 @@ - - - - - - -OrphanedThread (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2 -
-Class OrphanedThread

-
-java.lang.Object
-  extended by java.lang.Throwable
-      extended by java.lang.Error
-          extended by org.luaj.vm2.OrphanedThread
-
-
-
All Implemented Interfaces:
java.io.Serializable
-
-
-
-
public class OrphanedThread
extends java.lang.Error
- - -

-Error sublcass that indicates a lua thread that is no - longer referenced has been detected. -

- The java thread in which this is thrown should correspond to a - LuaThread being used as a coroutine that could not possibly be - resumed again because there are no more references to the LuaThread with - which it is associated. Rather than locking up resources forever, this error - is thrown, and should fall through all the way to the thread's Thread.run() method. -

- Java code mixed with the luaj vm should not catch this error because it may - occur when the coroutine is not running, so any processing done during error - handling could break the thread-safety of the application because other lua - processing could be going on in a different thread. -

- -

-

-
See Also:
Serialized Form
-
- -

- - - - - - - - - - - -
-Constructor Summary
OrphanedThread() - -
-           
-  - - - - - - - -
-Method Summary
- - - - - - - -
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
- - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Constructor Detail
- -

-OrphanedThread

-
-public OrphanedThread()
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/Print.html b/luaj-2.0.3/docs/api/org/luaj/vm2/Print.html deleted file mode 100644 index 830afb036..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/Print.html +++ /dev/null @@ -1,451 +0,0 @@ - - - - - - -Print (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2 -
-Class Print

-
-java.lang.Object
-  extended by org.luaj.vm2.Lua
-      extended by org.luaj.vm2.Print
-
-
-
-
public class Print
extends Lua
- - -

-Debug helper class to pretty-print lua bytecodes. -

- -

-

-
See Also:
Prototype, -LuaClosure
-
- -

- - - - - - - - - - - - - - - -
-Field Summary
-static java.lang.String[]OPNAMES - -
-           
-static java.io.PrintStreamps - -
-           
- - - - - - - -
Fields inherited from class org.luaj.vm2.Lua
_VERSION, BITRK, iABC, iABx, iAsBx, LFIELDS_PER_FLUSH, LUA_MULTRET, luaP_opmodes, MASK_A, MASK_B, MASK_Bx, MASK_C, MASK_NOT_A, MASK_NOT_B, MASK_NOT_Bx, MASK_NOT_C, MASK_NOT_OP, MASK_OP, MAX_OP, MAXARG_A, MAXARG_B, MAXARG_Bx, MAXARG_C, MAXARG_sBx, MAXINDEXRK, NO_REG, NUM_OPCODES, OP_ADD, OP_AND, OP_CALL, OP_CLOSE, OP_CLOSURE, OP_CONCAT, OP_DIV, OP_EQ, OP_FORLOOP, OP_FORPREP, OP_GE, OP_GETGLOBAL, OP_GETTABLE, OP_GETUPVAL, OP_GT, OP_JMP, OP_LE, OP_LEN, OP_LOADBOOL, OP_LOADK, OP_LOADNIL, OP_LT, OP_MOD, OP_MOVE, OP_MUL, OP_NEQ, OP_NEWTABLE, OP_NOT, OP_OR, OP_POW, OP_RETURN, OP_SELF, OP_SETGLOBAL, OP_SETLIST, OP_SETTABLE, OP_SETUPVAL, OP_SUB, OP_TAILCALL, OP_TEST, OP_TESTSET, OP_TFORLOOP, OP_UNM, OP_VARARG, OpArgK, OpArgN, OpArgR, OpArgU, POS_A, POS_B, POS_Bx, POS_C, POS_OP, SIZE_A, SIZE_B, SIZE_Bx, SIZE_C, SIZE_OP, VARARG_HASARG, VARARG_ISVARARG, VARARG_NEEDSARG
-  - - - - - - - - - - -
-Constructor Summary
Print() - -
-           
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
-static voidprint(Prototype p) - -
-           
-static voidprintCode(Prototype f) - -
-          Print the code in a prototype
-static voidprintFunction(Prototype f, - boolean full) - -
-           
-static voidprintOpCode(java.io.PrintStream ps, - Prototype f, - int pc) - -
-          Print an opcode in a prototype
-static voidprintOpCode(Prototype f, - int pc) - -
-          Print an opcode in a prototype
-static voidprintState(LuaClosure cl, - int pc, - LuaValue[] stack, - int top, - Varargs varargs) - -
-          Print the state of a LuaClosure that is being executed
- - - - - - - -
Methods inherited from class org.luaj.vm2.Lua
GET_OPCODE, GETARG_A, GETARG_B, GETARG_Bx, GETARG_C, GETARG_sBx, getBMode, getCMode, getOpMode, INDEXK, ISK, RKASK, testAMode, testTMode
- - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-  -

- - - - - - - - -
-Field Detail
- -

-ps

-
-public static java.io.PrintStream ps
-
-
-
-
-
- -

-OPNAMES

-
-public static final java.lang.String[] OPNAMES
-
-
-
-
- - - - - - - - -
-Constructor Detail
- -

-Print

-
-public Print()
-
-
- - - - - - - - -
-Method Detail
- -

-printCode

-
-public static void printCode(Prototype f)
-
-
Print the code in a prototype -

-

-
Parameters:
f - the Prototype
-
-
-
- -

-printOpCode

-
-public static void printOpCode(Prototype f,
-                               int pc)
-
-
Print an opcode in a prototype -

-

-
Parameters:
f - the Prototype
pc - the program counter to look up and print
-
-
-
- -

-printOpCode

-
-public static void printOpCode(java.io.PrintStream ps,
-                               Prototype f,
-                               int pc)
-
-
Print an opcode in a prototype -

-

-
Parameters:
ps - the PrintStream to print to
f - the Prototype
pc - the program counter to look up and print
-
-
-
- -

-print

-
-public static void print(Prototype p)
-
-
-
-
-
-
- -

-printFunction

-
-public static void printFunction(Prototype f,
-                                 boolean full)
-
-
-
-
-
-
- -

-printState

-
-public static void printState(LuaClosure cl,
-                              int pc,
-                              LuaValue[] stack,
-                              int top,
-                              Varargs varargs)
-
-
Print the state of a LuaClosure that is being executed -

-

-
Parameters:
cl - the LuaClosure
pc - the program counter
stack - the stack of LuaValue
top - the top of the stack
varargs - any Varargs value that may apply
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/Prototype.html b/luaj-2.0.3/docs/api/org/luaj/vm2/Prototype.html deleted file mode 100644 index cd4132d42..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/Prototype.html +++ /dev/null @@ -1,543 +0,0 @@ - - - - - - -Prototype (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2 -
-Class Prototype

-
-java.lang.Object
-  extended by org.luaj.vm2.Prototype
-
-
-
-
public class Prototype
extends java.lang.Object
- - -

-Prototype representing compiled lua code. -

- This is both a straight translation of the corresponding C type, - and the main data structure for execution of compiled lua bytecode. -

- See documentatation on LuaClosure for information on how to load - and execute a Prototype. -

- -

-

-
See Also:
LuaClosure
-
- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Field Summary
- int[]code - -
-           
- intis_vararg - -
-           
- LuaValue[]k - -
-           
- intlastlinedefined - -
-           
- intlinedefined - -
-           
- int[]lineinfo - -
-           
- LocVars[]locvars - -
-           
- intmaxstacksize - -
-           
- intnumparams - -
-           
- intnups - -
-           
- Prototype[]p - -
-           
- LuaStringsource - -
-           
- LuaString[]upvalues - -
-           
-  - - - - - - - - - - -
-Constructor Summary
Prototype() - -
-           
-  - - - - - - - - - - - - - - - -
-Method Summary
- LuaStringgetlocalname(int number, - int pc) - -
-          Get the name of a local variable.
- java.lang.StringtoString() - -
-           
- - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Field Detail
- -

-k

-
-public LuaValue[] k
-
-
-
-
-
- -

-code

-
-public int[] code
-
-
-
-
-
- -

-p

-
-public Prototype[] p
-
-
-
-
-
- -

-lineinfo

-
-public int[] lineinfo
-
-
-
-
-
- -

-locvars

-
-public LocVars[] locvars
-
-
-
-
-
- -

-upvalues

-
-public LuaString[] upvalues
-
-
-
-
-
- -

-source

-
-public LuaString source
-
-
-
-
-
- -

-nups

-
-public int nups
-
-
-
-
-
- -

-linedefined

-
-public int linedefined
-
-
-
-
-
- -

-lastlinedefined

-
-public int lastlinedefined
-
-
-
-
-
- -

-numparams

-
-public int numparams
-
-
-
-
-
- -

-is_vararg

-
-public int is_vararg
-
-
-
-
-
- -

-maxstacksize

-
-public int maxstacksize
-
-
-
-
- - - - - - - - -
-Constructor Detail
- -

-Prototype

-
-public Prototype()
-
-
- - - - - - - - -
-Method Detail
- -

-toString

-
-public java.lang.String toString()
-
-
-
Overrides:
toString in class java.lang.Object
-
-
-
-
-
-
- -

-getlocalname

-
-public LuaString getlocalname(int number,
-                              int pc)
-
-
Get the name of a local variable. -

-

-
Parameters:
number - the local variable number to look up
pc - the program counter -
Returns:
the name, or null if not found
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/TailcallVarargs.html b/luaj-2.0.3/docs/api/org/luaj/vm2/TailcallVarargs.html deleted file mode 100644 index c8c7c5b37..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/TailcallVarargs.html +++ /dev/null @@ -1,416 +0,0 @@ - - - - - - -TailcallVarargs (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2 -
-Class TailcallVarargs

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.TailcallVarargs
-
-
-
-
public class TailcallVarargs
extends Varargs
- - -

-Subclass of Varargs that represents a lua tail call - in a Java library function execution environment. -

- Since Java doesn't have direct support for tail calls, - any lua function whose Prototype contains the - Lua.OP_TAILCALL bytecode needs a mechanism - for tail calls when converting lua-bytecode to java-bytecode. -

- The tail call holds the next function and arguments, - and the client a call to eval() executes the function - repeatedly until the tail calls are completed. -

- Normally, users of luaj need not concern themselves with the - details of this mechanism, as it is built into the core - execution framework. -

- -

-

-
See Also:
Prototype, -LuaJC
-
- -

- - - - - - - - - - - - - - -
-Constructor Summary
TailcallVarargs(LuaValue object, - LuaValue methodname, - Varargs args) - -
-           
TailcallVarargs(LuaValue f, - Varargs args) - -
-           
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
- LuaValuearg(int i) - -
-          Get the n-th argument value (1-based).
- LuaValuearg1() - -
-          Get the first argument in the list.
- Varargseval() - -
-          Evaluate any pending tail call and return result.
- booleanisTailcall() - -
-          Return true if this is a TailcallVarargs
- intnarg() - -
-          Get the number of arguments, or 0 if there are none.
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tojstring, tolong, toshort, toString, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Constructor Detail
- -

-TailcallVarargs

-
-public TailcallVarargs(LuaValue f,
-                       Varargs args)
-
-
-
- -

-TailcallVarargs

-
-public TailcallVarargs(LuaValue object,
-                       LuaValue methodname,
-                       Varargs args)
-
-
- - - - - - - - -
-Method Detail
- -

-isTailcall

-
-public boolean isTailcall()
-
-
Description copied from class: Varargs
-
Return true if this is a TailcallVarargs -

-

-
Overrides:
isTailcall in class Varargs
-
-
- -
Returns:
true if a tail call, false otherwise
-
-
-
- -

-eval

-
-public Varargs eval()
-
-
Description copied from class: Varargs
-
Evaluate any pending tail call and return result. -

-

-
Overrides:
eval in class Varargs
-
-
- -
Returns:
the evaluated tail call result
-
-
-
- -

-arg

-
-public LuaValue arg(int i)
-
-
Description copied from class: Varargs
-
Get the n-th argument value (1-based). -

-

-
Specified by:
arg in class Varargs
-
-
-
Parameters:
i - the index of the argument to get, 1 is the first argument -
Returns:
Value at position i, or LuaValue.NIL if there is none.
See Also:
Varargs.arg1(), -LuaValue.NIL
-
-
-
- -

-arg1

-
-public LuaValue arg1()
-
-
Description copied from class: Varargs
-
Get the first argument in the list. -

-

-
Specified by:
arg1 in class Varargs
-
-
- -
Returns:
LuaValue which is first in the list, or LuaValue.NIL if there are no values.
See Also:
Varargs.arg(int), -LuaValue.NIL
-
-
-
- -

-narg

-
-public int narg()
-
-
Description copied from class: Varargs
-
Get the number of arguments, or 0 if there are none. -

-

-
Specified by:
narg in class Varargs
-
-
- -
Returns:
number of arguments.
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/UpValue.html b/luaj-2.0.3/docs/api/org/luaj/vm2/UpValue.html deleted file mode 100644 index 7b595fa56..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/UpValue.html +++ /dev/null @@ -1,333 +0,0 @@ - - - - - - -UpValue (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2 -
-Class UpValue

-
-java.lang.Object
-  extended by org.luaj.vm2.UpValue
-
-
-
-
public final class UpValue
extends java.lang.Object
- - -

-Upvalue used with Closure formulation -

-

- -

-

-
See Also:
LuaClosure, -Prototype
-
- -

- - - - - - - - - - - -
-Constructor Summary
UpValue(LuaValue[] stack, - int index) - -
-          Create an upvalue relative to a stack
-  - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
- voidclose() - -
-          Close this upvalue so it is no longer on the stack
- LuaValuegetValue() - -
-          Get the value of the upvalue
- voidsetValue(LuaValue value) - -
-          Set the value of the upvalue
- java.lang.Stringtojstring() - -
-          Convert this upvalue to a Java String
- - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-  -

- - - - - - - - -
-Constructor Detail
- -

-UpValue

-
-public UpValue(LuaValue[] stack,
-               int index)
-
-
Create an upvalue relative to a stack -

-

-
Parameters:
stack - the stack
index - the index on the stack for the upvalue
-
- - - - - - - - -
-Method Detail
- -

-tojstring

-
-public java.lang.String tojstring()
-
-
Convert this upvalue to a Java String -

-

- -
Returns:
the Java String for this upvalue.
See Also:
LuaValue.tojstring()
-
-
-
- -

-getValue

-
-public final LuaValue getValue()
-
-
Get the value of the upvalue -

-

- -
Returns:
the LuaValue for this upvalue
-
-
-
- -

-setValue

-
-public final void setValue(LuaValue value)
-
-
Set the value of the upvalue -

-

-
Parameters:
the - LuaValue to set it to
-
-
-
- -

-close

-
-public final void close()
-
-
Close this upvalue so it is no longer on the stack -

-

-
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/Varargs.html b/luaj-2.0.3/docs/api/org/luaj/vm2/Varargs.html deleted file mode 100644 index bc3a5b586..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/Varargs.html +++ /dev/null @@ -1,1743 +0,0 @@ - - - - - - -Varargs (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2 -
-Class Varargs

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-
-
-
Direct Known Subclasses:
LuaValue, TailcallVarargs
-
-
-
-
public abstract class Varargs
extends java.lang.Object
- - -

-Class to encapsulate varargs values, either as part of a variable argument list, or multiple return values. -

- To construct varargs, use one of the static methods such as - LuaValue.varargsOf(LuaValue,LuaValue) -

-

- Any LuaValue can be used as a stand-in for Varargs, for both calls and return values. - When doing so, nargs() will return 1 and arg1() or arg(1) will return this. - This simplifies the case when calling or implementing varargs functions with only - 1 argument or 1 return value. -

- Varargs can also be derived from other varargs by appending to the front with a call - such as LuaValue.varargsOf(LuaValue,Varargs) - or by taking a portion of the args using Varargs.subargs(int start) -

-

- -

-

-
See Also:
LuaValue.varargsOf(LuaValue[]), -LuaValue.varargsOf(LuaValue, Varargs), -LuaValue.varargsOf(LuaValue[], Varargs), -LuaValue.varargsOf(LuaValue, LuaValue, Varargs), -LuaValue.varargsOf(LuaValue[], int, int), -LuaValue.varargsOf(LuaValue[], int, int, Varargs), -subargs(int)
-
- -

- - - - - - - - - - - -
-Constructor Summary
Varargs() - -
-           
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
-abstract  LuaValuearg(int i) - -
-          Get the n-th argument value (1-based).
-abstract  LuaValuearg1() - -
-          Get the first argument in the list.
- voidargcheck(boolean test, - int i, - java.lang.String msg) - -
-          Return argument i as a LuaValue when a user-supplied assertion passes, or throw an error.
- booleancheckboolean(int i) - -
-          Return argument i as a boolean value, or throw an error if any other type.
- LuaClosurecheckclosure(int i) - -
-          Return argument i as a closure, or throw an error if any other type.
- doublecheckdouble(int i) - -
-          Return argument i as a double, or throw an error if it cannot be converted to one.
- LuaValuecheckfunction(int i) - -
-          Return argument i as a function, or throw an error if an incompatible type.
- intcheckint(int i) - -
-          Return argument i as a java int value, discarding any fractional part, or throw an error if not a number.
- LuaIntegercheckinteger(int i) - -
-          Return argument i as a java int value, or throw an error if not a number or is not representable by a java int.
- java.lang.Stringcheckjstring(int i) - -
-          Return argument i as a java String if a string or number, or throw an error if any other type
- longchecklong(int i) - -
-          Return argument i as a java long value, discarding any fractional part, or throw an error if not a number.
- LuaValuechecknotnil(int i) - -
-          Return argument i as a LuaValue if it is not nil, or throw an error if it is nil.
- LuaNumberchecknumber(int i) - -
-          Return argument i as a LuaNumber, or throw an error if not a number or string that can be converted to a number.
- LuaStringcheckstring(int i) - -
-          Return argument i as a LuaString if a string or number, or throw an error if any other type
- LuaTablechecktable(int i) - -
-          Return argument i as a LuaTable if a lua table, or throw an error if any other type.
- LuaThreadcheckthread(int i) - -
-          Return argument i as a LuaThread if a lua thread, or throw an error if any other type.
- java.lang.Objectcheckuserdata(int i) - -
-          Return argument i as a java Object if a userdata, or throw an error if any other type.
- java.lang.Objectcheckuserdata(int i, - java.lang.Class c) - -
-          Return argument i as a java Object if it is a userdata whose instance Class c or a subclass, - or throw an error if any other type.
- LuaValuecheckvalue(int i) - -
-          Return argument i as a LuaValue if it exists, or throw an error.
- Varargseval() - -
-          Evaluate any pending tail call and return result.
- booleanisfunction(int i) - -
-          Tests if argument i is a function.
- booleanisnil(int i) - -
-          Tests if argument i is nil.
- booleanisnoneornil(int i) - -
-          Return true if there is no argument or nil at argument i.
- booleanisnumber(int i) - -
-          Tests if argument i is a number.
- booleanisstring(int i) - -
-          Tests if argument i is a string.
- booleanistable(int i) - -
-          Tests if argument i is a table.
- booleanisTailcall() - -
-          Return true if this is a TailcallVarargs
- booleanisthread(int i) - -
-          Tests if argument i is a thread.
- booleanisuserdata(int i) - -
-          Tests if argument i is a userdata.
- booleanisvalue(int i) - -
-          Tests if a value exists at argument i.
-abstract  intnarg() - -
-          Get the number of arguments, or 0 if there are none.
- booleanoptboolean(int i, - boolean defval) - -
-          Return argument i as a boolean value, defval if nil, or throw a LuaError if any other type.
- LuaClosureoptclosure(int i, - LuaClosure defval) - -
-          Return argument i as a closure, defval if nil, or throw a LuaError if any other type.
- doubleoptdouble(int i, - double defval) - -
-          Return argument i as a double, defval if nil, or throw a LuaError if it cannot be converted to one.
- LuaFunctionoptfunction(int i, - LuaFunction defval) - -
-          Return argument i as a function, defval if nil, or throw a LuaError if an incompatible type.
- intoptint(int i, - int defval) - -
-          Return argument i as a java int value, discarding any fractional part, defval if nil, or throw a LuaError if not a number.
- LuaIntegeroptinteger(int i, - LuaInteger defval) - -
-          Return argument i as a java int value, defval if nil, or throw a LuaError if not a number or is not representable by a java int.
- java.lang.Stringoptjstring(int i, - java.lang.String defval) - -
-          Return argument i as a java String if a string or number, defval if nil, or throw a LuaError if any other type
- longoptlong(int i, - long defval) - -
-          Return argument i as a java long value, discarding any fractional part, defval if nil, or throw a LuaError if not a number.
- LuaNumberoptnumber(int i, - LuaNumber defval) - -
-          Return argument i as a LuaNumber, defval if nil, or throw a LuaError if not a number or string that can be converted to a number.
- LuaStringoptstring(int i, - LuaString defval) - -
-          Return argument i as a LuaString if a string or number, defval if nil, or throw a LuaError if any other type
- LuaTableopttable(int i, - LuaTable defval) - -
-          Return argument i as a LuaTable if a lua table, defval if nil, or throw a LuaError if any other type.
- LuaThreadoptthread(int i, - LuaThread defval) - -
-          Return argument i as a LuaThread if a lua thread, defval if nil, or throw a LuaError if any other type.
- java.lang.Objectoptuserdata(int i, - java.lang.Class c, - java.lang.Object defval) - -
-          Return argument i as a java Object if it is a userdata whose instance Class c or a subclass, - defval if nil, or throw a LuaError if any other type.
- java.lang.Objectoptuserdata(int i, - java.lang.Object defval) - -
-          Return argument i as a java Object if a userdata, defval if nil, or throw a LuaError if any other type.
- LuaValueoptvalue(int i, - LuaValue defval) - -
-          Return argument i as a LuaValue if it exists, or defval.
- Varargssubargs(int start) - -
-          Create a Varargs instance containing arguments starting at index start
- booleantoboolean(int i) - -
-          Convert argument i to java boolean based on lua rules for boolean evaluation.
- bytetobyte(int i) - -
-          Return argument i as a java byte value, discarding any fractional part and truncating, - or 0 if not a number.
- chartochar(int i) - -
-          Return argument i as a java char value, discarding any fractional part and truncating, - or 0 if not a number.
- doubletodouble(int i) - -
-          Return argument i as a java double value or 0 if not a number.
- floattofloat(int i) - -
-          Return argument i as a java float value, discarding excess fractional part and truncating, - or 0 if not a number.
- inttoint(int i) - -
-          Return argument i as a java int value, discarding any fractional part and truncating, - or 0 if not a number.
- java.lang.Stringtojstring() - -
-          Convert the list of varargs values to a human readable java String.
- java.lang.Stringtojstring(int i) - -
-          Return argument i as a java String based on the type of the argument.
- longtolong(int i) - -
-          Return argument i as a java long value, discarding any fractional part and truncating, - or 0 if not a number.
- shorttoshort(int i) - -
-          Return argument i as a java short value, discarding any fractional part and truncating, - or 0 if not a number.
- java.lang.StringtoString() - -
-          Convert the value or values to a java String using Varargs.tojstring()
- java.lang.Objecttouserdata(int i) - -
-          Return argument i as a java Object if a userdata, or null.
- java.lang.Objecttouserdata(int i, - java.lang.Class c) - -
-          Return argument i as a java Object if it is a userdata whose instance Class c or a subclass, or null.
- inttype(int i) - -
-          Gets the type of argument i
- - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Constructor Detail
- -

-Varargs

-
-public Varargs()
-
-
- - - - - - - - -
-Method Detail
- -

-arg

-
-public abstract LuaValue arg(int i)
-
-
Get the n-th argument value (1-based). -

-

-
Parameters:
i - the index of the argument to get, 1 is the first argument -
Returns:
Value at position i, or LuaValue.NIL if there is none.
See Also:
arg1(), -LuaValue.NIL
-
-
-
- -

-narg

-
-public abstract int narg()
-
-
Get the number of arguments, or 0 if there are none. -

-

- -
Returns:
number of arguments.
-
-
-
- -

-arg1

-
-public abstract LuaValue arg1()
-
-
Get the first argument in the list. -

-

- -
Returns:
LuaValue which is first in the list, or LuaValue.NIL if there are no values.
See Also:
arg(int), -LuaValue.NIL
-
-
-
- -

-eval

-
-public Varargs eval()
-
-
Evaluate any pending tail call and return result. -

-

- -
Returns:
the evaluated tail call result
-
-
-
- -

-isTailcall

-
-public boolean isTailcall()
-
-
Return true if this is a TailcallVarargs -

-

- -
Returns:
true if a tail call, false otherwise
-
-
-
- -

-type

-
-public int type(int i)
-
-
Gets the type of argument i -

-

-
Parameters:
i - the index of the argument to convert, 1 is the first argument -
Returns:
int value corresponding to one of the LuaValue integer type values
See Also:
LuaValue.TNIL, -LuaValue.TBOOLEAN, -LuaValue.TNUMBER, -LuaValue.TSTRING, -LuaValue.TTABLE, -LuaValue.TFUNCTION, -LuaValue.TUSERDATA, -LuaValue.TTHREAD
-
-
-
- -

-isnil

-
-public boolean isnil(int i)
-
-
Tests if argument i is nil. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
true if the argument is nil or does not exist, false otherwise
See Also:
LuaValue.TNIL
-
-
-
- -

-isfunction

-
-public boolean isfunction(int i)
-
-
Tests if argument i is a function. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
true if the argument exists and is a function or closure, false otherwise
See Also:
LuaValue.TFUNCTION
-
-
-
- -

-isnumber

-
-public boolean isnumber(int i)
-
-
Tests if argument i is a number. - Since anywhere a number is required, a string can be used that - is a number, this will return true for both numbers and - strings that can be interpreted as numbers. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
true if the argument exists and is a number or - string that can be interpreted as a number, false otherwise
See Also:
LuaValue.TNUMBER, -LuaValue.TSTRING
-
-
-
- -

-isstring

-
-public boolean isstring(int i)
-
-
Tests if argument i is a string. - Since all lua numbers can be used where strings are used, - this will return true for both strings and numbers. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
true if the argument exists and is a string or number, false otherwise
See Also:
LuaValue.TNUMBER, -LuaValue.TSTRING
-
-
-
- -

-istable

-
-public boolean istable(int i)
-
-
Tests if argument i is a table. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
true if the argument exists and is a lua table, false otherwise
See Also:
LuaValue.TTABLE
-
-
-
- -

-isthread

-
-public boolean isthread(int i)
-
-
Tests if argument i is a thread. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
true if the argument exists and is a lua thread, false otherwise
See Also:
LuaValue.TTHREAD
-
-
-
- -

-isuserdata

-
-public boolean isuserdata(int i)
-
-
Tests if argument i is a userdata. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
true if the argument exists and is a userdata, false otherwise
See Also:
LuaValue.TUSERDATA
-
-
-
- -

-isvalue

-
-public boolean isvalue(int i)
-
-
Tests if a value exists at argument i. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
true if the argument exists, false otherwise
-
-
-
- -

-optboolean

-
-public boolean optboolean(int i,
-                          boolean defval)
-
-
Return argument i as a boolean value, defval if nil, or throw a LuaError if any other type. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
true if argument i is boolean true, false if it is false, or defval if not supplied or nil -
Throws: -
LuaError - if the argument is not a lua boolean
-
-
-
- -

-optclosure

-
-public LuaClosure optclosure(int i,
-                             LuaClosure defval)
-
-
Return argument i as a closure, defval if nil, or throw a LuaError if any other type. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
LuaClosure if argument i is a closure, or defval if not supplied or nil -
Throws: -
LuaError - if the argument is not a lua closure
-
-
-
- -

-optdouble

-
-public double optdouble(int i,
-                        double defval)
-
-
Return argument i as a double, defval if nil, or throw a LuaError if it cannot be converted to one. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
java double value if argument i is a number or string that converts to a number, or defval if not supplied or nil -
Throws: -
LuaError - if the argument is not a number
-
-
-
- -

-optfunction

-
-public LuaFunction optfunction(int i,
-                               LuaFunction defval)
-
-
Return argument i as a function, defval if nil, or throw a LuaError if an incompatible type. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
LuaValue that can be called if argument i is lua function or closure, or defval if not supplied or nil -
Throws: -
LuaError - if the argument is not a lua function or closure
-
-
-
- -

-optint

-
-public int optint(int i,
-                  int defval)
-
-
Return argument i as a java int value, discarding any fractional part, defval if nil, or throw a LuaError if not a number. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
int value with fraction discarded and truncated if necessary if argument i is number, or defval if not supplied or nil -
Throws: -
LuaError - if the argument is not a number
-
-
-
- -

-optinteger

-
-public LuaInteger optinteger(int i,
-                             LuaInteger defval)
-
-
Return argument i as a java int value, defval if nil, or throw a LuaError if not a number or is not representable by a java int. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
LuaInteger value that fits in a java int without rounding, or defval if not supplied or nil -
Throws: -
LuaError - if the argument cannot be represented by a java int value
-
-
-
- -

-optlong

-
-public long optlong(int i,
-                    long defval)
-
-
Return argument i as a java long value, discarding any fractional part, defval if nil, or throw a LuaError if not a number. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
long value with fraction discarded and truncated if necessary if argument i is number, or defval if not supplied or nil -
Throws: -
LuaError - if the argument is not a number
-
-
-
- -

-optnumber

-
-public LuaNumber optnumber(int i,
-                           LuaNumber defval)
-
-
Return argument i as a LuaNumber, defval if nil, or throw a LuaError if not a number or string that can be converted to a number. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument, or defval if not supplied or nil -
Returns:
LuaNumber if argument i is number or can be converted to a number -
Throws: -
LuaError - if the argument is not a number
-
-
-
- -

-optjstring

-
-public java.lang.String optjstring(int i,
-                                   java.lang.String defval)
-
-
Return argument i as a java String if a string or number, defval if nil, or throw a LuaError if any other type -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
String value if argument i is a string or number, or defval if not supplied or nil -
Throws: -
LuaError - if the argument is not a string or number
-
-
-
- -

-optstring

-
-public LuaString optstring(int i,
-                           LuaString defval)
-
-
Return argument i as a LuaString if a string or number, defval if nil, or throw a LuaError if any other type -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
LuaString value if argument i is a string or number, or defval if not supplied or nil -
Throws: -
LuaError - if the argument is not a string or number
-
-
-
- -

-opttable

-
-public LuaTable opttable(int i,
-                         LuaTable defval)
-
-
Return argument i as a LuaTable if a lua table, defval if nil, or throw a LuaError if any other type. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
LuaTable value if a table, or defval if not supplied or nil -
Throws: -
LuaError - if the argument is not a lua table
-
-
-
- -

-optthread

-
-public LuaThread optthread(int i,
-                           LuaThread defval)
-
-
Return argument i as a LuaThread if a lua thread, defval if nil, or throw a LuaError if any other type. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
LuaThread value if a thread, or defval if not supplied or nil -
Throws: -
LuaError - if the argument is not a lua thread
-
-
-
- -

-optuserdata

-
-public java.lang.Object optuserdata(int i,
-                                    java.lang.Object defval)
-
-
Return argument i as a java Object if a userdata, defval if nil, or throw a LuaError if any other type. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
java Object value if argument i is a userdata, or defval if not supplied or nil -
Throws: -
LuaError - if the argument is not a userdata
-
-
-
- -

-optuserdata

-
-public java.lang.Object optuserdata(int i,
-                                    java.lang.Class c,
-                                    java.lang.Object defval)
-
-
Return argument i as a java Object if it is a userdata whose instance Class c or a subclass, - defval if nil, or throw a LuaError if any other type. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument
c - the class to which the userdata instance must be assignable -
Returns:
java Object value if argument i is a userdata whose instance Class c or a subclass, or defval if not supplied or nil -
Throws: -
LuaError - if the argument is not a userdata or from whose instance c is not assignable
-
-
-
- -

-optvalue

-
-public LuaValue optvalue(int i,
-                         LuaValue defval)
-
-
Return argument i as a LuaValue if it exists, or defval. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
LuaValue value if the argument exists, defval if not -
Throws: -
LuaError - if the argument does not exist.
-
-
-
- -

-checkboolean

-
-public boolean checkboolean(int i)
-
-
Return argument i as a boolean value, or throw an error if any other type. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
true if argument i is boolean true, false if it is false -
Throws: -
LuaError - if the argument is not a lua boolean
-
-
-
- -

-checkclosure

-
-public LuaClosure checkclosure(int i)
-
-
Return argument i as a closure, or throw an error if any other type. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
LuaClosure if argument i is a closure. -
Throws: -
LuaError - if the argument is not a lua closure
-
-
-
- -

-checkdouble

-
-public double checkdouble(int i)
-
-
Return argument i as a double, or throw an error if it cannot be converted to one. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
java double value if argument i is a number or string that converts to a number -
Throws: -
LuaError - if the argument is not a number
-
-
-
- -

-checkfunction

-
-public LuaValue checkfunction(int i)
-
-
Return argument i as a function, or throw an error if an incompatible type. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
LuaValue that can be called if argument i is lua function or closure -
Throws: -
LuaError - if the argument is not a lua function or closure
-
-
-
- -

-checkint

-
-public int checkint(int i)
-
-
Return argument i as a java int value, discarding any fractional part, or throw an error if not a number. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
int value with fraction discarded and truncated if necessary if argument i is number -
Throws: -
LuaError - if the argument is not a number
-
-
-
- -

-checkinteger

-
-public LuaInteger checkinteger(int i)
-
-
Return argument i as a java int value, or throw an error if not a number or is not representable by a java int. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
LuaInteger value that fits in a java int without rounding -
Throws: -
LuaError - if the argument cannot be represented by a java int value
-
-
-
- -

-checklong

-
-public long checklong(int i)
-
-
Return argument i as a java long value, discarding any fractional part, or throw an error if not a number. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
long value with fraction discarded and truncated if necessary if argument i is number -
Throws: -
LuaError - if the argument is not a number
-
-
-
- -

-checknumber

-
-public LuaNumber checknumber(int i)
-
-
Return argument i as a LuaNumber, or throw an error if not a number or string that can be converted to a number. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
LuaNumber if argument i is number or can be converted to a number -
Throws: -
LuaError - if the argument is not a number
-
-
-
- -

-checkjstring

-
-public java.lang.String checkjstring(int i)
-
-
Return argument i as a java String if a string or number, or throw an error if any other type -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
String value if argument i is a string or number -
Throws: -
LuaError - if the argument is not a string or number
-
-
-
- -

-checkstring

-
-public LuaString checkstring(int i)
-
-
Return argument i as a LuaString if a string or number, or throw an error if any other type -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
LuaString value if argument i is a string or number -
Throws: -
LuaError - if the argument is not a string or number
-
-
-
- -

-checktable

-
-public LuaTable checktable(int i)
-
-
Return argument i as a LuaTable if a lua table, or throw an error if any other type. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
LuaTable value if a table -
Throws: -
LuaError - if the argument is not a lua table
-
-
-
- -

-checkthread

-
-public LuaThread checkthread(int i)
-
-
Return argument i as a LuaThread if a lua thread, or throw an error if any other type. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
LuaThread value if a thread -
Throws: -
LuaError - if the argument is not a lua thread
-
-
-
- -

-checkuserdata

-
-public java.lang.Object checkuserdata(int i)
-
-
Return argument i as a java Object if a userdata, or throw an error if any other type. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
java Object value if argument i is a userdata -
Throws: -
LuaError - if the argument is not a userdata
-
-
-
- -

-checkuserdata

-
-public java.lang.Object checkuserdata(int i,
-                                      java.lang.Class c)
-
-
Return argument i as a java Object if it is a userdata whose instance Class c or a subclass, - or throw an error if any other type. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument
c - the class to which the userdata instance must be assignable -
Returns:
java Object value if argument i is a userdata whose instance Class c or a subclass -
Throws: -
LuaError - if the argument is not a userdata or from whose instance c is not assignable
-
-
-
- -

-checkvalue

-
-public LuaValue checkvalue(int i)
-
-
Return argument i as a LuaValue if it exists, or throw an error. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
LuaValue value if the argument exists -
Throws: -
LuaError - if the argument does not exist.
-
-
-
- -

-checknotnil

-
-public LuaValue checknotnil(int i)
-
-
Return argument i as a LuaValue if it is not nil, or throw an error if it is nil. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
LuaValue value if the argument is not nil -
Throws: -
LuaError - if the argument doesn't exist or evaluates to nil.
-
-
-
- -

-argcheck

-
-public void argcheck(boolean test,
-                     int i,
-                     java.lang.String msg)
-
-
Return argument i as a LuaValue when a user-supplied assertion passes, or throw an error. -

-

-
Parameters:
test - user supplied assertion to test against
i - the index to report in any error message
msg - the error message to use when the test fails -
Throws: -
LuaError - if the the value of test is false
-
-
-
- -

-isnoneornil

-
-public boolean isnoneornil(int i)
-
-
Return true if there is no argument or nil at argument i. -

-

-
Parameters:
i - the index of the argument to test, 1 is the first argument -
Returns:
true if argument i contains either no argument or nil
-
-
-
- -

-toboolean

-
-public boolean toboolean(int i)
-
-
Convert argument i to java boolean based on lua rules for boolean evaluation. -

-

-
Parameters:
i - the index of the argument to convert, 1 is the first argument -
Returns:
false if argument i is nil or false, otherwise true
-
-
-
- -

-tobyte

-
-public byte tobyte(int i)
-
-
Return argument i as a java byte value, discarding any fractional part and truncating, - or 0 if not a number. -

-

-
Parameters:
i - the index of the argument to convert, 1 is the first argument -
Returns:
byte value with fraction discarded and truncated if necessary if argument i is number, otherwise 0
-
-
-
- -

-tochar

-
-public char tochar(int i)
-
-
Return argument i as a java char value, discarding any fractional part and truncating, - or 0 if not a number. -

-

-
Parameters:
i - the index of the argument to convert, 1 is the first argument -
Returns:
char value with fraction discarded and truncated if necessary if argument i is number, otherwise 0
-
-
-
- -

-todouble

-
-public double todouble(int i)
-
-
Return argument i as a java double value or 0 if not a number. -

-

-
Parameters:
i - the index of the argument to convert, 1 is the first argument -
Returns:
double value if argument i is number, otherwise 0
-
-
-
- -

-tofloat

-
-public float tofloat(int i)
-
-
Return argument i as a java float value, discarding excess fractional part and truncating, - or 0 if not a number. -

-

-
Parameters:
i - the index of the argument to convert, 1 is the first argument -
Returns:
float value with excess fraction discarded and truncated if necessary if argument i is number, otherwise 0
-
-
-
- -

-toint

-
-public int toint(int i)
-
-
Return argument i as a java int value, discarding any fractional part and truncating, - or 0 if not a number. -

-

-
Parameters:
i - the index of the argument to convert, 1 is the first argument -
Returns:
int value with fraction discarded and truncated if necessary if argument i is number, otherwise 0
-
-
-
- -

-tolong

-
-public long tolong(int i)
-
-
Return argument i as a java long value, discarding any fractional part and truncating, - or 0 if not a number. -

-

-
Parameters:
i - the index of the argument to convert, 1 is the first argument -
Returns:
long value with fraction discarded and truncated if necessary if argument i is number, otherwise 0
-
-
-
- -

-tojstring

-
-public java.lang.String tojstring(int i)
-
-
Return argument i as a java String based on the type of the argument. -

-

-
Parameters:
i - the index of the argument to convert, 1 is the first argument -
Returns:
String value representing the type
-
-
-
- -

-toshort

-
-public short toshort(int i)
-
-
Return argument i as a java short value, discarding any fractional part and truncating, - or 0 if not a number. -

-

-
Parameters:
i - the index of the argument to convert, 1 is the first argument -
Returns:
short value with fraction discarded and truncated if necessary if argument i is number, otherwise 0
-
-
-
- -

-touserdata

-
-public java.lang.Object touserdata(int i)
-
-
Return argument i as a java Object if a userdata, or null. -

-

-
Parameters:
i - the index of the argument to convert, 1 is the first argument -
Returns:
java Object value if argument i is a userdata, otherwise null
-
-
-
- -

-touserdata

-
-public java.lang.Object touserdata(int i,
-                                   java.lang.Class c)
-
-
Return argument i as a java Object if it is a userdata whose instance Class c or a subclass, or null. -

-

-
Parameters:
i - the index of the argument to convert, 1 is the first argument
c - the class to which the userdata instance must be assignable -
Returns:
java Object value if argument i is a userdata whose instance Class c or a subclass, otherwise null
-
-
-
- -

-tojstring

-
-public java.lang.String tojstring()
-
-
Convert the list of varargs values to a human readable java String. -

-

- -
Returns:
String value in human readable form such as {1,2}.
-
-
-
- -

-toString

-
-public java.lang.String toString()
-
-
Convert the value or values to a java String using Varargs.tojstring() -

-

-
Overrides:
toString in class java.lang.Object
-
-
- -
Returns:
String value in human readable form.
See Also:
tojstring()
-
-
-
- -

-subargs

-
-public Varargs subargs(int start)
-
-
Create a Varargs instance containing arguments starting at index start -

-

-
Parameters:
start - the index from which to include arguments, where 1 is the first argument. -
Returns:
Varargs containing argument { start, start+1, ... , narg-start-1 }
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/WeakTable.html b/luaj-2.0.3/docs/api/org/luaj/vm2/WeakTable.html deleted file mode 100644 index 607768691..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/WeakTable.html +++ /dev/null @@ -1,733 +0,0 @@ - - - - - - -WeakTable (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2 -
-Class WeakTable

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.LuaTable
-              extended by org.luaj.vm2.WeakTable
-
-
-
-
public class WeakTable
extends LuaTable
- - -

-Subclass of LuaTable that provides weak key and weak value semantics. -

- Normally these are not created directly, but indirectly when changing the mode - of a LuaTable as lua script executes. -

- However, calling the constructors directly when weak tables are required from - Java will reduce overhead. -

- -

-


- -

- - - - - - - -
-Field Summary
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaTable
array, hashEntries, hashKeys, hashValues, m_metatable
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - - - - - - - - - - -
-Constructor Summary
- WeakTable(boolean weakkeys, - boolean weakvalues) - -
-          Construct a table with weak keys, weak values, or both
-protected WeakTable(boolean weakkeys, - boolean weakvalues, - int narray, - int nhash) - -
-          Construct a table with weak keys, weak values, or both, and an initial capacity
-protected WeakTable(boolean weakkeys, - boolean weakvalues, - LuaTable source) - -
-          Construct a table with weak keys, weak values, or both, and a source of initial data
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
-protected  LuaTablechangemode(boolean weakkeys, - boolean weakvalues) - -
-          Change the mode of a table
-protected  intgetArrayLength() - -
-          Get the length of the array part of the table.
-protected  intgetHashLength() - -
-          Get the length of the hash part of the table.
- inthashFindSlot(LuaValue key) - -
-          Find the hashtable slot to use
-protected  LuaValuehashget(LuaValue key) - -
-          Get the hash value for a key - key the key to look up
- intmaxn() - -
-          Return table.maxn() as defined by lua 5.0.
- Varargsnext(LuaValue key) - -
-          Get the next element after a particular key in the table
- voidpresize(int narray) - -
-          Preallocate the array part of a table to be a certain size,
- voidpresize(int narray, - int nhash) - -
-          Presize capacity of both array and hash parts.
- LuaValuerawget(int key) - -
-          Get a value in a table without metatag processing.
- LuaValuerawget(LuaValue key) - -
-          Get a value in a table without metatag processing.
- voidrawset(int key, - LuaValue value) - -
-          Set a value in a table without metatag processing.
- voidrawset(LuaValue key, - LuaValue value) - -
-          caller must ensure key is not nil
- voidsort(LuaValue comparator) - -
-          Sort the table using a comparator.
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaTable
checktable, concat, eq_b, eq, foreach, foreachi, get, get, getmetatable, getn, hashClearSlot, hashset, inext, insert, istable, keyCount, keys, len, length, opttable, remove, set, set, setmetatable, type, typename
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
add, add, add, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, call, call, call, call, callmt, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checkmetatag, checknotnil, checknumber, checknumber, checkstring, checkthread, checkuserdata, checkuserdata, checkvalidkey, compareerror, compareerror, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, div, div, div, divInto, eqmtcall, equals, error, get, getfenv, gettable, gt_b, gt_b, gt_b, gt, gt, gt, gteq_b, gteq_b, gteq_b, gteq, gteq, gteq, illegal, invoke, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isfunction, isint, isinttype, islong, isnil, isnumber, isstring, isthread, isuserdata, isuserdata, isweaknil, lenerror, listOf, listOf, load, lt_b, lt_b, lt_b, lt, lt, lt, lteq_b, lteq_b, lteq_b, lteq, lteq, lteq, metatag, method, method, method, method, method, method, mod, mod, mod, modFrom, mul, mul, mul, narg, neg, neq_b, neq, not, onInvoke, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, optthread, optuserdata, optuserdata, optvalue, or, pow, pow, pow, powWith, powWith, raweq, raweq, raweq, raweq, raweq, rawget, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, setfenv, settable, strcmp, strcmp, strongkey, strongvalue, strvalue, sub, sub, sub, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, tonumber, toshort, tostring, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Constructor Detail
- -

-WeakTable

-
-public WeakTable(boolean weakkeys,
-                 boolean weakvalues)
-
-
Construct a table with weak keys, weak values, or both -

-

-
Parameters:
weakkeys - true to let the table have weak keys
weakvalues - true to let the table have weak values
-
-
- -

-WeakTable

-
-protected WeakTable(boolean weakkeys,
-                    boolean weakvalues,
-                    int narray,
-                    int nhash)
-
-
Construct a table with weak keys, weak values, or both, and an initial capacity -

-

-
Parameters:
weakkeys - true to let the table have weak keys
weakvalues - true to let the table have weak values
narray - capacity of array part
nhash - capacity of hash part
-
-
- -

-WeakTable

-
-protected WeakTable(boolean weakkeys,
-                    boolean weakvalues,
-                    LuaTable source)
-
-
Construct a table with weak keys, weak values, or both, and a source of initial data -

-

-
Parameters:
weakkeys - true to let the table have weak keys
weakvalues - true to let the table have weak values
source - LuaTable containing the initial elements
-
- - - - - - - - -
-Method Detail
- -

-presize

-
-public void presize(int narray)
-
-
Description copied from class: LuaValue
-
Preallocate the array part of a table to be a certain size, -

- Primarily used internally in response to a SETLIST bytecode. -

-

-
Overrides:
presize in class LuaTable
-
-
-
Parameters:
narray - the number of array slots to preallocate in the table.
-
-
-
- -

-presize

-
-public void presize(int narray,
-                    int nhash)
-
-
Presize capacity of both array and hash parts. -

-

-
Overrides:
presize in class LuaTable
-
-
-
Parameters:
narray - capacity of array part
nhash - capacity of hash part
-
-
-
- -

-getArrayLength

-
-protected int getArrayLength()
-
-
Description copied from class: LuaTable
-
Get the length of the array part of the table. -

-

-
Overrides:
getArrayLength in class LuaTable
-
-
- -
Returns:
length of the array part, does not relate to count of objects in the table.
-
-
-
- -

-getHashLength

-
-protected int getHashLength()
-
-
Description copied from class: LuaTable
-
Get the length of the hash part of the table. -

-

-
Overrides:
getHashLength in class LuaTable
-
-
- -
Returns:
length of the hash part, does not relate to count of objects in the table.
-
-
-
- -

-changemode

-
-protected LuaTable changemode(boolean weakkeys,
-                              boolean weakvalues)
-
-
Description copied from class: LuaTable
-
Change the mode of a table -

-

-
Overrides:
changemode in class LuaTable
-
-
-
Parameters:
weakkeys - true to make the table have weak keys going forward
weakvalues - true to make the table have weak values going forward -
Returns:
this or a new WeakTable if the mode change requires copying.
-
-
-
- -

-rawset

-
-public void rawset(int key,
-                   LuaValue value)
-
-
Description copied from class: LuaValue
-
Set a value in a table without metatag processing. -

-

-
Overrides:
rawset in class LuaTable
-
-
-
Parameters:
key - the key to use
value - the value to use, can be NIL, must not be null
-
-
-
- -

-rawset

-
-public void rawset(LuaValue key,
-                   LuaValue value)
-
-
Description copied from class: LuaTable
-
caller must ensure key is not nil -

-

-
Overrides:
rawset in class LuaTable
-
-
-
Parameters:
key - the key to use, must not be NIL or null
value - the value to use, can be NIL, must not be null
-
-
-
- -

-rawget

-
-public LuaValue rawget(int key)
-
-
Description copied from class: LuaValue
-
Get a value in a table without metatag processing. -

-

-
Overrides:
rawget in class LuaTable
-
-
-
Parameters:
key - the key to look up -
Returns:
LuaValue for that key, or NIL if not found
-
-
-
- -

-rawget

-
-public LuaValue rawget(LuaValue key)
-
-
Description copied from class: LuaValue
-
Get a value in a table without metatag processing. -

-

-
Overrides:
rawget in class LuaTable
-
-
-
Parameters:
key - the key to look up, must not be NIL or null -
Returns:
LuaValue for that key, or NIL if not found
-
-
-
- -

-hashget

-
-protected LuaValue hashget(LuaValue key)
-
-
Get the hash value for a key - key the key to look up -

-

-
Overrides:
hashget in class LuaTable
-
-
-
-
-
-
- -

-hashFindSlot

-
-public int hashFindSlot(LuaValue key)
-
-
Description copied from class: LuaTable
-
Find the hashtable slot to use -

-

-
Overrides:
hashFindSlot in class LuaTable
-
-
-
Parameters:
key - key to look for -
Returns:
slot to use
-
-
-
- -

-maxn

-
-public int maxn()
-
-
Description copied from class: LuaTable
-
Return table.maxn() as defined by lua 5.0. -

- Provided for compatibility, not a scalable operation. -

-

-
Overrides:
maxn in class LuaTable
-
-
- -
Returns:
value for maxn
-
-
-
- -

-next

-
-public Varargs next(LuaValue key)
-
-
Get the next element after a particular key in the table -

-

-
Overrides:
next in class LuaTable
-
-
-
Parameters:
key - LuaInteger value identifying a key to start from, - or NIL to start at the beginning -
Returns:
key,value or nil
See Also:
LuaTable, -#inext(), -LuaValue.valueOf(int), -Varargs.arg1(), -Varargs.arg(int), -LuaValue.isnil()
-
-
-
- -

-sort

-
-public void sort(LuaValue comparator)
-
-
Description copied from class: LuaTable
-
Sort the table using a comparator. -

-

-
Overrides:
sort in class LuaTable
-
-
-
Parameters:
comparator - LuaValue to be called to compare elements.
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/Buffer.html b/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/Buffer.html deleted file mode 100644 index a2839392e..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/Buffer.html +++ /dev/null @@ -1,311 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.Buffer (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.Buffer

-
- - - - - - - - - -
-Packages that use Buffer
org.luaj.vm2  
-  -

- - - - - -
-Uses of Buffer in org.luaj.vm2
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Methods in org.luaj.vm2 that return Buffer
- BufferBuffer.append(byte b) - -
-          Append a single byte to the buffer.
- BufferBuffer.append(LuaString str) - -
-          Append a LuaString to the buffer.
- BufferBuffer.append(LuaValue val) - -
-          Append a LuaValue to the buffer.
- BufferBuffer.append(java.lang.String str) - -
-          Append a Java String to the buffer.
- BufferLuaValue.buffer() - -
-          Convert the value to a Buffer for more efficient concatenation of - multiple strings.
- BufferLuaNumber.concat(Buffer rhs) - -
-           
- BufferLuaString.concat(Buffer rhs) - -
-           
- BufferLuaValue.concat(Buffer rhs) - -
-          Concatenate a Buffer onto this value and return the result - using rules of lua string concatenation including metatag processing.
- BufferBuffer.concatTo(LuaNumber lhs) - -
-          Concatenate this buffer onto a LuaNumber
- BufferBuffer.concatTo(LuaString lhs) - -
-          Concatenate this buffer onto a LuaString
- BufferBuffer.concatTo(LuaValue lhs) - -
-          Concatenate this buffer onto a LuaValue
- BufferBuffer.prepend(LuaString s) - -
-          Concatenate bytes from a LuaString onto the front of this buffer
- BufferBuffer.setvalue(LuaValue value) - -
-          Set buffer contents as a LuaValue
-  -

- - - - - - - - - - - - - - - - - -
Methods in org.luaj.vm2 with parameters of type Buffer
- BufferLuaNumber.concat(Buffer rhs) - -
-           
- BufferLuaString.concat(Buffer rhs) - -
-           
- BufferLuaValue.concat(Buffer rhs) - -
-          Concatenate a Buffer onto this value and return the result - using rules of lua string concatenation including metatag processing.
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LoadState.LuaCompiler.html b/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LoadState.LuaCompiler.html deleted file mode 100644 index 9546b35cb..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LoadState.LuaCompiler.html +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - -Uses of Interface org.luaj.vm2.LoadState.LuaCompiler (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Interface
org.luaj.vm2.LoadState.LuaCompiler

-
- - - - - - - - - - - - - - - - - -
-Packages that use LoadState.LuaCompiler
org.luaj.vm2  
org.luaj.vm2.compiler  
org.luaj.vm2.luajc  
-  -

- - - - - -
-Uses of LoadState.LuaCompiler in org.luaj.vm2
-  -

- - - - - - - - - -
Fields in org.luaj.vm2 declared as LoadState.LuaCompiler
-static LoadState.LuaCompilerLoadState.compiler - -
-          Compiler instance, if installed
-  -

- - - - - -
-Uses of LoadState.LuaCompiler in org.luaj.vm2.compiler
-  -

- - - - - - - - - -
Classes in org.luaj.vm2.compiler that implement LoadState.LuaCompiler
- classLuaC - -
-          Compiler for Lua.
-  -

- - - - - -
-Uses of LoadState.LuaCompiler in org.luaj.vm2.luajc
-  -

- - - - - - - - - -
Classes in org.luaj.vm2.luajc that implement LoadState.LuaCompiler
- classLuaJC - -
-          Implementation of LoadState.LuaCompiler which does direct - lua-to-java-bytecode compiling.
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LoadState.html b/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LoadState.html deleted file mode 100644 index 15fd443d3..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LoadState.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.LoadState (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.LoadState

-
-No usage of org.luaj.vm2.LoadState -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LocVars.html b/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LocVars.html deleted file mode 100644 index 0e74db19f..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LocVars.html +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.LocVars (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.LocVars

-
- - - - - - - - - -
-Packages that use LocVars
org.luaj.vm2  
-  -

- - - - - -
-Uses of LocVars in org.luaj.vm2
-  -

- - - - - - - - - -
Fields in org.luaj.vm2 declared as LocVars
- LocVars[]Prototype.locvars - -
-           
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/Lua.html b/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/Lua.html deleted file mode 100644 index 67bcb5273..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/Lua.html +++ /dev/null @@ -1,209 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.Lua (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.Lua

-
- - - - - - - - - - - - - -
-Packages that use Lua
org.luaj.vm2  
org.luaj.vm2.compiler  
-  -

- - - - - -
-Uses of Lua in org.luaj.vm2
-  -

- - - - - - - - - -
Subclasses of Lua in org.luaj.vm2
- classPrint - -
-          Debug helper class to pretty-print lua bytecodes.
-  -

- - - - - -
-Uses of Lua in org.luaj.vm2.compiler
-  -

- - - - - - - - - -
Subclasses of Lua in org.luaj.vm2.compiler
- classLuaC - -
-          Compiler for Lua.
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaBoolean.html b/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaBoolean.html deleted file mode 100644 index 38046045f..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaBoolean.html +++ /dev/null @@ -1,204 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.LuaBoolean (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.LuaBoolean

-
- - - - - - - - - -
-Packages that use LuaBoolean
org.luaj.vm2  
-  -

- - - - - -
-Uses of LuaBoolean in org.luaj.vm2
-  -

- - - - - - - - - - - - - -
Fields in org.luaj.vm2 declared as LuaBoolean
-static LuaBooleanLuaValue.FALSE - -
-          LuaBoolean constant corresponding to lua false
-static LuaBooleanLuaValue.TRUE - -
-          LuaBoolean constant corresponding to lua true
-  -

- - - - - - - - - -
Methods in org.luaj.vm2 that return LuaBoolean
-static LuaBooleanLuaValue.valueOf(boolean b) - -
-          Convert java boolean to a LuaValue.
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaClosure.html b/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaClosure.html deleted file mode 100644 index 9c334fb4a..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaClosure.html +++ /dev/null @@ -1,283 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.LuaClosure (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.LuaClosure

-
- - - - - - - - - -
-Packages that use LuaClosure
org.luaj.vm2  
-  -

- - - - - -
-Uses of LuaClosure in org.luaj.vm2
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Methods in org.luaj.vm2 that return LuaClosure
- LuaClosureLuaClosure.checkclosure() - -
-           
- LuaClosureLuaValue.checkclosure() - -
-          Check that the value is a LuaClosure , - or throw LuaError if not
- LuaClosureVarargs.checkclosure(int i) - -
-          Return argument i as a closure, or throw an error if any other type.
- LuaClosureVarargs.optclosure(int i, - LuaClosure defval) - -
-          Return argument i as a closure, defval if nil, or throw a LuaError if any other type.
- LuaClosureLuaClosure.optclosure(LuaClosure defval) - -
-           
- LuaClosureLuaNil.optclosure(LuaClosure defval) - -
-           
- LuaClosureLuaValue.optclosure(LuaClosure defval) - -
-          Check that optional argument is a closure and return as LuaClosure
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - -
Methods in org.luaj.vm2 with parameters of type LuaClosure
- LuaClosureVarargs.optclosure(int i, - LuaClosure defval) - -
-          Return argument i as a closure, defval if nil, or throw a LuaError if any other type.
- LuaClosureLuaClosure.optclosure(LuaClosure defval) - -
-           
- LuaClosureLuaNil.optclosure(LuaClosure defval) - -
-           
- LuaClosureLuaValue.optclosure(LuaClosure defval) - -
-          Check that optional argument is a closure and return as LuaClosure
-static voidPrint.printState(LuaClosure cl, - int pc, - LuaValue[] stack, - int top, - Varargs varargs) - -
-          Print the state of a LuaClosure that is being executed
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaDouble.html b/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaDouble.html deleted file mode 100644 index 5b6c715fe..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaDouble.html +++ /dev/null @@ -1,196 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.LuaDouble (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.LuaDouble

-
- - - - - - - - - -
-Packages that use LuaDouble
org.luaj.vm2  
-  -

- - - - - -
-Uses of LuaDouble in org.luaj.vm2
-  -

- - - - - - - - - - - - - - - - - -
Fields in org.luaj.vm2 declared as LuaDouble
-static LuaDoubleLuaDouble.NAN - -
-          Constant LuaDouble representing NaN (not a number)
-static LuaDoubleLuaDouble.NEGINF - -
-          Constant LuaDouble representing negative infinity
-static LuaDoubleLuaDouble.POSINF - -
-          Constant LuaDouble representing positive infinity
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaError.html b/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaError.html deleted file mode 100644 index 544b73db7..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaError.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.LuaError (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.LuaError

-
-No usage of org.luaj.vm2.LuaError -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaFunction.html b/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaFunction.html deleted file mode 100644 index 81557ff93..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaFunction.html +++ /dev/null @@ -1,651 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.LuaFunction (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.LuaFunction

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Packages that use LuaFunction
org.luaj.vm2  
org.luaj.vm2.compiler  
org.luaj.vm2.lib  
org.luaj.vm2.lib.jme  
org.luaj.vm2.lib.jse  
org.luaj.vm2.luajc  
-  -

- - - - - -
-Uses of LuaFunction in org.luaj.vm2
-  -

- - - - - - - - - -
Subclasses of LuaFunction in org.luaj.vm2
- classLuaClosure - -
-          Extension of LuaFunction which executes lua bytecode.
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Methods in org.luaj.vm2 that return LuaFunction
-static LuaFunctionLuaThread.getCallstackFunction(int level) - -
-          Get the function called as a specific location on the stack.
-static LuaFunctionLoadState.load(java.io.InputStream stream, - java.lang.String name, - LuaValue env) - -
-          Load lua in either binary or text form from an input stream.
- LuaFunctionLoadState.LuaCompiler.load(java.io.InputStream stream, - java.lang.String filename, - LuaValue env) - -
-          Load into a Closure or LuaFunction from a Stream and initializes the environment
- LuaFunctionVarargs.optfunction(int i, - LuaFunction defval) - -
-          Return argument i as a function, defval if nil, or throw a LuaError if an incompatible type.
- LuaFunctionLuaFunction.optfunction(LuaFunction defval) - -
-           
- LuaFunctionLuaNil.optfunction(LuaFunction defval) - -
-           
- LuaFunctionLuaValue.optfunction(LuaFunction defval) - -
-          Check that optional argument is a function and return as LuaFunction
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - -
Methods in org.luaj.vm2 with parameters of type LuaFunction
-static LuaThread.CallStackLuaThread.onCall(LuaFunction function) - -
-          Callback used at the beginning of a call to prepare for possible getfenv/setfenv calls
- LuaFunctionVarargs.optfunction(int i, - LuaFunction defval) - -
-          Return argument i as a function, defval if nil, or throw a LuaError if an incompatible type.
- LuaFunctionLuaFunction.optfunction(LuaFunction defval) - -
-           
- LuaFunctionLuaNil.optfunction(LuaFunction defval) - -
-           
- LuaFunctionLuaValue.optfunction(LuaFunction defval) - -
-          Check that optional argument is a function and return as LuaFunction
-  -

- - - - - -
-Uses of LuaFunction in org.luaj.vm2.compiler
-  -

- - - - - - - - - - - - - -
Methods in org.luaj.vm2.compiler that return LuaFunction
- LuaFunctionLuaC.load(java.io.InputStream stream, - java.lang.String name, - LuaValue env) - -
-          Load into a Closure or LuaFunction, with the supplied initial environment
- LuaFunctionLuaC.load(Prototype p, - java.lang.String filename, - LuaValue env) - -
-           
-  -

- - - - - -
-Uses of LuaFunction in org.luaj.vm2.lib
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Subclasses of LuaFunction in org.luaj.vm2.lib
- classBaseLib - -
-          Subclass of LibFunction which implements the lua basic library functions.
- classCoroutineLib - -
-          Subclass of LibFunction which implements the lua standard coroutine - library.
- classDebugLib - -
-          Subclass of LibFunction which implements the lua standard debug - library.
- classIoLib - -
-          Abstract base class extending LibFunction which implements the - core of the lua standard io library.
- classLibFunction - -
-          Subclass of LuaFunction common to Java functions exposed to lua.
- classMathLib - -
-          Subclass of LibFunction which implements the lua standard math - library.
- classOneArgFunction - -
-          Abstract base class for Java function implementations that take one argument and - return one value.
- classOsLib - -
-          Subclass of LibFunction which implements the standard lua os library.
- classPackageLib - -
-          Subclass of LibFunction which implements the lua standard package and module - library functions.
- classStringLib - -
-          Subclass of LibFunction which implements the lua standard string - library.
- classTableLib - -
-          Subclass of LibFunction which implements the lua standard table - library.
- classThreeArgFunction - -
-          Abstract base class for Java function implementations that take two arguments and - return one value.
- classTwoArgFunction - -
-          Abstract base class for Java function implementations that take two arguments and - return one value.
- classVarArgFunction - -
-          Abstract base class for Java function implementations that takes varaiable arguments and - returns multiple return values.
- classZeroArgFunction - -
-          Abstract base class for Java function implementations that take no arguments and - return one value.
-  -

- - - - - - - - - -
Methods in org.luaj.vm2.lib with parameters of type LuaFunction
-static voidDebugLib.debugOnCall(LuaThread thread, - int calls, - LuaFunction func) - -
-          Called by Closures and recursing java functions on entry
-  -

- - - - - -
-Uses of LuaFunction in org.luaj.vm2.lib.jme
-  -

- - - - - - - - - -
Subclasses of LuaFunction in org.luaj.vm2.lib.jme
- classJmeIoLib - -
-          Subclass of IoLib and therefore LibFunction which implements the lua standard io - library for the JSE platform.
-  -

- - - - - -
-Uses of LuaFunction in org.luaj.vm2.lib.jse
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Subclasses of LuaFunction in org.luaj.vm2.lib.jse
- classJseBaseLib - -
-          Subclass of BaseLib and LibFunction which implements the lua basic library functions - and provides a directory based ResourceFinder as the BaseLib.FINDER.
- classJseIoLib - -
-          Subclass of IoLib and therefore LibFunction which implements the lua standard io - library for the JSE platform.
- classJseMathLib - -
-          Subclass of LibFunction which implements the lua standard math - library.
-static classJseMathLib.JseMathLib1 - -
-           
-static classJseMathLib.JseMathLib2 - -
-           
- classJseOsLib - -
-          Subclass of LibFunction which implements the standard lua os library.
- classLuajavaLib - -
-          Subclass of LibFunction which implements the features of the luajava package.
-  -

- - - - - -
-Uses of LuaFunction in org.luaj.vm2.luajc
-  -

- - - - - - - - - -
Methods in org.luaj.vm2.luajc that return LuaFunction
- LuaFunctionLuaJC.load(java.io.InputStream stream, - java.lang.String name, - LuaValue env) - -
-           
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaInteger.html b/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaInteger.html deleted file mode 100644 index 4db91e4ef..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaInteger.html +++ /dev/null @@ -1,334 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.LuaInteger (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.LuaInteger

-
- - - - - - - - - -
-Packages that use LuaInteger
org.luaj.vm2  
-  -

- - - - - -
-Uses of LuaInteger in org.luaj.vm2
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Methods in org.luaj.vm2 that return LuaInteger
- LuaIntegerLuaDouble.checkinteger() - -
-           
- LuaIntegerLuaInteger.checkinteger() - -
-           
- LuaIntegerLuaString.checkinteger() - -
-           
- LuaIntegerLuaValue.checkinteger() - -
-          Check that the value is numeric, and convert and cast value to int, or throw LuaError if not numeric
- LuaIntegerVarargs.checkinteger(int i) - -
-          Return argument i as a java int value, or throw an error if not a number or is not representable by a java int.
- LuaIntegerVarargs.optinteger(int i, - LuaInteger defval) - -
-          Return argument i as a java int value, defval if nil, or throw a LuaError if not a number or is not representable by a java int.
- LuaIntegerLuaDouble.optinteger(LuaInteger defval) - -
-           
- LuaIntegerLuaInteger.optinteger(LuaInteger defval) - -
-           
- LuaIntegerLuaNil.optinteger(LuaInteger defval) - -
-           
- LuaIntegerLuaString.optinteger(LuaInteger defval) - -
-           
- LuaIntegerLuaValue.optinteger(LuaInteger defval) - -
-          Check that optional argument is a number or string convertible to number and return as LuaInteger
-static LuaIntegerLuaInteger.valueOf(int i) - -
-           
-static LuaIntegerLuaValue.valueOf(int i) - -
-          Convert java int to a LuaValue.
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Methods in org.luaj.vm2 with parameters of type LuaInteger
- LuaIntegerVarargs.optinteger(int i, - LuaInteger defval) - -
-          Return argument i as a java int value, defval if nil, or throw a LuaError if not a number or is not representable by a java int.
- LuaIntegerLuaDouble.optinteger(LuaInteger defval) - -
-           
- LuaIntegerLuaInteger.optinteger(LuaInteger defval) - -
-           
- LuaIntegerLuaNil.optinteger(LuaInteger defval) - -
-           
- LuaIntegerLuaString.optinteger(LuaInteger defval) - -
-           
- LuaIntegerLuaValue.optinteger(LuaInteger defval) - -
-          Check that optional argument is a number or string convertible to number and return as LuaInteger
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaNil.html b/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaNil.html deleted file mode 100644 index 07766381e..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaNil.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.LuaNil (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.LuaNil

-
-No usage of org.luaj.vm2.LuaNil -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaNumber.html b/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaNumber.html deleted file mode 100644 index 0d5c2ae7f..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaNumber.html +++ /dev/null @@ -1,457 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.LuaNumber (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.LuaNumber

-
- - - - - - - - - -
-Packages that use LuaNumber
org.luaj.vm2  
-  -

- - - - - -
-Uses of LuaNumber in org.luaj.vm2
-  -

- - - - - - - - - - - - - -
Subclasses of LuaNumber in org.luaj.vm2
- classLuaDouble - -
-          Extension of LuaNumber which can hold a Java double as its value.
- classLuaInteger - -
-          Extension of LuaNumber which can hold a Java int as its value.
-  -

- - - - - - - - - - - - - - - - - -
Fields in org.luaj.vm2 declared as LuaNumber
-static LuaNumberLuaValue.MINUSONE - -
-          LuaValue number constant equal to -1
-static LuaNumberLuaValue.ONE - -
-          LuaValue number constant equal to 1
-static LuaNumberLuaValue.ZERO - -
-          LuaValue number constant equal to 0
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Methods in org.luaj.vm2 that return LuaNumber
- LuaNumberLuaDouble.checknumber() - -
-           
- LuaNumberLuaNumber.checknumber() - -
-           
- LuaNumberLuaString.checknumber() - -
-           
- LuaNumberLuaValue.checknumber() - -
-          Check that the value is numeric, and return as a LuaNumber if so, or throw LuaError
- LuaNumberVarargs.checknumber(int i) - -
-          Return argument i as a LuaNumber, or throw an error if not a number or string that can be converted to a number.
- LuaNumberLuaNumber.checknumber(java.lang.String errmsg) - -
-           
- LuaNumberLuaString.checknumber(java.lang.String msg) - -
-           
- LuaNumberLuaValue.checknumber(java.lang.String msg) - -
-          Check that the value is numeric, and return as a LuaNumber if so, or throw LuaError
- LuaNumberVarargs.optnumber(int i, - LuaNumber defval) - -
-          Return argument i as a LuaNumber, defval if nil, or throw a LuaError if not a number or string that can be converted to a number.
- LuaNumberLuaDouble.optnumber(LuaNumber defval) - -
-           
- LuaNumberLuaNil.optnumber(LuaNumber defval) - -
-           
- LuaNumberLuaNumber.optnumber(LuaNumber defval) - -
-           
- LuaNumberLuaString.optnumber(LuaNumber defval) - -
-           
- LuaNumberLuaValue.optnumber(LuaNumber defval) - -
-          Check that optional argument is a number or string convertible to number and return as LuaNumber
-static LuaNumberLuaDouble.valueOf(double d) - -
-           
-static LuaNumberLuaValue.valueOf(double d) - -
-          Convert java double to a LuaValue.
-static LuaNumberLuaInteger.valueOf(long l) - -
-          Return a LuaNumber that represents the value provided
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Methods in org.luaj.vm2 with parameters of type LuaNumber
- BufferBuffer.concatTo(LuaNumber lhs) - -
-          Concatenate this buffer onto a LuaNumber
- LuaValueLuaNumber.concatTo(LuaNumber lhs) - -
-           
- LuaValueLuaString.concatTo(LuaNumber lhs) - -
-           
- LuaValueLuaValue.concatTo(LuaNumber lhs) - -
-          Reverse-concatenation: concatenate this value onto another value - known to be a LuaNumber - and return the result using rules of lua string concatenation including - metatag processing.
- LuaNumberVarargs.optnumber(int i, - LuaNumber defval) - -
-          Return argument i as a LuaNumber, defval if nil, or throw a LuaError if not a number or string that can be converted to a number.
- LuaNumberLuaDouble.optnumber(LuaNumber defval) - -
-           
- LuaNumberLuaNil.optnumber(LuaNumber defval) - -
-           
- LuaNumberLuaNumber.optnumber(LuaNumber defval) - -
-           
- LuaNumberLuaString.optnumber(LuaNumber defval) - -
-           
- LuaNumberLuaValue.optnumber(LuaNumber defval) - -
-          Check that optional argument is a number or string convertible to number and return as LuaNumber
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaString.html b/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaString.html deleted file mode 100644 index 514bde44e..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaString.html +++ /dev/null @@ -1,855 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.LuaString (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.LuaString

-
- - - - - - - - - - - - - - - - - -
-Packages that use LuaString
org.luaj.vm2  
org.luaj.vm2.compiler  
org.luaj.vm2.lib  
-  -

- - - - - -
-Uses of LuaString in org.luaj.vm2
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Fields in org.luaj.vm2 declared as LuaString
-static LuaStringLuaValue.ADD - -
-          LuaString constant with value "__add" for use as metatag
-static LuaStringLuaValue.CALL - -
-          LuaString constant with value "__call" for use as metatag
-static LuaStringLuaValue.CONCAT - -
-          LuaString constant with value "__concat" for use as metatag
-static LuaStringLuaValue.DIV - -
-          LuaString constant with value "__div" for use as metatag
-static LuaStringLuaValue.EMPTYSTRING - -
-          LuaString constant with value ""
-static LuaStringLuaValue.EQ - -
-          LuaString constant with value "__eq" for use as metatag
-static LuaStringLuaValue.INDEX - -
-          LuaString constant with value "__index" for use as metatag
-static LuaStringLuaValue.LE - -
-          LuaString constant with value "__le" for use as metatag
-static LuaStringLuaValue.LEN - -
-          LuaString constant with value "__len" for use as metatag
-static LuaStringLuaValue.LT - -
-          LuaString constant with value "__lt" for use as metatag
-static LuaStringLuaValue.METATABLE - -
-          LuaString constant with value "__metatable" for use as metatag
-static LuaStringLuaValue.MOD - -
-          LuaString constant with value "__mod" for use as metatag
-static LuaStringLuaValue.MODE - -
-          LuaString constant with value "__mode" for use as metatag
-static LuaStringLuaValue.MUL - -
-          LuaString constant with value "__mul" for use as metatag
-static LuaStringLuaValue.NEWINDEX - -
-          LuaString constant with value "__newindex" for use as metatag
-static LuaStringLuaValue.POW - -
-          LuaString constant with value "__pow" for use as metatag
- LuaStringPrototype.source - -
-           
-static LuaStringLuaValue.SUB - -
-          LuaString constant with value "__sub" for use as metatag
-static LuaStringLuaValue.TOSTRING - -
-          LuaString constant with value "__tostring" for use as metatag
-static LuaStringLuaValue.UNM - -
-          LuaString constant with value "__unm" for use as metatag
- LuaString[]Prototype.upvalues - -
-           
- LuaStringLocVars.varname - -
-          The local variable name
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Methods in org.luaj.vm2 that return LuaString
- LuaStringLuaDouble.checkstring() - -
-           
- LuaStringLuaInteger.checkstring() - -
-           
- LuaStringLuaString.checkstring() - -
-           
- LuaStringLuaValue.checkstring() - -
-          Check that this is a lua string, or throw LuaError if it is not.
- LuaStringVarargs.checkstring(int i) - -
-          Return argument i as a LuaString if a string or number, or throw an error if any other type
- LuaStringPrototype.getlocalname(int number, - int pc) - -
-          Get the name of a local variable.
- LuaStringVarargs.optstring(int i, - LuaString defval) - -
-          Return argument i as a LuaString if a string or number, defval if nil, or throw a LuaError if any other type
- LuaStringLuaDouble.optstring(LuaString defval) - -
-           
- LuaStringLuaInteger.optstring(LuaString defval) - -
-           
- LuaStringLuaNil.optstring(LuaString defval) - -
-           
- LuaStringLuaString.optstring(LuaString defval) - -
-           
- LuaStringLuaValue.optstring(LuaString defval) - -
-          Check that optional argument is a string or number and return as LuaString
- LuaStringLuaDouble.strvalue() - -
-           
- LuaStringLuaInteger.strvalue() - -
-           
- LuaStringLuaString.strvalue() - -
-           
- LuaStringLuaValue.strvalue() - -
-          Convert this value to a string if it is a LuaString or LuaNumber, - or throw a LuaError if it is not
- LuaStringLuaString.substring(int beginIndex, - int endIndex) - -
-           
- LuaStringBuffer.tostring() - -
-          Convert the buffer to a LuaString
-static LuaStringLuaString.valueOf(byte[] bytes) - -
-          Construct a LuaString around a byte array without copying the contents.
-static LuaStringLuaValue.valueOf(byte[] bytes) - -
-          Convert bytes in an array to a LuaValue.
-static LuaStringLuaString.valueOf(byte[] bytes, - int off, - int len) - -
-          Construct a LuaString around a byte array without copying the contents.
-static LuaStringLuaValue.valueOf(byte[] bytes, - int off, - int len) - -
-          Convert bytes in an array to a LuaValue.
-static LuaStringLuaString.valueOf(char[] bytes) - -
-          Construct a LuaString using the supplied characters as byte values.
-static LuaStringLuaString.valueOf(java.lang.String string) - -
-          Get a LuaString instance whose bytes match - the supplied Java String using the UTF8 encoding.
-static LuaStringLuaValue.valueOf(java.lang.String s) - -
-          Convert java string to a LuaValue.
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Methods in org.luaj.vm2 with parameters of type LuaString
- BufferBuffer.append(LuaString str) - -
-          Append a LuaString to the buffer.
- LuaValueLuaTable.concat(LuaString sep, - int i, - int j) - -
-          Concatenate the contents of a table efficiently, using Buffer
- BufferBuffer.concatTo(LuaString lhs) - -
-          Concatenate this buffer onto a LuaString
- LuaValueLuaNumber.concatTo(LuaString lhs) - -
-           
- LuaValueLuaString.concatTo(LuaString lhs) - -
-           
- LuaValueLuaValue.concatTo(LuaString lhs) - -
-          Reverse-concatenation: concatenate this value onto another value - known to be a LuaString - and return the result using rules of lua string concatenation including - metatag processing.
-static booleanLuaString.equals(LuaString a, - int i, - LuaString b, - int j, - int n) - -
-           
- intLuaString.indexOf(LuaString s, - int start) - -
-          Find the index of a string starting at a point in this string
- intLuaString.indexOfAny(LuaString accept) - -
-          Java version of strpbrk - find index of any byte that in an accept string.
- intLuaString.lastIndexOf(LuaString s) - -
-          Find the last index of a string in this string
- PrototypeLoadState.loadFunction(LuaString p) - -
-          Load a function prototype from the input stream
- LuaStringVarargs.optstring(int i, - LuaString defval) - -
-          Return argument i as a LuaString if a string or number, defval if nil, or throw a LuaError if any other type
- LuaStringLuaDouble.optstring(LuaString defval) - -
-           
- LuaStringLuaInteger.optstring(LuaString defval) - -
-           
- LuaStringLuaNil.optstring(LuaString defval) - -
-           
- LuaStringLuaString.optstring(LuaString defval) - -
-           
- LuaStringLuaValue.optstring(LuaString defval) - -
-          Check that optional argument is a string or number and return as LuaString
- BufferBuffer.prepend(LuaString s) - -
-          Concatenate bytes from a LuaString onto the front of this buffer
- booleanLuaString.raweq(LuaString s) - -
-           
- booleanLuaValue.raweq(LuaString val) - -
-          Equals: Perform direct equality comparison with a LuaString value - without metatag processing.
- intLuaDouble.strcmp(LuaString rhs) - -
-           
- intLuaInteger.strcmp(LuaString rhs) - -
-           
- intLuaString.strcmp(LuaString rhs) - -
-           
- intLuaValue.strcmp(LuaString rhs) - -
-          Perform string comparison with another value - known to be a LuaString - using string comparison based on byte values.
-  -

- - - - - - - - -
Constructors in org.luaj.vm2 with parameters of type LuaString
LocVars(LuaString varname, - int startpc, - int endpc) - -
-          Construct a LocVars instance.
-  -

- - - - - -
-Uses of LuaString in org.luaj.vm2.compiler
-  -

- - - - - - - - - -
Methods in org.luaj.vm2.compiler that return LuaString
- LuaStringLuaC.newTString(byte[] bytes, - int offset, - int len) - -
-           
-  -

- - - - - -
-Uses of LuaString in org.luaj.vm2.lib
-  -

- - - - - - - - - -
Methods in org.luaj.vm2.lib with parameters of type LuaString
-abstract  voidIoLib.File.write(LuaString string) - -
-           
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaTable.html b/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaTable.html deleted file mode 100644 index bd1e3d87d..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaTable.html +++ /dev/null @@ -1,535 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.LuaTable (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.LuaTable

-
- - - - - - - - - - - - - - - - - - - - - -
-Packages that use LuaTable
org.luaj.vm2  
org.luaj.vm2.lib  
org.luaj.vm2.lib.jme  
org.luaj.vm2.lib.jse  
-  -

- - - - - -
-Uses of LuaTable in org.luaj.vm2
-  -

- - - - - - - - - -
Subclasses of LuaTable in org.luaj.vm2
- classWeakTable - -
-          Subclass of LuaTable that provides weak key and weak value semantics.
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Methods in org.luaj.vm2 that return LuaTable
-protected  LuaTableLuaTable.changemode(boolean weakkeys, - boolean weakvalues) - -
-          Change the mode of a table
-protected  LuaTableWeakTable.changemode(boolean weakkeys, - boolean weakvalues) - -
-           
- LuaTableLuaTable.checktable() - -
-           
- LuaTableLuaValue.checktable() - -
-          Check that this is a LuaTable, or throw LuaError if it is not
- LuaTableVarargs.checktable(int i) - -
-          Return argument i as a LuaTable if a lua table, or throw an error if any other type.
-static LuaTableLuaValue.listOf(LuaValue[] unnamedValues) - -
-          Construct a LuaTable initialized with supplied array values.
-static LuaTableLuaValue.listOf(LuaValue[] unnamedValues, - Varargs lastarg) - -
-          Construct a LuaTable initialized with supplied array values.
- LuaTableVarargs.opttable(int i, - LuaTable defval) - -
-          Return argument i as a LuaTable if a lua table, defval if nil, or throw a LuaError if any other type.
- LuaTableLuaNil.opttable(LuaTable defval) - -
-           
- LuaTableLuaTable.opttable(LuaTable defval) - -
-           
- LuaTableLuaValue.opttable(LuaTable defval) - -
-          Check that optional argument is a table and return as LuaTable
-static LuaTableLuaValue.tableOf() - -
-          Construct an empty LuaTable.
-static LuaTableLuaValue.tableOf(int narray, - int nhash) - -
-          Construct an empty LuaTable preallocated to hold array and hashed elements
-static LuaTableLuaValue.tableOf(LuaValue[] namedValues) - -
-          Construct a LuaTable initialized with supplied named values.
-static LuaTableLuaValue.tableOf(LuaValue[] namedValues, - LuaValue[] unnamedValues) - -
-          Construct a LuaTable initialized with supplied named values and sequential elements.
-static LuaTableLuaValue.tableOf(LuaValue[] namedValues, - LuaValue[] unnamedValues, - Varargs lastarg) - -
-          Construct a LuaTable initialized with supplied named values and sequential elements in an array part and as varargs.
-static LuaTableLuaValue.tableOf(Varargs varargs, - int firstarg) - -
-          Construct a LuaTable initialized with supplied array values.
-  -

- - - - - - - - - - - - - - - - - - - - - -
Methods in org.luaj.vm2 with parameters of type LuaTable
- LuaTableVarargs.opttable(int i, - LuaTable defval) - -
-          Return argument i as a LuaTable if a lua table, defval if nil, or throw a LuaError if any other type.
- LuaTableLuaNil.opttable(LuaTable defval) - -
-           
- LuaTableLuaTable.opttable(LuaTable defval) - -
-           
- LuaTableLuaValue.opttable(LuaTable defval) - -
-          Check that optional argument is a table and return as LuaTable
-  -

- - - - - - - - -
Constructors in org.luaj.vm2 with parameters of type LuaTable
WeakTable(boolean weakkeys, - boolean weakvalues, - LuaTable source) - -
-          Construct a table with weak keys, weak values, or both, and a source of initial data
-  -

- - - - - -
-Uses of LuaTable in org.luaj.vm2.lib
-  -

- - - - - - - - - - - - - - - - - -
Fields in org.luaj.vm2.lib declared as LuaTable
-static LuaTableStringLib.instance - -
-           
- LuaTablePackageLib.LOADED - -
-           
- LuaTablePackageLib.PACKAGE - -
-           
-  -

- - - - - - - - - - - - - -
Methods in org.luaj.vm2.lib with parameters of type LuaTable
- voidPackageLib.setIsLoaded(java.lang.String name, - LuaTable value) - -
-          Allow packages to mark themselves as loaded
-protected  longOsLib.time(LuaTable table) - -
-          Returns the current time when called without arguments, - or a time representing the date and time specified by the given table.
-  -

- - - - - -
-Uses of LuaTable in org.luaj.vm2.lib.jme
-  -

- - - - - - - - - - - - - -
Methods in org.luaj.vm2.lib.jme that return LuaTable
-static LuaTableJmePlatform.debugGlobals() - -
-          Create standard globals including the debug library.
-static LuaTableJmePlatform.standardGlobals() - -
-          Create a standard set of globals for JME including all the libraries.
-  -

- - - - - -
-Uses of LuaTable in org.luaj.vm2.lib.jse
-  -

- - - - - - - - - - - - - -
Methods in org.luaj.vm2.lib.jse that return LuaTable
-static LuaTableJsePlatform.debugGlobals() - -
-          Create standard globals including the debug library.
-static LuaTableJsePlatform.standardGlobals() - -
-          Create a standard set of globals for JSE including all the libraries.
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaThread.CallStack.html b/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaThread.CallStack.html deleted file mode 100644 index 880e121d9..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaThread.CallStack.html +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.LuaThread.CallStack (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.LuaThread.CallStack

-
- - - - - - - - - -
-Packages that use LuaThread.CallStack
org.luaj.vm2  
-  -

- - - - - -
-Uses of LuaThread.CallStack in org.luaj.vm2
-  -

- - - - - - - - - -
Methods in org.luaj.vm2 that return LuaThread.CallStack
-static LuaThread.CallStackLuaThread.onCall(LuaFunction function) - -
-          Callback used at the beginning of a call to prepare for possible getfenv/setfenv calls
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaThread.html b/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaThread.html deleted file mode 100644 index ded048403..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaThread.html +++ /dev/null @@ -1,335 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.LuaThread (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.LuaThread

-
- - - - - - - - - - - - - -
-Packages that use LuaThread
org.luaj.vm2  
org.luaj.vm2.lib  
-  -

- - - - - -
-Uses of LuaThread in org.luaj.vm2
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Methods in org.luaj.vm2 that return LuaThread
- LuaThreadLuaThread.checkthread() - -
-           
- LuaThreadLuaValue.checkthread() - -
-          Check that this is a LuaThread, or throw LuaError if it is not
- LuaThreadVarargs.checkthread(int i) - -
-          Return argument i as a LuaThread if a lua thread, or throw an error if any other type.
-static LuaThreadLuaThread.getRunning() - -
-          Get the currently running thread.
- LuaThreadVarargs.optthread(int i, - LuaThread defval) - -
-          Return argument i as a LuaThread if a lua thread, defval if nil, or throw a LuaError if any other type.
- LuaThreadLuaNil.optthread(LuaThread defval) - -
-           
- LuaThreadLuaThread.optthread(LuaThread defval) - -
-           
- LuaThreadLuaValue.optthread(LuaThread defval) - -
-          Check that optional argument is a thread and return as LuaThread
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - -
Methods in org.luaj.vm2 with parameters of type LuaThread
-static booleanLuaThread.isMainThread(LuaThread r) - -
-          Test if this is the main thread
- LuaThreadVarargs.optthread(int i, - LuaThread defval) - -
-          Return argument i as a LuaThread if a lua thread, defval if nil, or throw a LuaError if any other type.
- LuaThreadLuaNil.optthread(LuaThread defval) - -
-           
- LuaThreadLuaThread.optthread(LuaThread defval) - -
-           
- LuaThreadLuaValue.optthread(LuaThread defval) - -
-          Check that optional argument is a thread and return as LuaThread
-  -

- - - - - -
-Uses of LuaThread in org.luaj.vm2.lib
-  -

- - - - - - - - - - - - - - - - - -
Methods in org.luaj.vm2.lib with parameters of type LuaThread
-static voidDebugLib.debugOnCall(LuaThread thread, - int calls, - LuaFunction func) - -
-          Called by Closures and recursing java functions on entry
-static voidDebugLib.debugOnReturn(LuaThread thread, - int calls) - -
-          Called by Closures and recursing java functions on return
-static java.lang.StringDebugLib.traceback(LuaThread thread, - int level) - -
-          Get a traceback for a particular thread.
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaUserdata.html b/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaUserdata.html deleted file mode 100644 index 58514202a..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaUserdata.html +++ /dev/null @@ -1,214 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.LuaUserdata (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.LuaUserdata

-
- - - - - - - - - -
-Packages that use LuaUserdata
org.luaj.vm2  
-  -

- - - - - -
-Uses of LuaUserdata in org.luaj.vm2
-  -

- - - - - - - - - - - - - -
Methods in org.luaj.vm2 that return LuaUserdata
-static LuaUserdataLuaValue.userdataOf(java.lang.Object o) - -
-          Construct a LuaUserdata for an object.
-static LuaUserdataLuaValue.userdataOf(java.lang.Object o, - LuaValue metatable) - -
-          Construct a LuaUserdata for an object with a user supplied metatable.
-  -

- - - - - - - - - - - - - -
Methods in org.luaj.vm2 with parameters of type LuaUserdata
- booleanLuaUserdata.raweq(LuaUserdata val) - -
-           
- booleanLuaValue.raweq(LuaUserdata val) - -
-          Equals: Perform direct equality comparison with a LuaUserdata value - without metatag processing.
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaValue.html b/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaValue.html deleted file mode 100644 index a35b0775b..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/LuaValue.html +++ /dev/null @@ -1,5645 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.LuaValue (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.LuaValue

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Packages that use LuaValue
org.luaj.vm2  
org.luaj.vm2.compiler  
org.luaj.vm2.lib  
org.luaj.vm2.lib.jme  
org.luaj.vm2.lib.jse  
org.luaj.vm2.luajc  
-  -

- - - - - -
-Uses of LuaValue in org.luaj.vm2
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Subclasses of LuaValue in org.luaj.vm2
- classLuaBoolean - -
-          Extension of LuaValue which can hold a Java boolean as its value.
- classLuaClosure - -
-          Extension of LuaFunction which executes lua bytecode.
- classLuaDouble - -
-          Extension of LuaNumber which can hold a Java double as its value.
- classLuaFunction - -
-          Base class for functions implemented in Java.
- classLuaInteger - -
-          Extension of LuaNumber which can hold a Java int as its value.
- classLuaNil - -
-          Class to encapsulate behavior of the singleton instance nil
- classLuaNumber - -
-          Base class for representing numbers as lua values directly.
- classLuaString - -
-          Subclass of LuaValue for representing lua strings.
- classLuaTable - -
-          Subclass of LuaValue for representing lua tables.
- classLuaThread - -
-          Subclass of LuaValue that implements - a lua coroutine thread using Java Threads.
- classLuaUserdata - -
-           
- classWeakTable - -
-          Subclass of LuaTable that provides weak key and weak value semantics.
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Fields in org.luaj.vm2 declared as LuaValue
-protected  LuaValue[]LuaTable.array - -
-          the array values
-protected  LuaValueLuaFunction.env - -
-           
- LuaValueLuaThread.err - -
-          Field to hold state of error condition during debug hook function calls.
-protected  LuaValue[]LuaTable.hashKeys - -
-          the hash keys
-protected  LuaValue[]LuaTable.hashValues - -
-          the hash values
- LuaValue[]Prototype.k - -
-           
-protected  LuaValueLuaTable.m_metatable - -
-          metatable for this table, or null
- LuaValueLuaUserdata.m_metatable - -
-           
-static LuaValueLuaValue.NIL - -
-          LuaValue constant corresponding to lua nil
-static LuaValue[]LuaValue.NILS - -
-          Array of NIL values to optimize filling stacks using System.arraycopy().
-static LuaValueLuaValue.NONE - -
-          LuaValue constant corresponding to a Varargs list of no values
-static LuaValue[]LuaValue.NOVALS - -
-          LuaValue array constant with no values
-static LuaValueLuaBoolean.s_metatable - -
-          Shared static metatable for boolean values represented in lua.
-static LuaValueLuaFunction.s_metatable - -
-          Shared static metatable for all functions and closures.
-static LuaValueLuaNil.s_metatable - -
-           
-static LuaValueLuaNumber.s_metatable - -
-          Shared static metatable for all number values represented in lua.
-static LuaValueLuaString.s_metatable - -
-          The singleton instance representing lua true
-static LuaValueLuaThread.s_metatable - -
-           
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Methods in org.luaj.vm2 that return LuaValue
- LuaValueLuaDouble.add(double lhs) - -
-           
- LuaValueLuaInteger.add(double lhs) - -
-           
- LuaValueLuaString.add(double rhs) - -
-           
- LuaValueLuaValue.add(double rhs) - -
-          Add: Perform numeric add operation with another value - of double type with metatag processing
- LuaValueLuaInteger.add(int lhs) - -
-           
- LuaValueLuaString.add(int rhs) - -
-           
- LuaValueLuaValue.add(int rhs) - -
-          Add: Perform numeric add operation with another value - of int type with metatag processing
- LuaValueLuaDouble.add(LuaValue rhs) - -
-           
- LuaValueLuaInteger.add(LuaValue rhs) - -
-           
- LuaValueLuaString.add(LuaValue rhs) - -
-           
- LuaValueLuaValue.add(LuaValue rhs) - -
-          Add: Perform numeric add operation with another value - including metatag processing.
- LuaValueLuaValue.and(LuaValue rhs) - -
-          Perform boolean and with another operand, based on lua rules for boolean evaluation.
- LuaValueLuaValue.arg(int index) - -
-           
- LuaValueTailcallVarargs.arg(int i) - -
-           
-abstract  LuaValueVarargs.arg(int i) - -
-          Get the n-th argument value (1-based).
- LuaValueLuaValue.arg1() - -
-           
- LuaValueTailcallVarargs.arg1() - -
-           
-abstract  LuaValueVarargs.arg1() - -
-          Get the first argument in the list.
-static LuaValueLuaValue.argerror(int iarg, - java.lang.String msg) - -
-          Throw a LuaError indicating an invalid argument was supplied to a function
-protected  LuaValueLuaValue.argerror(java.lang.String expected) - -
-          Throw a LuaError indicating an invalid argument was supplied to a function
-protected  LuaValueLuaValue.aritherror() - -
-          Throw a LuaError based on an arithmetic error such as add, or pow, - typically due to an invalid operand type
-protected  LuaValueLuaValue.aritherror(java.lang.String fun) - -
-          Throw a LuaError based on an arithmetic error such as add, or pow, - typically due to an invalid operand type
-protected  LuaValueLuaValue.arithmt(LuaValue tag, - LuaValue op2) - -
-          Perform metatag processing for arithmetic operations.
-protected  LuaValueLuaValue.arithmtwith(LuaValue tag, - double op1) - -
-          Perform metatag processing for arithmetic operations when the left-hand-side is a number.
- LuaValueLuaClosure.call() - -
-           
- LuaValueLuaValue.call() - -
-          Call this with 0 arguments, including metatag processing, - and return only the first return value.
- LuaValueLuaClosure.call(LuaValue arg) - -
-           
- LuaValueLuaValue.call(LuaValue arg) - -
-          Call this with 1 argument, including metatag processing, - and return only the first return value.
- LuaValueLuaClosure.call(LuaValue arg1, - LuaValue arg2) - -
-           
- LuaValueLuaValue.call(LuaValue arg1, - LuaValue arg2) - -
-          Call this with 2 arguments, including metatag processing, - and return only the first return value.
- LuaValueLuaClosure.call(LuaValue arg1, - LuaValue arg2, - LuaValue arg3) - -
-           
- LuaValueLuaValue.call(LuaValue arg1, - LuaValue arg2, - LuaValue arg3) - -
-          Call this with 3 arguments, including metatag processing, - and return only the first return value.
-protected  LuaValueLuaValue.callmt() - -
-          Get the metatag value for the CALL metatag, if it exists.
- LuaValueLuaFunction.checkfunction() - -
-           
- LuaValueLuaValue.checkfunction() - -
-          Check that the value is a function , or throw LuaError if not
- LuaValueVarargs.checkfunction(int i) - -
-          Return argument i as a function, or throw an error if an incompatible type.
-protected  LuaValueLuaValue.checkmetatag(LuaValue tag, - java.lang.String reason) - -
-          Get particular metatag, or throw LuaError if it doesn't exist
- LuaValueLuaNil.checknotnil() - -
-           
- LuaValueLuaValue.checknotnil() - -
-          Check that this is not the value NIL, or throw LuaError if it is
- LuaValueVarargs.checknotnil(int i) - -
-          Return argument i as a LuaValue if it is not nil, or throw an error if it is nil.
- LuaValueLuaDouble.checkvalidkey() - -
-           
- LuaValueLuaNil.checkvalidkey() - -
-           
- LuaValueLuaValue.checkvalidkey() - -
-          Check that this is a valid key in a table index operation, or throw LuaError if not
- LuaValueVarargs.checkvalue(int i) - -
-          Return argument i as a LuaValue if it exists, or throw an error.
-protected  LuaValueLuaValue.compareerror(LuaValue rhs) - -
-          Throw a LuaError based on a comparison error such as greater-than or less-than, - typically due to an invalid operand type
-protected  LuaValueLuaValue.compareerror(java.lang.String rhs) - -
-          Throw a LuaError based on a comparison error such as greater-than or less-than, - typically due to an invalid operand type
- LuaValueLuaValue.comparemt(LuaValue tag, - LuaValue op1) - -
-          Perform metatag processing for comparison operations.
- LuaValueLuaTable.concat(LuaString sep, - int i, - int j) - -
-          Concatenate the contents of a table efficiently, using Buffer
- LuaValueLuaNumber.concat(LuaValue rhs) - -
-           
- LuaValueLuaString.concat(LuaValue rhs) - -
-           
- LuaValueLuaValue.concat(LuaValue rhs) - -
-          Concatenate another value onto this value and return the result - using rules of lua string concatenation including metatag processing.
- LuaValueLuaValue.concatmt(LuaValue rhs) - -
-          Perform metatag processing for concatenation operations.
- LuaValueLuaNumber.concatTo(LuaNumber lhs) - -
-           
- LuaValueLuaString.concatTo(LuaNumber lhs) - -
-           
- LuaValueLuaValue.concatTo(LuaNumber lhs) - -
-          Reverse-concatenation: concatenate this value onto another value - known to be a LuaNumber - and return the result using rules of lua string concatenation including - metatag processing.
- LuaValueLuaNumber.concatTo(LuaString lhs) - -
-           
- LuaValueLuaString.concatTo(LuaString lhs) - -
-           
- LuaValueLuaValue.concatTo(LuaString lhs) - -
-          Reverse-concatenation: concatenate this value onto another value - known to be a LuaString - and return the result using rules of lua string concatenation including - metatag processing.
- LuaValueLuaValue.concatTo(LuaValue lhs) - -
-          Reverse-concatenation: concatenate this value onto another value - whose type is unknwon - and return the result using rules of lua string concatenation including - metatag processing.
-static LuaValueLuaDouble.ddiv(double lhs, - double rhs) - -
-          Divide two double numbers according to lua math, and return a LuaValue result.
- LuaValueLuaDouble.div(double rhs) - -
-           
- LuaValueLuaInteger.div(double rhs) - -
-           
- LuaValueLuaString.div(double rhs) - -
-           
- LuaValueLuaValue.div(double rhs) - -
-          Divide: Perform numeric divide operation by another value - of double type without metatag processing
- LuaValueLuaDouble.div(int rhs) - -
-           
- LuaValueLuaInteger.div(int rhs) - -
-           
- LuaValueLuaString.div(int rhs) - -
-           
- LuaValueLuaValue.div(int rhs) - -
-          Divide: Perform numeric divide operation by another value - of int type without metatag processing
- LuaValueLuaDouble.div(LuaValue rhs) - -
-           
- LuaValueLuaInteger.div(LuaValue rhs) - -
-           
- LuaValueLuaString.div(LuaValue rhs) - -
-           
- LuaValueLuaValue.div(LuaValue rhs) - -
-          Divide: Perform numeric divide operation by another value - of unknown type, - including metatag processing.
- LuaValueLuaDouble.divInto(double lhs) - -
-           
- LuaValueLuaInteger.divInto(double lhs) - -
-           
- LuaValueLuaString.divInto(double lhs) - -
-           
- LuaValueLuaValue.divInto(double lhs) - -
-          Reverse-divide: Perform numeric divide operation into another value - with metatag processing
-static LuaValueLuaDouble.dmod(double lhs, - double rhs) - -
-          Take modulo double numbers according to lua math, and return a LuaValue result.
- LuaValueLuaDouble.eq(LuaValue val) - -
-           
- LuaValueLuaInteger.eq(LuaValue val) - -
-           
- LuaValueLuaString.eq(LuaValue val) - -
-           
- LuaValueLuaTable.eq(LuaValue val) - -
-           
- LuaValueLuaUserdata.eq(LuaValue val) - -
-           
- LuaValueLuaValue.eq(LuaValue val) - -
-          Equals: Perform equality comparison with another value - including metatag processing using EQ.
-static LuaValueLuaValue.error(java.lang.String message) - -
-          Throw a LuaError with a particular message
- LuaValueLuaTable.foreach(LuaValue func) - -
-          Call the supplied function once for each key-value pair
- LuaValueLuaTable.foreachi(LuaValue func) - -
-          Call the supplied function once for each key-value pair - in the contiguous array part
- LuaValueLuaTable.get(int key) - -
-           
- LuaValueLuaValue.get(int key) - -
-          Get a value in a table including metatag processing using INDEX.
- LuaValueLuaString.get(LuaValue key) - -
-           
- LuaValueLuaTable.get(LuaValue key) - -
-           
- LuaValueLuaUserdata.get(LuaValue key) - -
-           
- LuaValueLuaValue.get(LuaValue key) - -
-          Get a value in a table including metatag processing using INDEX.
- LuaValueLuaValue.get(java.lang.String key) - -
-          Get a value in a table including metatag processing using INDEX.
- LuaValueLuaFunction.getfenv() - -
-           
- LuaValueLuaThread.getfenv() - -
-           
- LuaValueLuaValue.getfenv() - -
-          Get the environemnt for an instance.
-static LuaValueLuaThread.getGlobals() - -
-          Get the current thread's environment
- LuaValueLuaBoolean.getmetatable() - -
-           
- LuaValueLuaClosure.getmetatable() - -
-           
- LuaValueLuaFunction.getmetatable() - -
-           
- LuaValueLuaNil.getmetatable() - -
-           
- LuaValueLuaNumber.getmetatable() - -
-           
- LuaValueLuaString.getmetatable() - -
-           
- LuaValueLuaTable.getmetatable() - -
-           
- LuaValueLuaThread.getmetatable() - -
-           
- LuaValueLuaUserdata.getmetatable() - -
-           
- LuaValueLuaValue.getmetatable() - -
-          Get the metatable for this LuaValue
- LuaValueLuaTable.getn() - -
-           
- LuaValueLuaValue.getn() - -
-          Implementation of lua 5.0 getn() function.
-protected static LuaValueLuaValue.gettable(LuaValue t, - LuaValue key) - -
-          get value from metatable operations, or NIL if not defined by metatables
-protected  LuaValueLuaClosure.getUpvalue(int i) - -
-           
- LuaValueUpValue.getValue() - -
-          Get the value of the upvalue
- LuaValueLuaDouble.gt(double rhs) - -
-           
- LuaValueLuaInteger.gt(double rhs) - -
-           
- LuaValueLuaValue.gt(double rhs) - -
-          Greater than: Perform numeric comparison with another value - of double type, - including metatag processing, and returning LuaValue.
- LuaValueLuaDouble.gt(int rhs) - -
-           
- LuaValueLuaInteger.gt(int rhs) - -
-           
- LuaValueLuaValue.gt(int rhs) - -
-          Greater than: Perform numeric comparison with another value - of int type, - including metatag processing, and returning LuaValue.
- LuaValueLuaDouble.gt(LuaValue rhs) - -
-           
- LuaValueLuaInteger.gt(LuaValue rhs) - -
-           
- LuaValueLuaString.gt(LuaValue rhs) - -
-           
- LuaValueLuaValue.gt(LuaValue rhs) - -
-          Greater than: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue.
- LuaValueLuaDouble.gteq(double rhs) - -
-           
- LuaValueLuaInteger.gteq(double rhs) - -
-           
- LuaValueLuaValue.gteq(double rhs) - -
-          Greater than or equals: Perform numeric comparison with another value - of double type, - including metatag processing, and returning LuaValue.
- LuaValueLuaDouble.gteq(int rhs) - -
-           
- LuaValueLuaInteger.gteq(int rhs) - -
-           
- LuaValueLuaValue.gteq(int rhs) - -
-          Greater than or equals: Perform numeric comparison with another value - of int type, - including metatag processing, and returning LuaValue.
- LuaValueLuaDouble.gteq(LuaValue rhs) - -
-           
- LuaValueLuaInteger.gteq(LuaValue rhs) - -
-           
- LuaValueLuaString.gteq(LuaValue rhs) - -
-           
- LuaValueLuaValue.gteq(LuaValue rhs) - -
-          Greater than or equals: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue.
-protected  LuaValueLuaTable.hashget(LuaValue key) - -
-           
-protected  LuaValueWeakTable.hashget(LuaValue key) - -
-          Get the hash value for a key - key the key to look up
-protected  LuaValueLuaValue.illegal(java.lang.String op, - java.lang.String typename) - -
-          Throw a LuaError indicating an illegal operation occurred, - typically involved in managing weak references
- LuaValue[]LuaTable.keys() - -
-          This may be deprecated in a future release.
- LuaValueLuaString.len() - -
-           
- LuaValueLuaTable.len() - -
-           
- LuaValueLuaValue.len() - -
-          Length operator: return lua length of object (#this) including metatag processing as java int
-protected  LuaValueLuaValue.lenerror() - -
-          Throw a LuaError based on the len operator, - typically due to an invalid operand type
- LuaValueLuaValue.load(LuaValue library) - -
-          Load a library instance by setting its environment to this - and calling it, which should iniitalize the library instance and - install itself into this instance.
-static LuaValueLoadState.longBitsToLuaNumber(long bits) - -
-          Convert bits in a long value to a LuaValue.
- LuaValueLuaDouble.lt(double rhs) - -
-           
- LuaValueLuaInteger.lt(double rhs) - -
-           
- LuaValueLuaValue.lt(double rhs) - -
-          Less than: Perform numeric comparison with another value - of double type, - including metatag processing, and returning LuaValue.
- LuaValueLuaDouble.lt(int rhs) - -
-           
- LuaValueLuaInteger.lt(int rhs) - -
-           
- LuaValueLuaValue.lt(int rhs) - -
-          Less than: Perform numeric comparison with another value - of int type, - including metatag processing, and returning LuaValue.
- LuaValueLuaDouble.lt(LuaValue rhs) - -
-           
- LuaValueLuaInteger.lt(LuaValue rhs) - -
-           
- LuaValueLuaString.lt(LuaValue rhs) - -
-           
- LuaValueLuaValue.lt(LuaValue rhs) - -
-          Less than: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue.
- LuaValueLuaDouble.lteq(double rhs) - -
-           
- LuaValueLuaInteger.lteq(double rhs) - -
-           
- LuaValueLuaValue.lteq(double rhs) - -
-          Less than or equals: Perform numeric comparison with another value - of double type, - including metatag processing, and returning LuaValue.
- LuaValueLuaDouble.lteq(int rhs) - -
-           
- LuaValueLuaInteger.lteq(int rhs) - -
-           
- LuaValueLuaValue.lteq(int rhs) - -
-          Less than or equals: Perform numeric comparison with another value - of int type, - including metatag processing, and returning LuaValue.
- LuaValueLuaDouble.lteq(LuaValue rhs) - -
-           
- LuaValueLuaInteger.lteq(LuaValue rhs) - -
-           
- LuaValueLuaString.lteq(LuaValue rhs) - -
-           
- LuaValueLuaValue.lteq(LuaValue rhs) - -
-          Less than or equals: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue.
- LuaValueLuaValue.metatag(LuaValue tag) - -
-          Get particular metatag, or return NIL if it doesn't exist
- LuaValueLuaValue.method(LuaValue name) - -
-          Call named method on this with 0 arguments, including metatag processing, - and return only the first return value.
- LuaValueLuaValue.method(LuaValue name, - LuaValue arg) - -
-          Call named method on this with 1 argument, including metatag processing, - and return only the first return value.
- LuaValueLuaValue.method(LuaValue name, - LuaValue arg1, - LuaValue arg2) - -
-          Call named method on this with 2 arguments, including metatag processing, - and return only the first return value.
- LuaValueLuaValue.method(java.lang.String name) - -
-          Call named method on this with 0 arguments, including metatag processing, - and return only the first return value.
- LuaValueLuaValue.method(java.lang.String name, - LuaValue arg) - -
-          Call named method on this with 1 argument, including metatag processing, - and return only the first return value.
- LuaValueLuaValue.method(java.lang.String name, - LuaValue arg1, - LuaValue arg2) - -
-          Call named method on this with 2 arguments, including metatag processing, - and return only the first return value.
- LuaValueLuaDouble.mod(double rhs) - -
-           
- LuaValueLuaInteger.mod(double rhs) - -
-           
- LuaValueLuaString.mod(double rhs) - -
-           
- LuaValueLuaValue.mod(double rhs) - -
-          Modulo: Perform numeric modulo operation with another value - of double type without metatag processing
- LuaValueLuaDouble.mod(int rhs) - -
-           
- LuaValueLuaInteger.mod(int rhs) - -
-           
- LuaValueLuaString.mod(int rhs) - -
-           
- LuaValueLuaValue.mod(int rhs) - -
-          Modulo: Perform numeric modulo operation with another value - of int type without metatag processing
- LuaValueLuaDouble.mod(LuaValue rhs) - -
-           
- LuaValueLuaInteger.mod(LuaValue rhs) - -
-           
- LuaValueLuaString.mod(LuaValue rhs) - -
-           
- LuaValueLuaValue.mod(LuaValue rhs) - -
-          Modulo: Perform numeric modulo operation with another value - of unknown type, - including metatag processing.
- LuaValueLuaDouble.modFrom(double lhs) - -
-           
- LuaValueLuaInteger.modFrom(double lhs) - -
-           
- LuaValueLuaString.modFrom(double lhs) - -
-           
- LuaValueLuaValue.modFrom(double lhs) - -
-          Reverse-modulo: Perform numeric modulo operation from another value - with metatag processing
- LuaValueLuaDouble.mul(double lhs) - -
-           
- LuaValueLuaInteger.mul(double lhs) - -
-           
- LuaValueLuaString.mul(double rhs) - -
-           
- LuaValueLuaValue.mul(double rhs) - -
-          Multiply: Perform numeric multiply operation with another value - of double type with metatag processing
- LuaValueLuaDouble.mul(int lhs) - -
-           
- LuaValueLuaInteger.mul(int lhs) - -
-           
- LuaValueLuaString.mul(int rhs) - -
-           
- LuaValueLuaValue.mul(int rhs) - -
-          Multiply: Perform numeric multiply operation with another value - of int type with metatag processing
- LuaValueLuaDouble.mul(LuaValue rhs) - -
-           
- LuaValueLuaInteger.mul(LuaValue rhs) - -
-           
- LuaValueLuaString.mul(LuaValue rhs) - -
-           
- LuaValueLuaValue.mul(LuaValue rhs) - -
-          Multiply: Perform numeric multiply operation with another value - of unknown type, - including metatag processing.
- LuaValueLuaDouble.neg() - -
-           
- LuaValueLuaInteger.neg() - -
-           
- LuaValueLuaString.neg() - -
-           
- LuaValueLuaValue.neg() - -
-          Unary minus: return negative value (-this) as defined by lua unary minus operator
- LuaValueLuaValue.neq(LuaValue val) - -
-          Notquals: Perform inequality comparison with another value - including metatag processing using EQ.
- LuaValueLuaBoolean.not() - -
-           
- LuaValueLuaNil.not() - -
-           
- LuaValueLuaValue.not() - -
-          Unary not: return inverse boolean value (~this) as defined by lua not operator
- LuaValueVarargs.optvalue(int i, - LuaValue defval) - -
-          Return argument i as a LuaValue if it exists, or defval.
- LuaValueLuaNil.optvalue(LuaValue defval) - -
-           
- LuaValueLuaValue.optvalue(LuaValue defval) - -
-          Perform argument check that this is not nil or none.
- LuaValueLuaValue.or(LuaValue rhs) - -
-          Perform boolean or with another operand, based on lua rules for boolean evaluation.
- LuaValueLuaDouble.pow(double rhs) - -
-           
- LuaValueLuaInteger.pow(double rhs) - -
-           
- LuaValueLuaString.pow(double rhs) - -
-           
- LuaValueLuaValue.pow(double rhs) - -
-          Raise to power: Raise this value to a power - of double type with metatag processing
- LuaValueLuaDouble.pow(int rhs) - -
-           
- LuaValueLuaInteger.pow(int rhs) - -
-           
- LuaValueLuaString.pow(int rhs) - -
-           
- LuaValueLuaValue.pow(int rhs) - -
-          Raise to power: Raise this value to a power - of int type with metatag processing
- LuaValueLuaDouble.pow(LuaValue rhs) - -
-           
- LuaValueLuaInteger.pow(LuaValue rhs) - -
-           
- LuaValueLuaString.pow(LuaValue rhs) - -
-           
- LuaValueLuaValue.pow(LuaValue rhs) - -
-          Raise to power: Raise this value to a power - including metatag processing.
- LuaValueLuaDouble.powWith(double lhs) - -
-           
- LuaValueLuaInteger.powWith(double lhs) - -
-           
- LuaValueLuaString.powWith(double lhs) - -
-           
- LuaValueLuaValue.powWith(double lhs) - -
-          Reverse-raise to power: Raise another value of double type to this power - with metatag processing
- LuaValueLuaDouble.powWith(int lhs) - -
-           
- LuaValueLuaInteger.powWith(int lhs) - -
-           
- LuaValueLuaString.powWith(int lhs) - -
-           
- LuaValueLuaValue.powWith(int lhs) - -
-          Reverse-raise to power: Raise another value of double type to this power - with metatag processing
- LuaValueLuaTable.rawget(int key) - -
-           
- LuaValueLuaValue.rawget(int key) - -
-          Get a value in a table without metatag processing.
- LuaValueWeakTable.rawget(int key) - -
-           
- LuaValueLuaTable.rawget(LuaValue key) - -
-           
- LuaValueLuaValue.rawget(LuaValue key) - -
-          Get a value in a table without metatag processing.
- LuaValueWeakTable.rawget(LuaValue key) - -
-           
- LuaValueLuaValue.rawget(java.lang.String key) - -
-          Get a value in a table without metatag processing.
- LuaValueLuaTable.remove(int pos) - -
-          Remove the element at a position in a list-table
-static LuaValueLuaThread.setErrorFunc(LuaValue errfunc) - -
-          Replace the error function of the currently running thread.
- LuaValueLuaTable.setmetatable(LuaValue metatable) - -
-           
- LuaValueLuaUserdata.setmetatable(LuaValue metatable) - -
-           
- LuaValueLuaValue.setmetatable(LuaValue metatable) - -
-          Set the metatable for this LuaValue
- LuaValueLuaValue.strongkey() - -
-          Return the key part of this value if it is a weak table entry, or NIL if it was weak and is no longer referenced.
- LuaValueLuaValue.strongvalue() - -
-          Return this value as a strong reference, or NIL if it was weak and is no longer referenced.
- LuaValueLuaDouble.sub(double rhs) - -
-           
- LuaValueLuaInteger.sub(double rhs) - -
-           
- LuaValueLuaString.sub(double rhs) - -
-           
- LuaValueLuaValue.sub(double rhs) - -
-          Subtract: Perform numeric subtract operation with another value - of double type with metatag processing
- LuaValueLuaDouble.sub(int rhs) - -
-           
- LuaValueLuaInteger.sub(int rhs) - -
-           
- LuaValueLuaString.sub(int rhs) - -
-           
- LuaValueLuaValue.sub(int rhs) - -
-          Subtract: Perform numeric subtract operation with another value - of int type with metatag processing
- LuaValueLuaDouble.sub(LuaValue rhs) - -
-           
- LuaValueLuaInteger.sub(LuaValue rhs) - -
-           
- LuaValueLuaString.sub(LuaValue rhs) - -
-           
- LuaValueLuaValue.sub(LuaValue rhs) - -
-          Subtract: Perform numeric subtract operation with another value - of unknown type, - including metatag processing.
- LuaValueLuaDouble.subFrom(double lhs) - -
-           
- LuaValueLuaInteger.subFrom(double lhs) - -
-           
- LuaValueLuaString.subFrom(double lhs) - -
-           
- LuaValueLuaValue.subFrom(double lhs) - -
-          Reverse-subtract: Perform numeric subtract operation from an int value - with metatag processing
- LuaValueLuaInteger.subFrom(int lhs) - -
-           
- LuaValueLuaValue.subFrom(int lhs) - -
-          Reverse-subtract: Perform numeric subtract operation from a double value - without metatag processing
- LuaValueLuaDouble.tonumber() - -
-           
- LuaValueLuaNumber.tonumber() - -
-           
- LuaValueLuaString.tonumber() - -
-           
- LuaValueLuaValue.tonumber() - -
-          Conditionally convert to lua number without throwing errors.
- LuaValueLuaString.tonumber(int base) - -
-          convert to a number using a supplied base, or NIL if it can't be converted
- LuaValueLuaDouble.tostring() - -
-           
- LuaValueLuaInteger.tostring() - -
-           
- LuaValueLuaString.tostring() - -
-           
- LuaValueLuaValue.tostring() - -
-          Conditionally convert to lua string without throwing errors.
-protected  LuaValueLuaValue.typerror(java.lang.String expected) - -
-          Throw a LuaError indicating an invalid type was supplied to a function
-protected  LuaValueLuaValue.unimplemented(java.lang.String fun) - -
-          Throw a LuaError indicating an operation is not implemented
- LuaValueBuffer.value() - -
-          Get buffer contents as a LuaValue
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Methods in org.luaj.vm2 with parameters of type LuaValue
- LuaValueLuaDouble.add(LuaValue rhs) - -
-           
- LuaValueLuaInteger.add(LuaValue rhs) - -
-           
- LuaValueLuaString.add(LuaValue rhs) - -
-           
- LuaValueLuaValue.add(LuaValue rhs) - -
-          Add: Perform numeric add operation with another value - including metatag processing.
- LuaValueLuaValue.and(LuaValue rhs) - -
-          Perform boolean and with another operand, based on lua rules for boolean evaluation.
- BufferBuffer.append(LuaValue val) - -
-          Append a LuaValue to the buffer.
-protected  LuaValueLuaValue.arithmt(LuaValue tag, - LuaValue op2) - -
-          Perform metatag processing for arithmetic operations.
-protected  LuaValueLuaValue.arithmtwith(LuaValue tag, - double op1) - -
-          Perform metatag processing for arithmetic operations when the left-hand-side is a number.
- LuaValueLuaClosure.call(LuaValue arg) - -
-           
- LuaValueLuaValue.call(LuaValue arg) - -
-          Call this with 1 argument, including metatag processing, - and return only the first return value.
- LuaValueLuaClosure.call(LuaValue arg1, - LuaValue arg2) - -
-           
- LuaValueLuaValue.call(LuaValue arg1, - LuaValue arg2) - -
-          Call this with 2 arguments, including metatag processing, - and return only the first return value.
- LuaValueLuaClosure.call(LuaValue arg1, - LuaValue arg2, - LuaValue arg3) - -
-           
- LuaValueLuaValue.call(LuaValue arg1, - LuaValue arg2, - LuaValue arg3) - -
-          Call this with 3 arguments, including metatag processing, - and return only the first return value.
-protected  LuaValueLuaValue.checkmetatag(LuaValue tag, - java.lang.String reason) - -
-          Get particular metatag, or throw LuaError if it doesn't exist
-protected  LuaValueLuaValue.compareerror(LuaValue rhs) - -
-          Throw a LuaError based on a comparison error such as greater-than or less-than, - typically due to an invalid operand type
- LuaValueLuaValue.comparemt(LuaValue tag, - LuaValue op1) - -
-          Perform metatag processing for comparison operations.
- LuaValueLuaNumber.concat(LuaValue rhs) - -
-           
- LuaValueLuaString.concat(LuaValue rhs) - -
-           
- LuaValueLuaValue.concat(LuaValue rhs) - -
-          Concatenate another value onto this value and return the result - using rules of lua string concatenation including metatag processing.
- LuaValueLuaValue.concatmt(LuaValue rhs) - -
-          Perform metatag processing for concatenation operations.
- BufferBuffer.concatTo(LuaValue lhs) - -
-          Concatenate this buffer onto a LuaValue
- LuaValueLuaValue.concatTo(LuaValue lhs) - -
-          Reverse-concatenation: concatenate this value onto another value - whose type is unknwon - and return the result using rules of lua string concatenation including - metatag processing.
- LuaValueLuaDouble.div(LuaValue rhs) - -
-           
- LuaValueLuaInteger.div(LuaValue rhs) - -
-           
- LuaValueLuaString.div(LuaValue rhs) - -
-           
- LuaValueLuaValue.div(LuaValue rhs) - -
-          Divide: Perform numeric divide operation by another value - of unknown type, - including metatag processing.
- booleanLuaDouble.eq_b(LuaValue val) - -
-           
- booleanLuaInteger.eq_b(LuaValue val) - -
-           
- booleanLuaString.eq_b(LuaValue val) - -
-           
- booleanLuaTable.eq_b(LuaValue val) - -
-           
- booleanLuaUserdata.eq_b(LuaValue val) - -
-           
- booleanLuaValue.eq_b(LuaValue val) - -
-          Equals: Perform equality comparison with another value - including metatag processing using EQ, - and return java boolean
- LuaValueLuaDouble.eq(LuaValue val) - -
-           
- LuaValueLuaInteger.eq(LuaValue val) - -
-           
- LuaValueLuaString.eq(LuaValue val) - -
-           
- LuaValueLuaTable.eq(LuaValue val) - -
-           
- LuaValueLuaUserdata.eq(LuaValue val) - -
-           
- LuaValueLuaValue.eq(LuaValue val) - -
-          Equals: Perform equality comparison with another value - including metatag processing using EQ.
- booleanLuaUserdata.eqmt(LuaValue val) - -
-           
-static booleanLuaValue.eqmtcall(LuaValue lhs, - LuaValue lhsmt, - LuaValue rhs, - LuaValue rhsmt) - -
-          Perform equality testing metatag processing
-protected  VarargsLuaClosure.execute(LuaValue[] stack, - Varargs varargs) - -
-           
- LuaValueLuaTable.foreach(LuaValue func) - -
-          Call the supplied function once for each key-value pair
- LuaValueLuaTable.foreachi(LuaValue func) - -
-          Call the supplied function once for each key-value pair - in the contiguous array part
- LuaValueLuaString.get(LuaValue key) - -
-           
- LuaValueLuaTable.get(LuaValue key) - -
-           
- LuaValueLuaUserdata.get(LuaValue key) - -
-           
- LuaValueLuaValue.get(LuaValue key) - -
-          Get a value in a table including metatag processing using INDEX.
-protected static LuaValueLuaValue.gettable(LuaValue t, - LuaValue key) - -
-          get value from metatable operations, or NIL if not defined by metatables
- booleanLuaDouble.gt_b(LuaValue rhs) - -
-           
- booleanLuaInteger.gt_b(LuaValue rhs) - -
-           
- booleanLuaString.gt_b(LuaValue rhs) - -
-           
- booleanLuaValue.gt_b(LuaValue rhs) - -
-          Greater than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean.
- LuaValueLuaDouble.gt(LuaValue rhs) - -
-           
- LuaValueLuaInteger.gt(LuaValue rhs) - -
-           
- LuaValueLuaString.gt(LuaValue rhs) - -
-           
- LuaValueLuaValue.gt(LuaValue rhs) - -
-          Greater than: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue.
- booleanLuaDouble.gteq_b(LuaValue rhs) - -
-           
- booleanLuaInteger.gteq_b(LuaValue rhs) - -
-           
- booleanLuaString.gteq_b(LuaValue rhs) - -
-           
- booleanLuaValue.gteq_b(LuaValue rhs) - -
-          Greater than or equals: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean.
- LuaValueLuaDouble.gteq(LuaValue rhs) - -
-           
- LuaValueLuaInteger.gteq(LuaValue rhs) - -
-           
- LuaValueLuaString.gteq(LuaValue rhs) - -
-           
- LuaValueLuaValue.gteq(LuaValue rhs) - -
-          Greater than or equals: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue.
- intLuaTable.hashFindSlot(LuaValue key) - -
-          Find the hashtable slot to use
- intWeakTable.hashFindSlot(LuaValue key) - -
-           
-protected  LuaValueLuaTable.hashget(LuaValue key) - -
-           
-protected  LuaValueWeakTable.hashget(LuaValue key) - -
-          Get the hash value for a key - key the key to look up
- voidLuaTable.hashset(LuaValue key, - LuaValue value) - -
-          Set a hashtable value
- VarargsLuaTable.inext(LuaValue key) - -
-          Get the next element after a particular key in the - contiguous array part of a table
- VarargsLuaValue.inext(LuaValue index) - -
-          Find the next integer-key,value pair if this is a table, - return NIL if there are no more, or throw a LuaError if not a table.
- voidLuaTable.insert(int pos, - LuaValue value) - -
-          Insert an element at a position in a list-table
- VarargsLuaValue.invoke(LuaValue[] args) - -
-          Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs.
- VarargsLuaValue.invoke(LuaValue[] args, - Varargs varargs) - -
-          Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs.
- VarargsLuaValue.invoke(LuaValue arg1, - LuaValue arg2, - Varargs varargs) - -
-          Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs.
- VarargsLuaValue.invoke(LuaValue arg, - Varargs varargs) - -
-          Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs.
- VarargsLuaValue.invokemethod(LuaValue name) - -
-          Call named method on this with 0 arguments, including metatag processing, - and retain all return values in a Varargs.
- VarargsLuaValue.invokemethod(LuaValue name, - LuaValue[] args) - -
-          Call named method on this with variable arguments, including metatag processing, - and retain all return values in a Varargs.
- VarargsLuaValue.invokemethod(LuaValue name, - LuaValue[] args) - -
-          Call named method on this with variable arguments, including metatag processing, - and retain all return values in a Varargs.
- VarargsLuaValue.invokemethod(LuaValue name, - Varargs args) - -
-          Call named method on this with variable arguments, including metatag processing, - and retain all return values in a Varargs.
- VarargsLuaValue.invokemethod(java.lang.String name, - LuaValue[] args) - -
-          Call named method on this with 1 argument, including metatag processing, - and retain all return values in a Varargs.
-static LuaTableLuaValue.listOf(LuaValue[] unnamedValues) - -
-          Construct a LuaTable initialized with supplied array values.
-static LuaTableLuaValue.listOf(LuaValue[] unnamedValues, - Varargs lastarg) - -
-          Construct a LuaTable initialized with supplied array values.
-static LuaFunctionLoadState.load(java.io.InputStream stream, - java.lang.String name, - LuaValue env) - -
-          Load lua in either binary or text form from an input stream.
- LuaFunctionLoadState.LuaCompiler.load(java.io.InputStream stream, - java.lang.String filename, - LuaValue env) - -
-          Load into a Closure or LuaFunction from a Stream and initializes the environment
- LuaValueLuaValue.load(LuaValue library) - -
-          Load a library instance by setting its environment to this - and calling it, which should iniitalize the library instance and - install itself into this instance.
- booleanLuaDouble.lt_b(LuaValue rhs) - -
-           
- booleanLuaInteger.lt_b(LuaValue rhs) - -
-           
- booleanLuaString.lt_b(LuaValue rhs) - -
-           
- booleanLuaValue.lt_b(LuaValue rhs) - -
-          Less than: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean.
- LuaValueLuaDouble.lt(LuaValue rhs) - -
-           
- LuaValueLuaInteger.lt(LuaValue rhs) - -
-           
- LuaValueLuaString.lt(LuaValue rhs) - -
-           
- LuaValueLuaValue.lt(LuaValue rhs) - -
-          Less than: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue.
- booleanLuaDouble.lteq_b(LuaValue rhs) - -
-           
- booleanLuaInteger.lteq_b(LuaValue rhs) - -
-           
- booleanLuaString.lteq_b(LuaValue rhs) - -
-           
- booleanLuaValue.lteq_b(LuaValue rhs) - -
-          Less than or equals: Perform numeric or string comparison with another value - of unknown type, including metatag processing, - and returning java boolean.
- LuaValueLuaDouble.lteq(LuaValue rhs) - -
-           
- LuaValueLuaInteger.lteq(LuaValue rhs) - -
-           
- LuaValueLuaString.lteq(LuaValue rhs) - -
-           
- LuaValueLuaValue.lteq(LuaValue rhs) - -
-          Less than or equals: Perform numeric or string comparison with another value - of unknown type, - including metatag processing, and returning LuaValue.
- LuaValueLuaValue.metatag(LuaValue tag) - -
-          Get particular metatag, or return NIL if it doesn't exist
- LuaValueLuaValue.method(LuaValue name) - -
-          Call named method on this with 0 arguments, including metatag processing, - and return only the first return value.
- LuaValueLuaValue.method(LuaValue name, - LuaValue arg) - -
-          Call named method on this with 1 argument, including metatag processing, - and return only the first return value.
- LuaValueLuaValue.method(LuaValue name, - LuaValue arg1, - LuaValue arg2) - -
-          Call named method on this with 2 arguments, including metatag processing, - and return only the first return value.
- LuaValueLuaValue.method(java.lang.String name, - LuaValue arg) - -
-          Call named method on this with 1 argument, including metatag processing, - and return only the first return value.
- LuaValueLuaValue.method(java.lang.String name, - LuaValue arg1, - LuaValue arg2) - -
-          Call named method on this with 2 arguments, including metatag processing, - and return only the first return value.
- LuaValueLuaDouble.mod(LuaValue rhs) - -
-           
- LuaValueLuaInteger.mod(LuaValue rhs) - -
-           
- LuaValueLuaString.mod(LuaValue rhs) - -
-           
- LuaValueLuaValue.mod(LuaValue rhs) - -
-          Modulo: Perform numeric modulo operation with another value - of unknown type, - including metatag processing.
- LuaValueLuaDouble.mul(LuaValue rhs) - -
-           
- LuaValueLuaInteger.mul(LuaValue rhs) - -
-           
- LuaValueLuaString.mul(LuaValue rhs) - -
-           
- LuaValueLuaValue.mul(LuaValue rhs) - -
-          Multiply: Perform numeric multiply operation with another value - of unknown type, - including metatag processing.
- booleanLuaValue.neq_b(LuaValue val) - -
-          Notquals: Perform inequality comparison with another value - including metatag processing using EQ.
- LuaValueLuaValue.neq(LuaValue val) - -
-          Notquals: Perform inequality comparison with another value - including metatag processing using EQ.
- VarargsLuaTable.next(LuaValue key) - -
-          Get the next element after a particular key in the table
- VarargsLuaValue.next(LuaValue index) - -
-          Find the next key,value pair if this is a table, - return NIL if there are no more, or throw a LuaError if not a table.
- VarargsWeakTable.next(LuaValue key) - -
-          Get the next element after a particular key in the table
- LuaValueVarargs.optvalue(int i, - LuaValue defval) - -
-          Return argument i as a LuaValue if it exists, or defval.
- LuaValueLuaNil.optvalue(LuaValue defval) - -
-           
- LuaValueLuaValue.optvalue(LuaValue defval) - -
-          Perform argument check that this is not nil or none.
- LuaValueLuaValue.or(LuaValue rhs) - -
-          Perform boolean or with another operand, based on lua rules for boolean evaluation.
- LuaValueLuaDouble.pow(LuaValue rhs) - -
-           
- LuaValueLuaInteger.pow(LuaValue rhs) - -
-           
- LuaValueLuaString.pow(LuaValue rhs) - -
-           
- LuaValueLuaValue.pow(LuaValue rhs) - -
-          Raise to power: Raise this value to a power - including metatag processing.
-static voidPrint.printState(LuaClosure cl, - int pc, - LuaValue[] stack, - int top, - Varargs varargs) - -
-          Print the state of a LuaClosure that is being executed
- booleanLuaDouble.raweq(LuaValue val) - -
-           
- booleanLuaInteger.raweq(LuaValue val) - -
-           
- booleanLuaString.raweq(LuaValue val) - -
-           
- booleanLuaUserdata.raweq(LuaValue val) - -
-           
- booleanLuaValue.raweq(LuaValue val) - -
-          Equals: Perform direct equality comparison with another value - without metatag processing.
- LuaValueLuaTable.rawget(LuaValue key) - -
-           
- LuaValueLuaValue.rawget(LuaValue key) - -
-          Get a value in a table without metatag processing.
- LuaValueWeakTable.rawget(LuaValue key) - -
-           
- voidLuaTable.rawset(int key, - LuaValue value) - -
-           
- voidLuaValue.rawset(int key, - LuaValue value) - -
-          Set a value in a table without metatag processing.
- voidWeakTable.rawset(int key, - LuaValue value) - -
-           
- voidLuaTable.rawset(LuaValue key, - LuaValue value) - -
-          caller must ensure key is not nil
- voidLuaValue.rawset(LuaValue key, - LuaValue value) - -
-          Set a value in a table without metatag processing.
- voidWeakTable.rawset(LuaValue key, - LuaValue value) - -
-           
- voidLuaValue.rawset(java.lang.String key, - LuaValue value) - -
-          Set a value in a table without metatag processing.
- voidLuaTable.set(int key, - LuaValue value) - -
-           
- voidLuaValue.set(int key, - LuaValue value) - -
-          Set a value in a table without metatag processing using NEWINDEX.
- voidLuaTable.set(LuaValue key, - LuaValue value) - -
-          caller must ensure key is not nil
- voidLuaUserdata.set(LuaValue key, - LuaValue value) - -
-           
- voidLuaValue.set(LuaValue key, - LuaValue value) - -
-          Set a value in a table without metatag processing using NEWINDEX.
- voidLuaValue.set(java.lang.String key, - LuaValue value) - -
-          Set a value in a table without metatag processing using NEWINDEX.
-static LuaValueLuaThread.setErrorFunc(LuaValue errfunc) - -
-          Replace the error function of the currently running thread.
- voidLuaFunction.setfenv(LuaValue env) - -
-           
- voidLuaThread.setfenv(LuaValue env) - -
-           
- voidLuaValue.setfenv(LuaValue env) - -
-          Set the environment on an object.
-static voidLuaThread.setGlobals(LuaValue globals) - -
-          Set the globals of the current thread.
- LuaValueLuaTable.setmetatable(LuaValue metatable) - -
-           
- LuaValueLuaUserdata.setmetatable(LuaValue metatable) - -
-           
- LuaValueLuaValue.setmetatable(LuaValue metatable) - -
-          Set the metatable for this LuaValue
-protected static booleanLuaValue.settable(LuaValue t, - LuaValue key, - LuaValue value) - -
-          Perform field assignment including metatag processing.
-protected  voidLuaClosure.setUpvalue(int i, - LuaValue v) - -
-           
- BufferBuffer.setvalue(LuaValue value) - -
-          Set buffer contents as a LuaValue
- voidUpValue.setValue(LuaValue value) - -
-          Set the value of the upvalue
- voidLuaTable.sort(LuaValue comparator) - -
-          Sort the table using a comparator.
- voidWeakTable.sort(LuaValue comparator) - -
-           
- intLuaString.strcmp(LuaValue lhs) - -
-           
- intLuaValue.strcmp(LuaValue rhs) - -
-          Perform string comparison with another value - of any type - using string comparison based on byte values.
- LuaValueLuaDouble.sub(LuaValue rhs) - -
-           
- LuaValueLuaInteger.sub(LuaValue rhs) - -
-           
- LuaValueLuaString.sub(LuaValue rhs) - -
-           
- LuaValueLuaValue.sub(LuaValue rhs) - -
-          Subtract: Perform numeric subtract operation with another value - of unknown type, - including metatag processing.
-static LuaTableLuaValue.tableOf(LuaValue[] namedValues) - -
-          Construct a LuaTable initialized with supplied named values.
-static LuaTableLuaValue.tableOf(LuaValue[] namedValues, - LuaValue[] unnamedValues) - -
-          Construct a LuaTable initialized with supplied named values and sequential elements.
-static LuaTableLuaValue.tableOf(LuaValue[] namedValues, - LuaValue[] unnamedValues) - -
-          Construct a LuaTable initialized with supplied named values and sequential elements.
-static LuaTableLuaValue.tableOf(LuaValue[] namedValues, - LuaValue[] unnamedValues, - Varargs lastarg) - -
-          Construct a LuaTable initialized with supplied named values and sequential elements in an array part and as varargs.
-static LuaTableLuaValue.tableOf(LuaValue[] namedValues, - LuaValue[] unnamedValues, - Varargs lastarg) - -
-          Construct a LuaTable initialized with supplied named values and sequential elements in an array part and as varargs.
-static VarargsLuaValue.tailcallOf(LuaValue func, - Varargs args) - -
-          Construct a TailcallVarargs around a function and arguments.
- booleanLuaValue.testfor_b(LuaValue limit, - LuaValue step) - -
-          Perform end-condition test in for-loop processing.
-static LuaUserdataLuaValue.userdataOf(java.lang.Object o, - LuaValue metatable) - -
-          Construct a LuaUserdata for an object with a user supplied metatable.
-static VarargsLuaValue.varargsOf(LuaValue[] v) - -
-          Construct a Varargs around an array of LuaValues.
-static VarargsLuaValue.varargsOf(LuaValue[] v, - int offset, - int length) - -
-          Construct a Varargs around an array of LuaValues.
-static VarargsLuaValue.varargsOf(LuaValue[] v, - int offset, - int length, - Varargs more) - -
-          Construct a Varargs around an array of LuaValues.
-static VarargsLuaValue.varargsOf(LuaValue[] v, - Varargs r) - -
-          Construct a Varargs around an array of LuaValues.
-static VarargsLuaValue.varargsOf(LuaValue v1, - LuaValue v2, - Varargs v3) - -
-          Construct a Varargs around a set of 3 or more LuaValues.
-static VarargsLuaValue.varargsOf(LuaValue v, - Varargs r) - -
-          Construct a Varargs around a set of 2 or more LuaValues.
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Constructors in org.luaj.vm2 with parameters of type LuaValue
Buffer(LuaValue value) - -
-          Create buffer with specified initial value
LuaClosure(int nupvalues, - LuaValue env) - -
-           
LuaClosure(Prototype p, - LuaValue env) - -
-          Supply the initial environment
LuaFunction(LuaValue env) - -
-           
LuaTable(LuaValue[] named, - LuaValue[] unnamed, - Varargs lastarg) - -
-          Construct table with named and unnamed parts.
LuaTable(LuaValue[] named, - LuaValue[] unnamed, - Varargs lastarg) - -
-          Construct table with named and unnamed parts.
LuaThread(LuaValue func, - LuaValue env) - -
-          Create a LuaThread around a function and environment
LuaUserdata(java.lang.Object obj, - LuaValue metatable) - -
-           
TailcallVarargs(LuaValue object, - LuaValue methodname, - Varargs args) - -
-           
TailcallVarargs(LuaValue f, - Varargs args) - -
-           
UpValue(LuaValue[] stack, - int index) - -
-          Create an upvalue relative to a stack
-  -

- - - - - -
-Uses of LuaValue in org.luaj.vm2.compiler
-  -

- - - - - - - - - - - - - -
Methods in org.luaj.vm2.compiler with parameters of type LuaValue
- LuaFunctionLuaC.load(java.io.InputStream stream, - java.lang.String name, - LuaValue env) - -
-          Load into a Closure or LuaFunction, with the supplied initial environment
- LuaFunctionLuaC.load(Prototype p, - java.lang.String filename, - LuaValue env) - -
-           
-  -

- - - - - -
-Uses of LuaValue in org.luaj.vm2.lib
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Subclasses of LuaValue in org.luaj.vm2.lib
- classBaseLib - -
-          Subclass of LibFunction which implements the lua basic library functions.
- classCoroutineLib - -
-          Subclass of LibFunction which implements the lua standard coroutine - library.
- classDebugLib - -
-          Subclass of LibFunction which implements the lua standard debug - library.
- classIoLib - -
-          Abstract base class extending LibFunction which implements the - core of the lua standard io library.
-protected  classIoLib.File - -
-           
- classLibFunction - -
-          Subclass of LuaFunction common to Java functions exposed to lua.
- classMathLib - -
-          Subclass of LibFunction which implements the lua standard math - library.
- classOneArgFunction - -
-          Abstract base class for Java function implementations that take one argument and - return one value.
- classOsLib - -
-          Subclass of LibFunction which implements the standard lua os library.
- classPackageLib - -
-          Subclass of LibFunction which implements the lua standard package and module - library functions.
- classStringLib - -
-          Subclass of LibFunction which implements the lua standard string - library.
- classTableLib - -
-          Subclass of LibFunction which implements the lua standard table - library.
- classThreeArgFunction - -
-          Abstract base class for Java function implementations that take two arguments and - return one value.
- classTwoArgFunction - -
-          Abstract base class for Java function implementations that take two arguments and - return one value.
- classVarArgFunction - -
-          Abstract base class for Java function implementations that takes varaiable arguments and - returns multiple return values.
- classZeroArgFunction - -
-          Abstract base class for Java function implementations that take no arguments and - return one value.
-  -

- - - - - - - - - - - - - - - - - -
Fields in org.luaj.vm2.lib declared as LuaValue
- LuaValuePackageLib.java_loader - -
-          Loader that loads as a Java class.
- LuaValuePackageLib.lua_loader - -
-          Loader that loads as a lua script using the LUA_PATH
- LuaValuePackageLib.preload_loader - -
-          Loader that loads from preload table if found there
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Methods in org.luaj.vm2.lib that return LuaValue
- LuaValueOneArgFunction.call() - -
-           
- LuaValueThreeArgFunction.call() - -
-           
- LuaValueTwoArgFunction.call() - -
-           
- LuaValueVarArgFunction.call() - -
-           
-abstract  LuaValueZeroArgFunction.call() - -
-           
- LuaValueBaseLib.call(LuaValue arg) - -
-           
- LuaValueIoLib.call(LuaValue arg) - -
-           
- LuaValueMathLib.call(LuaValue arg) - -
-           
-abstract  LuaValueOneArgFunction.call(LuaValue arg) - -
-           
- LuaValuePackageLib.call(LuaValue arg) - -
-           
- LuaValueStringLib.call(LuaValue arg) - -
-           
- LuaValueTableLib.call(LuaValue arg) - -
-           
- LuaValueThreeArgFunction.call(LuaValue arg) - -
-           
- LuaValueTwoArgFunction.call(LuaValue arg) - -
-           
- LuaValueVarArgFunction.call(LuaValue arg) - -
-           
- LuaValueZeroArgFunction.call(LuaValue arg) - -
-           
- LuaValueOneArgFunction.call(LuaValue arg1, - LuaValue arg2) - -
-           
- LuaValueThreeArgFunction.call(LuaValue arg1, - LuaValue arg2) - -
-           
-abstract  LuaValueTwoArgFunction.call(LuaValue arg1, - LuaValue arg2) - -
-           
- LuaValueVarArgFunction.call(LuaValue arg1, - LuaValue arg2) - -
-           
- LuaValueZeroArgFunction.call(LuaValue arg1, - LuaValue arg2) - -
-           
- LuaValueOneArgFunction.call(LuaValue arg1, - LuaValue arg2, - LuaValue arg3) - -
-           
-abstract  LuaValueThreeArgFunction.call(LuaValue arg1, - LuaValue arg2, - LuaValue arg3) - -
-           
- LuaValueTwoArgFunction.call(LuaValue arg1, - LuaValue arg2, - LuaValue arg3) - -
-           
- LuaValueVarArgFunction.call(LuaValue arg1, - LuaValue arg2, - LuaValue arg3) - -
-           
- LuaValueZeroArgFunction.call(LuaValue arg1, - LuaValue arg2, - LuaValue arg3) - -
-           
-static LuaValueMathLib.dpow(double a, - double b) - -
-          compute power using installed math library, or default if there is no math library installed
-static LuaValueIoLib.freadall(IoLib.File f) - -
-           
-static LuaValueIoLib.freadbytes(IoLib.File f, - int count) - -
-           
-static LuaValueIoLib.freadline(IoLib.File f) - -
-           
-static LuaValueIoLib.freadnumber(IoLib.File f) - -
-           
-static LuaValueIoLib.freaduntil(IoLib.File f, - boolean lineonly) - -
-           
- LuaValueIoLib.File.get(LuaValue key) - -
-           
- LuaValueOsLib.init() - -
-           
-protected static LuaValue[]LibFunction.newupe() - -
-          Java code generation utility to allocate storage for upvalue, leave it empty
-protected static LuaValue[]LibFunction.newupl(LuaValue v) - -
-          Java code generation utility to allocate storage for upvalue, initialize with value
-protected static LuaValue[]LibFunction.newupn() - -
-          Java code generation utility to allocate storage for upvalue, initialize with nil
- LuaValuePackageLib.require(LuaValue arg) - -
-          require (modname) - - Loads the given module.
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Methods in org.luaj.vm2.lib with parameters of type LuaValue
- VarargsIoLib._file_close(LuaValue file) - -
-           
- VarargsIoLib._file_flush(LuaValue file) - -
-           
- VarargsIoLib._file_lines(LuaValue file) - -
-           
- VarargsIoLib._file_read(LuaValue file, - Varargs subargs) - -
-           
- VarargsIoLib._file_seek(LuaValue file, - java.lang.String whence, - int offset) - -
-           
- VarargsIoLib._file_setvbuf(LuaValue file, - java.lang.String mode, - int size) - -
-           
- VarargsIoLib._file_write(LuaValue file, - Varargs subargs) - -
-           
-protected static VarargsDebugLib._getinfo(Varargs args, - LuaValue level0func) - -
-           
- VarargsIoLib._io_close(LuaValue file) - -
-           
- VarargsIoLib._io_index(LuaValue v) - -
-           
- VarargsIoLib._io_input(LuaValue file) - -
-           
- VarargsIoLib._io_output(LuaValue filename) - -
-           
- VarargsIoLib._io_type(LuaValue obj) - -
-           
- VarargsIoLib._lines_iter(LuaValue file) - -
-           
-protected  voidLibFunction.bind(LuaValue env, - java.lang.Class factory, - java.lang.String[] names) - -
-          Bind a set of library functions.
-protected  voidLibFunction.bind(LuaValue env, - java.lang.Class factory, - java.lang.String[] names, - int firstopcode) - -
-          Bind a set of library functions, with an offset
- LuaValueBaseLib.call(LuaValue arg) - -
-           
- LuaValueIoLib.call(LuaValue arg) - -
-           
- LuaValueMathLib.call(LuaValue arg) - -
-           
-abstract  LuaValueOneArgFunction.call(LuaValue arg) - -
-           
- LuaValuePackageLib.call(LuaValue arg) - -
-           
- LuaValueStringLib.call(LuaValue arg) - -
-           
- LuaValueTableLib.call(LuaValue arg) - -
-           
- LuaValueThreeArgFunction.call(LuaValue arg) - -
-           
- LuaValueTwoArgFunction.call(LuaValue arg) - -
-           
- LuaValueVarArgFunction.call(LuaValue arg) - -
-           
- LuaValueZeroArgFunction.call(LuaValue arg) - -
-           
- LuaValueOneArgFunction.call(LuaValue arg1, - LuaValue arg2) - -
-           
- LuaValueThreeArgFunction.call(LuaValue arg1, - LuaValue arg2) - -
-           
-abstract  LuaValueTwoArgFunction.call(LuaValue arg1, - LuaValue arg2) - -
-           
- LuaValueVarArgFunction.call(LuaValue arg1, - LuaValue arg2) - -
-           
- LuaValueZeroArgFunction.call(LuaValue arg1, - LuaValue arg2) - -
-           
- LuaValueOneArgFunction.call(LuaValue arg1, - LuaValue arg2, - LuaValue arg3) - -
-           
-abstract  LuaValueThreeArgFunction.call(LuaValue arg1, - LuaValue arg2, - LuaValue arg3) - -
-           
- LuaValueTwoArgFunction.call(LuaValue arg1, - LuaValue arg2, - LuaValue arg3) - -
-           
- LuaValueVarArgFunction.call(LuaValue arg1, - LuaValue arg2, - LuaValue arg3) - -
-           
- LuaValueZeroArgFunction.call(LuaValue arg1, - LuaValue arg2, - LuaValue arg3) - -
-           
-static voidDebugLib.debugSetupCall(Varargs args, - LuaValue[] stack) - -
-          Called by Closures to set up stack and arguments to next call
- LuaValueIoLib.File.get(LuaValue key) - -
-           
-protected static LuaValue[]LibFunction.newupl(LuaValue v) - -
-          Java code generation utility to allocate storage for upvalue, initialize with value
-static VarargsBaseLib.pcall(LuaValue func, - Varargs args, - LuaValue errfunc) - -
-           
- LuaValuePackageLib.require(LuaValue arg) - -
-          require (modname) - - Loads the given module.
-  -

- - - - - - - - - - - - - - - - - - - - -
Constructors in org.luaj.vm2.lib with parameters of type LuaValue
OneArgFunction(LuaValue env) - -
-          Constructor with specific environment
ThreeArgFunction(LuaValue env) - -
-          Constructor with specific environment
TwoArgFunction(LuaValue env) - -
-          Constructor with specific environment
VarArgFunction(LuaValue env) - -
-           
ZeroArgFunction(LuaValue env) - -
-          Constructor with specific environment
-  -

- - - - - -
-Uses of LuaValue in org.luaj.vm2.lib.jme
-  -

- - - - - - - - - -
Subclasses of LuaValue in org.luaj.vm2.lib.jme
- classJmeIoLib - -
-          Subclass of IoLib and therefore LibFunction which implements the lua standard io - library for the JSE platform.
-  -

- - - - - -
-Uses of LuaValue in org.luaj.vm2.lib.jse
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Subclasses of LuaValue in org.luaj.vm2.lib.jse
- classJseBaseLib - -
-          Subclass of BaseLib and LibFunction which implements the lua basic library functions - and provides a directory based ResourceFinder as the BaseLib.FINDER.
- classJseIoLib - -
-          Subclass of IoLib and therefore LibFunction which implements the lua standard io - library for the JSE platform.
- classJseMathLib - -
-          Subclass of LibFunction which implements the lua standard math - library.
-static classJseMathLib.JseMathLib1 - -
-           
-static classJseMathLib.JseMathLib2 - -
-           
- classJseOsLib - -
-          Subclass of LibFunction which implements the standard lua os library.
- classLuajavaLib - -
-          Subclass of LibFunction which implements the features of the luajava package.
-  -

- - - - - - - - - - - - - - - - - - - - - -
Methods in org.luaj.vm2.lib.jse that return LuaValue
- LuaValueJseMathLib.call(LuaValue arg) - -
-           
- LuaValueJseMathLib.JseMathLib1.call(LuaValue arg) - -
-           
- LuaValueJseMathLib.JseMathLib2.call(LuaValue arg1, - LuaValue arg2) - -
-           
-static LuaValueCoerceJavaToLua.coerce(java.lang.Object o) - -
-          Coerse a Java object to a corresponding lua value.
-  -

- - - - - - - - - - - - - - - - - - - - - -
Methods in org.luaj.vm2.lib.jse with parameters of type LuaValue
- LuaValueJseMathLib.call(LuaValue arg) - -
-           
- LuaValueJseMathLib.JseMathLib1.call(LuaValue arg) - -
-           
- LuaValueJseMathLib.JseMathLib2.call(LuaValue arg1, - LuaValue arg2) - -
-           
-static java.lang.ObjectCoerceLuaToJava.coerce(LuaValue value, - java.lang.Class clazz) - -
-          Coerce a LuaValue value to a specified java class
-  -

- - - - - -
-Uses of LuaValue in org.luaj.vm2.luajc
-  -

- - - - - - - - - -
Methods in org.luaj.vm2.luajc with parameters of type LuaValue
- LuaFunctionLuaJC.load(java.io.InputStream stream, - java.lang.String name, - LuaValue env) - -
-           
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/OrphanedThread.html b/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/OrphanedThread.html deleted file mode 100644 index 5c88139d7..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/OrphanedThread.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.OrphanedThread (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.OrphanedThread

-
-No usage of org.luaj.vm2.OrphanedThread -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/Print.html b/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/Print.html deleted file mode 100644 index e3a2c9912..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/Print.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.Print (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.Print

-
-No usage of org.luaj.vm2.Print -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/Prototype.html b/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/Prototype.html deleted file mode 100644 index 4c88989f1..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/Prototype.html +++ /dev/null @@ -1,358 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.Prototype (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.Prototype

-
- - - - - - - - - - - - - - - - - -
-Packages that use Prototype
org.luaj.vm2  
org.luaj.vm2.compiler  
org.luaj.vm2.lib  
-  -

- - - - - -
-Uses of Prototype in org.luaj.vm2
-  -

- - - - - - - - - - - - - -
Fields in org.luaj.vm2 declared as Prototype
- PrototypeLuaClosure.p - -
-           
- Prototype[]Prototype.p - -
-           
-  -

- - - - - - - - - - - - - -
Methods in org.luaj.vm2 that return Prototype
-static PrototypeLoadState.loadBinaryChunk(int firstByte, - java.io.InputStream stream, - java.lang.String name) - -
-          Load lua thought to be a binary chunk from its first byte from an input stream.
- PrototypeLoadState.loadFunction(LuaString p) - -
-          Load a function prototype from the input stream
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - -
Methods in org.luaj.vm2 with parameters of type Prototype
-static voidPrint.print(Prototype p) - -
-           
-static voidPrint.printCode(Prototype f) - -
-          Print the code in a prototype
-static voidPrint.printFunction(Prototype f, - boolean full) - -
-           
-static voidPrint.printOpCode(java.io.PrintStream ps, - Prototype f, - int pc) - -
-          Print an opcode in a prototype
-static voidPrint.printOpCode(Prototype f, - int pc) - -
-          Print an opcode in a prototype
-  -

- - - - - - - - -
Constructors in org.luaj.vm2 with parameters of type Prototype
LuaClosure(Prototype p, - LuaValue env) - -
-          Supply the initial environment
-  -

- - - - - -
-Uses of Prototype in org.luaj.vm2.compiler
-  -

- - - - - - - - - -
Methods in org.luaj.vm2.compiler that return Prototype
-static PrototypeLuaC.compile(java.io.InputStream stream, - java.lang.String name) - -
-          Compile a prototype or load as a binary chunk
-  -

- - - - - - - - - -
Methods in org.luaj.vm2.compiler with parameters of type Prototype
- LuaFunctionLuaC.load(Prototype p, - java.lang.String filename, - LuaValue env) - -
-           
-  -

- - - - - -
-Uses of Prototype in org.luaj.vm2.lib
-  -

- - - - - - - - - -
Methods in org.luaj.vm2.lib with parameters of type Prototype
-static java.lang.StringDebugLib.sourceshort(Prototype p) - -
-           
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/TailcallVarargs.html b/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/TailcallVarargs.html deleted file mode 100644 index 7b29e0d33..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/TailcallVarargs.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.TailcallVarargs (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.TailcallVarargs

-
-No usage of org.luaj.vm2.TailcallVarargs -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/UpValue.html b/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/UpValue.html deleted file mode 100644 index c8da51796..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/UpValue.html +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.UpValue (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.UpValue

-
- - - - - - - - - -
-Packages that use UpValue
org.luaj.vm2  
-  -

- - - - - -
-Uses of UpValue in org.luaj.vm2
-  -

- - - - - - - - - -
Fields in org.luaj.vm2 declared as UpValue
- UpValue[]LuaClosure.upValues - -
-           
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/Varargs.html b/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/Varargs.html deleted file mode 100644 index a5ab9be46..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/Varargs.html +++ /dev/null @@ -1,1649 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.Varargs (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.Varargs

-
- - - - - - - - - - - - - - - - - - - - - -
-Packages that use Varargs
org.luaj.vm2  
org.luaj.vm2.lib  
org.luaj.vm2.lib.jme  
org.luaj.vm2.lib.jse  
-  -

- - - - - -
-Uses of Varargs in org.luaj.vm2
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Subclasses of Varargs in org.luaj.vm2
- classLuaBoolean - -
-          Extension of LuaValue which can hold a Java boolean as its value.
- classLuaClosure - -
-          Extension of LuaFunction which executes lua bytecode.
- classLuaDouble - -
-          Extension of LuaNumber which can hold a Java double as its value.
- classLuaFunction - -
-          Base class for functions implemented in Java.
- classLuaInteger - -
-          Extension of LuaNumber which can hold a Java int as its value.
- classLuaNil - -
-          Class to encapsulate behavior of the singleton instance nil
- classLuaNumber - -
-          Base class for representing numbers as lua values directly.
- classLuaString - -
-          Subclass of LuaValue for representing lua strings.
- classLuaTable - -
-          Subclass of LuaValue for representing lua tables.
- classLuaThread - -
-          Subclass of LuaValue that implements - a lua coroutine thread using Java Threads.
- classLuaUserdata - -
-           
- classLuaValue - -
-          Base class for all concrete lua type values.
- classTailcallVarargs - -
-          Subclass of Varargs that represents a lua tail call - in a Java library function execution environment.
- classWeakTable - -
-          Subclass of LuaTable that provides weak key and weak value semantics.
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Methods in org.luaj.vm2 that return Varargs
- VarargsTailcallVarargs.eval() - -
-           
- VarargsVarargs.eval() - -
-          Evaluate any pending tail call and return result.
-protected  VarargsLuaClosure.execute(LuaValue[] stack, - Varargs varargs) - -
-           
- VarargsLuaTable.inext(LuaValue key) - -
-          Get the next element after a particular key in the - contiguous array part of a table
- VarargsLuaValue.inext(LuaValue index) - -
-          Find the next integer-key,value pair if this is a table, - return NIL if there are no more, or throw a LuaError if not a table.
- VarargsLuaValue.invoke() - -
-          Call this with 0 arguments, including metatag processing, - and retain all return values in a Varargs.
- VarargsLuaValue.invoke(LuaValue[] args) - -
-          Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs.
- VarargsLuaValue.invoke(LuaValue[] args, - Varargs varargs) - -
-          Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs.
- VarargsLuaValue.invoke(LuaValue arg1, - LuaValue arg2, - Varargs varargs) - -
-          Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs.
- VarargsLuaValue.invoke(LuaValue arg, - Varargs varargs) - -
-          Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs.
- VarargsLuaClosure.invoke(Varargs varargs) - -
-           
- VarargsLuaValue.invoke(Varargs args) - -
-          Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs.
- VarargsLuaValue.invokemethod(LuaValue name) - -
-          Call named method on this with 0 arguments, including metatag processing, - and retain all return values in a Varargs.
- VarargsLuaValue.invokemethod(LuaValue name, - LuaValue[] args) - -
-          Call named method on this with variable arguments, including metatag processing, - and retain all return values in a Varargs.
- VarargsLuaValue.invokemethod(LuaValue name, - Varargs args) - -
-          Call named method on this with variable arguments, including metatag processing, - and retain all return values in a Varargs.
- VarargsLuaValue.invokemethod(java.lang.String name) - -
-          Call named method on this with 0 arguments, including metatag processing, - and retain all return values in a Varargs.
- VarargsLuaValue.invokemethod(java.lang.String name, - LuaValue[] args) - -
-          Call named method on this with 1 argument, including metatag processing, - and retain all return values in a Varargs.
- VarargsLuaValue.invokemethod(java.lang.String name, - Varargs args) - -
-          Call named method on this with 1 argument, including metatag processing, - and retain all return values in a Varargs.
- VarargsLuaTable.next(LuaValue key) - -
-          Get the next element after a particular key in the table
- VarargsLuaValue.next(LuaValue index) - -
-          Find the next key,value pair if this is a table, - return NIL if there are no more, or throw a LuaError if not a table.
- VarargsWeakTable.next(LuaValue key) - -
-          Get the next element after a particular key in the table
- VarargsLuaClosure.onInvoke(Varargs varargs) - -
-           
- VarargsLuaValue.onInvoke(Varargs args) - -
-          Callback used during tail call processing to invoke the function once.
- VarargsLuaThread.resume(Varargs args) - -
-          Start or resume this thread
- VarargsVarargs.subargs(int start) - -
-          Create a Varargs instance containing arguments starting at index start
-static VarargsLuaValue.tailcallOf(LuaValue func, - Varargs args) - -
-          Construct a TailcallVarargs around a function and arguments.
-static VarargsLuaValue.varargsOf(LuaValue[] v) - -
-          Construct a Varargs around an array of LuaValues.
-static VarargsLuaValue.varargsOf(LuaValue[] v, - int offset, - int length) - -
-          Construct a Varargs around an array of LuaValues.
-static VarargsLuaValue.varargsOf(LuaValue[] v, - int offset, - int length, - Varargs more) - -
-          Construct a Varargs around an array of LuaValues.
-static VarargsLuaValue.varargsOf(LuaValue[] v, - Varargs r) - -
-          Construct a Varargs around an array of LuaValues.
-static VarargsLuaValue.varargsOf(LuaValue v1, - LuaValue v2, - Varargs v3) - -
-          Construct a Varargs around a set of 3 or more LuaValues.
-static VarargsLuaValue.varargsOf(LuaValue v, - Varargs r) - -
-          Construct a Varargs around a set of 2 or more LuaValues.
-static VarargsLuaThread.yield(Varargs args) - -
-          Yield the current thread with arguments
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Methods in org.luaj.vm2 with parameters of type Varargs
-protected  VarargsLuaClosure.execute(LuaValue[] stack, - Varargs varargs) - -
-           
- VarargsLuaValue.invoke(LuaValue[] args, - Varargs varargs) - -
-          Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs.
- VarargsLuaValue.invoke(LuaValue arg1, - LuaValue arg2, - Varargs varargs) - -
-          Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs.
- VarargsLuaValue.invoke(LuaValue arg, - Varargs varargs) - -
-          Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs.
- VarargsLuaClosure.invoke(Varargs varargs) - -
-           
- VarargsLuaValue.invoke(Varargs args) - -
-          Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs.
- VarargsLuaValue.invokemethod(LuaValue name, - Varargs args) - -
-          Call named method on this with variable arguments, including metatag processing, - and retain all return values in a Varargs.
- VarargsLuaValue.invokemethod(java.lang.String name, - Varargs args) - -
-          Call named method on this with 1 argument, including metatag processing, - and retain all return values in a Varargs.
-static LuaTableLuaValue.listOf(LuaValue[] unnamedValues, - Varargs lastarg) - -
-          Construct a LuaTable initialized with supplied array values.
- VarargsLuaClosure.onInvoke(Varargs varargs) - -
-           
- VarargsLuaValue.onInvoke(Varargs args) - -
-          Callback used during tail call processing to invoke the function once.
-static voidPrint.printState(LuaClosure cl, - int pc, - LuaValue[] stack, - int top, - Varargs varargs) - -
-          Print the state of a LuaClosure that is being executed
- voidLuaValue.rawsetlist(int key0, - Varargs values) - -
-          Set list values in a table without invoking metatag processing
- VarargsLuaThread.resume(Varargs args) - -
-          Start or resume this thread
-static LuaTableLuaValue.tableOf(LuaValue[] namedValues, - LuaValue[] unnamedValues, - Varargs lastarg) - -
-          Construct a LuaTable initialized with supplied named values and sequential elements in an array part and as varargs.
-static LuaTableLuaValue.tableOf(Varargs varargs, - int firstarg) - -
-          Construct a LuaTable initialized with supplied array values.
-static VarargsLuaValue.tailcallOf(LuaValue func, - Varargs args) - -
-          Construct a TailcallVarargs around a function and arguments.
-static VarargsLuaValue.varargsOf(LuaValue[] v, - int offset, - int length, - Varargs more) - -
-          Construct a Varargs around an array of LuaValues.
-static VarargsLuaValue.varargsOf(LuaValue[] v, - Varargs r) - -
-          Construct a Varargs around an array of LuaValues.
-static VarargsLuaValue.varargsOf(LuaValue v1, - LuaValue v2, - Varargs v3) - -
-          Construct a Varargs around a set of 3 or more LuaValues.
-static VarargsLuaValue.varargsOf(LuaValue v, - Varargs r) - -
-          Construct a Varargs around a set of 2 or more LuaValues.
-static VarargsLuaThread.yield(Varargs args) - -
-          Yield the current thread with arguments
-  -

- - - - - - - - - - - - - - - - - - - - -
Constructors in org.luaj.vm2 with parameters of type Varargs
LuaTable(LuaValue[] named, - LuaValue[] unnamed, - Varargs lastarg) - -
-          Construct table with named and unnamed parts.
LuaTable(Varargs varargs) - -
-          Construct table of unnamed elements.
LuaTable(Varargs varargs, - int firstarg) - -
-          Construct table of unnamed elements.
TailcallVarargs(LuaValue object, - LuaValue methodname, - Varargs args) - -
-           
TailcallVarargs(LuaValue f, - Varargs args) - -
-           
-  -

- - - - - -
-Uses of Varargs in org.luaj.vm2.lib
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Subclasses of Varargs in org.luaj.vm2.lib
- classBaseLib - -
-          Subclass of LibFunction which implements the lua basic library functions.
- classCoroutineLib - -
-          Subclass of LibFunction which implements the lua standard coroutine - library.
- classDebugLib - -
-          Subclass of LibFunction which implements the lua standard debug - library.
- classIoLib - -
-          Abstract base class extending LibFunction which implements the - core of the lua standard io library.
-protected  classIoLib.File - -
-           
- classLibFunction - -
-          Subclass of LuaFunction common to Java functions exposed to lua.
- classMathLib - -
-          Subclass of LibFunction which implements the lua standard math - library.
- classOneArgFunction - -
-          Abstract base class for Java function implementations that take one argument and - return one value.
- classOsLib - -
-          Subclass of LibFunction which implements the standard lua os library.
- classPackageLib - -
-          Subclass of LibFunction which implements the lua standard package and module - library functions.
- classStringLib - -
-          Subclass of LibFunction which implements the lua standard string - library.
- classTableLib - -
-          Subclass of LibFunction which implements the lua standard table - library.
- classThreeArgFunction - -
-          Abstract base class for Java function implementations that take two arguments and - return one value.
- classTwoArgFunction - -
-          Abstract base class for Java function implementations that take two arguments and - return one value.
- classVarArgFunction - -
-          Abstract base class for Java function implementations that takes varaiable arguments and - returns multiple return values.
- classZeroArgFunction - -
-          Abstract base class for Java function implementations that take no arguments and - return one value.
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Methods in org.luaj.vm2.lib that return Varargs
- VarargsIoLib._file_close(LuaValue file) - -
-           
- VarargsIoLib._file_flush(LuaValue file) - -
-           
- VarargsIoLib._file_lines(LuaValue file) - -
-           
- VarargsIoLib._file_read(LuaValue file, - Varargs subargs) - -
-           
- VarargsIoLib._file_seek(LuaValue file, - java.lang.String whence, - int offset) - -
-           
- VarargsIoLib._file_setvbuf(LuaValue file, - java.lang.String mode, - int size) - -
-           
- VarargsIoLib._file_write(LuaValue file, - Varargs subargs) - -
-           
-protected static VarargsDebugLib._getinfo(Varargs args, - LuaValue level0func) - -
-           
- VarargsIoLib._io_close(LuaValue file) - -
-           
- VarargsIoLib._io_flush() - -
-           
- VarargsIoLib._io_index(LuaValue v) - -
-           
- VarargsIoLib._io_input(LuaValue file) - -
-           
- VarargsIoLib._io_lines(java.lang.String filename) - -
-           
- VarargsIoLib._io_open(java.lang.String filename, - java.lang.String mode) - -
-           
- VarargsIoLib._io_output(LuaValue filename) - -
-           
- VarargsIoLib._io_popen(java.lang.String prog, - java.lang.String mode) - -
-           
- VarargsIoLib._io_read(Varargs args) - -
-           
- VarargsIoLib._io_tmpfile() - -
-           
- VarargsIoLib._io_type(LuaValue obj) - -
-           
- VarargsIoLib._io_write(Varargs args) - -
-           
- VarargsIoLib._lines_iter(LuaValue file) - -
-           
-static VarargsStringLib.char_(Varargs args) - -
-          string.char (...) - - Receives zero or more integers.
- VarargsCoroutineLib.invoke(Varargs args) - -
-           
- VarargsDebugLib.invoke(Varargs args) - -
-           
- VarargsOneArgFunction.invoke(Varargs varargs) - -
-           
- VarargsOsLib.invoke(Varargs args) - -
-           
- VarargsThreeArgFunction.invoke(Varargs varargs) - -
-           
- VarargsTwoArgFunction.invoke(Varargs varargs) - -
-           
- VarargsVarArgFunction.invoke(Varargs args) - -
-          Override and implement for the best performance.
- VarargsZeroArgFunction.invoke(Varargs varargs) - -
-           
-static VarargsBaseLib.loadFile(java.lang.String filename) - -
-          Load from a named file, returning the chunk or nil,error of can't load
-static VarargsPackageLib.loadlib(Varargs args) - -
-           
-static VarargsBaseLib.loadStream(java.io.InputStream is, - java.lang.String chunkname) - -
-           
- VarargsPackageLib.module(Varargs args) - -
-          module (name [, ...]) - - Creates a module.
- VarargsVarArgFunction.onInvoke(Varargs args) - -
-          Override to provide a call implementation that runs in an environment - that can participate in setfenv, and behaves as expected - when returning TailcallVarargs.
-static VarargsBaseLib.pcall(LuaValue func, - Varargs args, - LuaValue errfunc) - -
-           
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Methods in org.luaj.vm2.lib with parameters of type Varargs
- VarargsIoLib._file_read(LuaValue file, - Varargs subargs) - -
-           
- VarargsIoLib._file_write(LuaValue file, - Varargs subargs) - -
-           
-protected static VarargsDebugLib._getinfo(Varargs args, - LuaValue level0func) - -
-           
- VarargsIoLib._io_read(Varargs args) - -
-           
- VarargsIoLib._io_write(Varargs args) - -
-           
-static VarargsStringLib.char_(Varargs args) - -
-          string.char (...) - - Receives zero or more integers.
-static voidDebugLib.debugBytecode(int pc, - Varargs extras, - int top) - -
-          Called by Closures on bytecode execution
-static voidDebugLib.debugSetupCall(Varargs args, - LuaValue[] stack) - -
-          Called by Closures to set up stack and arguments to next call
- VarargsCoroutineLib.invoke(Varargs args) - -
-           
- VarargsDebugLib.invoke(Varargs args) - -
-           
- VarargsOneArgFunction.invoke(Varargs varargs) - -
-           
- VarargsOsLib.invoke(Varargs args) - -
-           
- VarargsThreeArgFunction.invoke(Varargs varargs) - -
-           
- VarargsTwoArgFunction.invoke(Varargs varargs) - -
-           
- VarargsVarArgFunction.invoke(Varargs args) - -
-          Override and implement for the best performance.
- VarargsZeroArgFunction.invoke(Varargs varargs) - -
-           
-static VarargsPackageLib.loadlib(Varargs args) - -
-           
- VarargsPackageLib.module(Varargs args) - -
-          module (name [, ...]) - - Creates a module.
- VarargsVarArgFunction.onInvoke(Varargs args) - -
-          Override to provide a call implementation that runs in an environment - that can participate in setfenv, and behaves as expected - when returning TailcallVarargs.
-static VarargsBaseLib.pcall(LuaValue func, - Varargs args, - LuaValue errfunc) - -
-           
-  -

- - - - - -
-Uses of Varargs in org.luaj.vm2.lib.jme
-  -

- - - - - - - - - -
Subclasses of Varargs in org.luaj.vm2.lib.jme
- classJmeIoLib - -
-          Subclass of IoLib and therefore LibFunction which implements the lua standard io - library for the JSE platform.
-  -

- - - - - -
-Uses of Varargs in org.luaj.vm2.lib.jse
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Subclasses of Varargs in org.luaj.vm2.lib.jse
- classJseBaseLib - -
-          Subclass of BaseLib and LibFunction which implements the lua basic library functions - and provides a directory based ResourceFinder as the BaseLib.FINDER.
- classJseIoLib - -
-          Subclass of IoLib and therefore LibFunction which implements the lua standard io - library for the JSE platform.
- classJseMathLib - -
-          Subclass of LibFunction which implements the lua standard math - library.
-static classJseMathLib.JseMathLib1 - -
-           
-static classJseMathLib.JseMathLib2 - -
-           
- classJseOsLib - -
-          Subclass of LibFunction which implements the standard lua os library.
- classLuajavaLib - -
-          Subclass of LibFunction which implements the features of the luajava package.
-  -

- - - - - - - - - -
Methods in org.luaj.vm2.lib.jse that return Varargs
- VarargsLuajavaLib.invoke(Varargs args) - -
-           
-  -

- - - - - - - - - -
Methods in org.luaj.vm2.lib.jse with parameters of type Varargs
- VarargsLuajavaLib.invoke(Varargs args) - -
-           
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/WeakTable.html b/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/WeakTable.html deleted file mode 100644 index 5dc193e8f..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/class-use/WeakTable.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.WeakTable (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.WeakTable

-
-No usage of org.luaj.vm2.WeakTable -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/compiler/LuaC.html b/luaj-2.0.3/docs/api/org/luaj/vm2/compiler/LuaC.html deleted file mode 100644 index ecf32c883..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/compiler/LuaC.html +++ /dev/null @@ -1,543 +0,0 @@ - - - - - - -LuaC (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2.compiler -
-Class LuaC

-
-java.lang.Object
-  extended by org.luaj.vm2.Lua
-      extended by org.luaj.vm2.compiler.LuaC
-
-
-
All Implemented Interfaces:
LoadState.LuaCompiler
-
-
-
-
public class LuaC
extends Lua
implements LoadState.LuaCompiler
- - -

-Compiler for Lua. -

- Compiles lua source files into lua bytecode within a Prototype, - loads lua binary files directly into aPrototype, - and optionaly instantiates a LuaClosure around the result - using a user-supplied environment. -

- Implements the LoadState.LuaCompiler interface for loading - initialized chunks, which is an interface common to - lua bytecode compiling and java bytecode compiling. -

- Teh LuaC compiler is installed by default by both the - JsePlatform and JmePlatform classes, - so in the following example, the default LuaC compiler - will be used: -

 LuaValue _G = JsePlatform.standardGlobals();
- LoadState.load( new ByteArrayInputStream("print 'hello'".getBytes()), "main.lua", _G ).call();
-  
-

- -

-

-
See Also:
LoadState.LuaCompiler, -LuaJC, -JsePlatform, -JmePlatform, -BaseLib, -LuaValue, -LoadState.LuaCompiler, -Prototype
-
- -

- - - - - - - - - - - - - - - - - - - -
-Field Summary
-static LuaCinstance - -
-           
-static intMAXSTACK - -
-           
- intnCcalls - -
-           
- - - - - - - -
Fields inherited from class org.luaj.vm2.Lua
_VERSION, BITRK, LFIELDS_PER_FLUSH, LUA_MULTRET, luaP_opmodes, MASK_A, MASK_B, MASK_Bx, MASK_C, MASK_NOT_A, MASK_NOT_B, MASK_NOT_Bx, MASK_NOT_C, MASK_NOT_OP, MASK_OP, MAX_OP, MAXARG_A, MAXARG_B, MAXARG_Bx, MAXARG_C, MAXARG_sBx, MAXINDEXRK, NUM_OPCODES, OP_ADD, OP_AND, OP_CALL, OP_CLOSE, OP_CLOSURE, OP_CONCAT, OP_DIV, OP_EQ, OP_FORLOOP, OP_FORPREP, OP_GE, OP_GETGLOBAL, OP_GETTABLE, OP_GETUPVAL, OP_GT, OP_JMP, OP_LE, OP_LEN, OP_LOADBOOL, OP_LOADK, OP_LOADNIL, OP_LT, OP_MOD, OP_MOVE, OP_MUL, OP_NEQ, OP_NEWTABLE, OP_NOT, OP_OR, OP_POW, OP_RETURN, OP_SELF, OP_SETGLOBAL, OP_SETLIST, OP_SETTABLE, OP_SETUPVAL, OP_SUB, OP_TAILCALL, OP_TEST, OP_TESTSET, OP_TFORLOOP, OP_UNM, OP_VARARG, POS_A, POS_B, POS_Bx, POS_C, POS_OP, SIZE_A, SIZE_B, SIZE_Bx, SIZE_C, SIZE_OP, VARARG_HASARG, VARARG_ISVARARG, VARARG_NEEDSARG
-  - - - - - - - - - - - -
-Constructor Summary
-protected LuaC() - -
-           
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
-protected static void_assert(boolean b) - -
-           
-static Prototypecompile(java.io.InputStream stream, - java.lang.String name) - -
-          Compile a prototype or load as a binary chunk
-static voidinstall() - -
-          Install the compiler so that LoadState will first - try to use it when handed bytes that are - not already a compiled lua chunk.
- LuaFunctionload(java.io.InputStream stream, - java.lang.String name, - LuaValue env) - -
-          Load into a Closure or LuaFunction, with the supplied initial environment
- LuaFunctionload(Prototype p, - java.lang.String filename, - LuaValue env) - -
-           
- LuaStringnewTString(byte[] bytes, - int offset, - int len) - -
-           
- java.lang.Stringpushfstring(java.lang.String string) - -
-           
- - - - - - - -
Methods inherited from class org.luaj.vm2.Lua
GET_OPCODE, GETARG_A, GETARG_B, GETARG_Bx, GETARG_C, GETARG_sBx, getBMode, getCMode, getOpMode, INDEXK, ISK, RKASK, testAMode, testTMode
- - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-  -

- - - - - - - - -
-Field Detail
- -

-instance

-
-public static final LuaC instance
-
-
-
-
-
- -

-MAXSTACK

-
-public static final int MAXSTACK
-
-
-
See Also:
Constant Field Values
-
-
- -

-nCcalls

-
-public int nCcalls
-
-
-
-
- - - - - - - - -
-Constructor Detail
- -

-LuaC

-
-protected LuaC()
-
-
- - - - - - - - -
-Method Detail
- -

-install

-
-public static void install()
-
-
Install the compiler so that LoadState will first - try to use it when handed bytes that are - not already a compiled lua chunk. -

-

-
-
-
-
-
-
-
- -

-_assert

-
-protected static void _assert(boolean b)
-
-
-
-
-
-
-
-
-
- -

-load

-
-public LuaFunction load(java.io.InputStream stream,
-                        java.lang.String name,
-                        LuaValue env)
-                 throws java.io.IOException
-
-
Load into a Closure or LuaFunction, with the supplied initial environment -

-

-
Specified by:
load in interface LoadState.LuaCompiler
-
-
- -
Throws: -
java.io.IOException
-
-
-
- -

-compile

-
-public static Prototype compile(java.io.InputStream stream,
-                                java.lang.String name)
-                         throws java.io.IOException
-
-
Compile a prototype or load as a binary chunk -

-

-
-
-
- -
Throws: -
java.io.IOException
-
-
-
- -

-newTString

-
-public LuaString newTString(byte[] bytes,
-                            int offset,
-                            int len)
-
-
-
-
-
-
-
-
-
- -

-pushfstring

-
-public java.lang.String pushfstring(java.lang.String string)
-
-
-
-
-
-
-
-
-
- -

-load

-
-public LuaFunction load(Prototype p,
-                        java.lang.String filename,
-                        LuaValue env)
-
-
-
-
-
-
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/compiler/class-use/LuaC.html b/luaj-2.0.3/docs/api/org/luaj/vm2/compiler/class-use/LuaC.html deleted file mode 100644 index 7244b9c3f..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/compiler/class-use/LuaC.html +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.compiler.LuaC (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.compiler.LuaC

-
- - - - - - - - - -
-Packages that use LuaC
org.luaj.vm2.compiler  
-  -

- - - - - -
-Uses of LuaC in org.luaj.vm2.compiler
-  -

- - - - - - - - - -
Fields in org.luaj.vm2.compiler declared as LuaC
-static LuaCLuaC.instance - -
-           
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/compiler/package-frame.html b/luaj-2.0.3/docs/api/org/luaj/vm2/compiler/package-frame.html deleted file mode 100644 index 9ac829329..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/compiler/package-frame.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - -org.luaj.vm2.compiler (Luaj API) - - - - - - - - - - - -org.luaj.vm2.compiler - - - - -
-Classes  - -
-LuaC
- - - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/compiler/package-summary.html b/luaj-2.0.3/docs/api/org/luaj/vm2/compiler/package-summary.html deleted file mode 100644 index 4780abec0..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/compiler/package-summary.html +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - -org.luaj.vm2.compiler (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-

-Package org.luaj.vm2.compiler -

- - - - - - - - - -
-Class Summary
LuaCCompiler for Lua.
-  - -

-

-
-
- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/compiler/package-tree.html b/luaj-2.0.3/docs/api/org/luaj/vm2/compiler/package-tree.html deleted file mode 100644 index 83df8f8db..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/compiler/package-tree.html +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - -org.luaj.vm2.compiler Class Hierarchy (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Hierarchy For Package org.luaj.vm2.compiler -

-
-
-
Package Hierarchies:
All Packages
-
-

-Class Hierarchy -

- -
- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/compiler/package-use.html b/luaj-2.0.3/docs/api/org/luaj/vm2/compiler/package-use.html deleted file mode 100644 index 1f26caffd..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/compiler/package-use.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - -Uses of Package org.luaj.vm2.compiler (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Package
org.luaj.vm2.compiler

-
- - - - - - - - - -
-Packages that use org.luaj.vm2.compiler
org.luaj.vm2.compiler  
-  -

- - - - - - - - -
-Classes in org.luaj.vm2.compiler used by org.luaj.vm2.compiler
LuaC - -
-          Compiler for Lua.
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/BaseLib.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/BaseLib.html deleted file mode 100644 index 98cf73c2a..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/BaseLib.html +++ /dev/null @@ -1,615 +0,0 @@ - - - - - - -BaseLib (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2.lib -
-Class BaseLib

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.LuaFunction
-              extended by org.luaj.vm2.lib.LibFunction
-                  extended by org.luaj.vm2.lib.OneArgFunction
-                      extended by org.luaj.vm2.lib.BaseLib
-
-
-
All Implemented Interfaces:
ResourceFinder
-
-
-
Direct Known Subclasses:
JseBaseLib
-
-
-
-
public class BaseLib
extends OneArgFunction
implements ResourceFinder
- - -

-Subclass of LibFunction which implements the lua basic library functions. -

- This contains all library functions listed as "basic functions" in the lua documentation for JME. - The functions dofile and loadfile use the - FINDER instance to find resource files. - Since JME has no file system by default, BaseLib implements - ResourceFinder using Class.getResource(String), - which is the closest equivalent on JME. - The default loader chain in PackageLib will use these as well. -

- To use basic library functions that include a ResourceFinder based on - directory lookup, use JseBaseLib instead. -

- Typically, this library is included as part of a call to either - JmePlatform#standardGlobals() -

- To instantiate and use it directly, - link it into your globals table via LuaValue.load(LuaValue) using code such as: -

 LuaTable _G = new LuaTable();
- LuaThread.setGlobals(_G);
- _G.load(new BaseLib());
- _G.get("print").call(LuaValue.valueOf("hello, world"));
-  
- Doing so will ensure the library is properly initialized - and loaded into the globals table. -

- This is a direct port of the corresponding library in C. -

- -

-

-
See Also:
JseBaseLib, -ResourceFinder, -FINDER, -LibFunction, -JsePlatform, -JmePlatform, -http://www.lua.org/manual/5.1/manual.html#5.1
-
- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Field Summary
-static ResourceFinderFINDER - -
-          Singleton file opener for this Java ClassLoader realm.
-static BaseLibinstance - -
-           
- java.io.PrintStreamSTDERR - -
-           
- java.io.InputStreamSTDIN - -
-           
- java.io.PrintStreamSTDOUT - -
-           
- - - - - - - -
Fields inherited from class org.luaj.vm2.lib.LibFunction
name, opcode
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaFunction
env, s_metatable
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - -
-Constructor Summary
BaseLib() - -
-          Construct a base libarary instance.
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
- LuaValuecall(LuaValue arg) - -
-          Call this with 1 argument, including metatag processing, - and return only the first return value.
- java.io.InputStreamfindResource(java.lang.String filename) - -
-          ResourceFinder implementation - - Tries to open the file as a resource, which can work for .
-static VarargsloadFile(java.lang.String filename) - -
-          Load from a named file, returning the chunk or nil,error of can't load
-static VarargsloadStream(java.io.InputStream is, - java.lang.String chunkname) - -
-           
-static Varargspcall(LuaValue func, - Varargs args, - LuaValue errfunc) - -
-           
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.OneArgFunction
call, call, call, invoke
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.LibFunction
bind, bind, newupe, newupl, newupn, tojstring
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaFunction
checkfunction, getfenv, getmetatable, isfunction, optfunction, setfenv, type, typename
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
add, add, add, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, callmt, checkboolean, checkclosure, checkdouble, checkint, checkinteger, checkjstring, checklong, checkmetatag, checknotnil, checknumber, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalidkey, compareerror, compareerror, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, div, div, div, divInto, eq_b, eq, eqmtcall, equals, error, get, get, get, getn, gettable, gt_b, gt_b, gt_b, gt, gt, gt, gteq_b, gteq_b, gteq_b, gteq, gteq, gteq, illegal, inext, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isint, isinttype, islong, isnil, isnumber, isstring, istable, isthread, isuserdata, isuserdata, isweaknil, len, lenerror, length, listOf, listOf, load, lt_b, lt_b, lt_b, lt, lt, lt, lteq_b, lteq_b, lteq_b, lteq, lteq, lteq, metatag, method, method, method, method, method, method, mod, mod, mod, modFrom, mul, mul, mul, narg, neg, neq_b, neq, next, not, onInvoke, optboolean, optclosure, optdouble, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, or, pow, pow, pow, powWith, powWith, presize, raweq, raweq, raweq, raweq, raweq, rawget, rawget, rawget, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setmetatable, settable, strcmp, strcmp, strongkey, strongvalue, strvalue, sub, sub, sub, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, tobyte, tochar, todouble, tofloat, toint, tolong, tonumber, toshort, tostring, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Field Detail
- -

-instance

-
-public static BaseLib instance
-
-
-
-
-
- -

-STDIN

-
-public java.io.InputStream STDIN
-
-
-
-
-
- -

-STDOUT

-
-public java.io.PrintStream STDOUT
-
-
-
-
-
- -

-STDERR

-
-public java.io.PrintStream STDERR
-
-
-
-
-
- -

-FINDER

-
-public static ResourceFinder FINDER
-
-
Singleton file opener for this Java ClassLoader realm. - - Unless set or changed elsewhere, will be set by the BaseLib that is created. -

-

-
-
- - - - - - - - -
-Constructor Detail
- -

-BaseLib

-
-public BaseLib()
-
-
Construct a base libarary instance. -

-

- - - - - - - - -
-Method Detail
- -

-call

-
-public LuaValue call(LuaValue arg)
-
-
Description copied from class: LuaValue
-
Call this with 1 argument, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use LuaValue.invoke() instead. -

- To call this as a method call, use LuaValue.method(LuaValue) instead. -

-

-
Specified by:
call in class OneArgFunction
-
-
-
Parameters:
arg - First argument to supply to the called function -
Returns:
First return value (this(arg)), or NIL if there were none.
See Also:
LuaValue.call(), -LuaValue.call(LuaValue,LuaValue), -LuaValue.call(LuaValue, LuaValue, LuaValue), -#invoke(LuaValue), -LuaValue.method(String,LuaValue), -LuaValue.method(LuaValue,LuaValue)
-
-
-
- -

-findResource

-
-public java.io.InputStream findResource(java.lang.String filename)
-
-
ResourceFinder implementation - - Tries to open the file as a resource, which can work for . -

-

-
Specified by:
findResource in interface ResourceFinder
-
-
- -
Returns:
InputStream, or null if not found.
See Also:
BaseLib, -JseBaseLib
-
-
-
- -

-pcall

-
-public static Varargs pcall(LuaValue func,
-                            Varargs args,
-                            LuaValue errfunc)
-
-
-
-
-
-
-
-
-
- -

-loadFile

-
-public static Varargs loadFile(java.lang.String filename)
-
-
Load from a named file, returning the chunk or nil,error of can't load -

-

-
-
-
- -
Returns:
Varargs containing chunk, or NIL,error-text on error
-
-
-
- -

-loadStream

-
-public static Varargs loadStream(java.io.InputStream is,
-                                 java.lang.String chunkname)
-
-
-
-
-
-
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/CoroutineLib.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/CoroutineLib.html deleted file mode 100644 index c3cd6f473..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/CoroutineLib.html +++ /dev/null @@ -1,383 +0,0 @@ - - - - - - -CoroutineLib (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2.lib -
-Class CoroutineLib

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.LuaFunction
-              extended by org.luaj.vm2.lib.LibFunction
-                  extended by org.luaj.vm2.lib.VarArgFunction
-                      extended by org.luaj.vm2.lib.CoroutineLib
-
-
-
-
public class CoroutineLib
extends VarArgFunction
- - -

-Subclass of LibFunction which implements the lua standard coroutine - library. -

- The coroutine library in luaj has the same behavior as the - coroutine library in C, but is implemented using Java Threads to maintain - the call state between invocations. Therefore it can be yielded from anywhere, - similar to the "Coco" yield-from-anywhere patch available for C-based lua. - However, coroutines that are yielded but never resumed to complete their execution - may not be collected by the garbage collector. -

- Typically, this library is included as part of a call to either - JsePlatform#standardGlobals() or JmePlatform#standardGlobals() -

- To instantiate and use it directly, - link it into your globals table via LuaValue.load(LuaValue) using code such as: -

 LuaTable _G = new LuaTable();
- _G.load(new CoroutineLib());
-  
- Doing so will ensure the library is properly initialized - and loaded into the globals table. -

-

- -

-

-
See Also:
LibFunction, -JsePlatform, -JmePlatform, -http://www.lua.org/manual/5.1/manual.html#5.2
-
- -

- - - - - - - -
-Field Summary
- - - - - - - -
Fields inherited from class org.luaj.vm2.lib.LibFunction
name, opcode
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaFunction
env, s_metatable
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - -
-Constructor Summary
CoroutineLib() - -
-           
-  - - - - - - - - - - - -
-Method Summary
- Varargsinvoke(Varargs args) - -
-          Override and implement for the best performance.
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.VarArgFunction
call, call, call, call, onInvoke
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.LibFunction
bind, bind, newupe, newupl, newupn, tojstring
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaFunction
checkfunction, getfenv, getmetatable, isfunction, optfunction, setfenv, type, typename
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
add, add, add, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, callmt, checkboolean, checkclosure, checkdouble, checkint, checkinteger, checkjstring, checklong, checkmetatag, checknotnil, checknumber, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalidkey, compareerror, compareerror, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, div, div, div, divInto, eq_b, eq, eqmtcall, equals, error, get, get, get, getn, gettable, gt_b, gt_b, gt_b, gt, gt, gt, gteq_b, gteq_b, gteq_b, gteq, gteq, gteq, illegal, inext, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isint, isinttype, islong, isnil, isnumber, isstring, istable, isthread, isuserdata, isuserdata, isweaknil, len, lenerror, length, listOf, listOf, load, lt_b, lt_b, lt_b, lt, lt, lt, lteq_b, lteq_b, lteq_b, lteq, lteq, lteq, metatag, method, method, method, method, method, method, mod, mod, mod, modFrom, mul, mul, mul, narg, neg, neq_b, neq, next, not, optboolean, optclosure, optdouble, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, or, pow, pow, pow, powWith, powWith, presize, raweq, raweq, raweq, raweq, raweq, rawget, rawget, rawget, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setmetatable, settable, strcmp, strcmp, strongkey, strongvalue, strvalue, sub, sub, sub, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, tobyte, tochar, todouble, tofloat, toint, tolong, tonumber, toshort, tostring, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Constructor Detail
- -

-CoroutineLib

-
-public CoroutineLib()
-
-
- - - - - - - - -
-Method Detail
- -

-invoke

-
-public Varargs invoke(Varargs args)
-
-
Description copied from class: VarArgFunction
-
Override and implement for the best performance. - May not have expected behavior for tail calls. - Should not be used if either: - - function needs to be used as a module - - function has a possibility of returning a TailcallVarargs -

-

-
Overrides:
invoke in class VarArgFunction
-
-
-
Parameters:
args - the arguments to the function call. -
Returns:
All return values as a Varargs instance.
See Also:
LuaValue.varargsOf(LuaValue[]), -LuaValue.call(LuaValue), -LuaValue.invoke(), -LuaValue.invoke(LuaValue,Varargs), -LuaValue.invokemethod(String,Varargs), -LuaValue.invokemethod(LuaValue,Varargs)
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/DebugLib.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/DebugLib.html deleted file mode 100644 index 7860d1c50..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/DebugLib.html +++ /dev/null @@ -1,672 +0,0 @@ - - - - - - -DebugLib (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2.lib -
-Class DebugLib

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.LuaFunction
-              extended by org.luaj.vm2.lib.LibFunction
-                  extended by org.luaj.vm2.lib.VarArgFunction
-                      extended by org.luaj.vm2.lib.DebugLib
-
-
-
-
public class DebugLib
extends VarArgFunction
- - -

-Subclass of LibFunction which implements the lua standard debug - library. -

- The debug library in luaj tries to emulate the behavior of the corresponding C-based lua library. - To do this, it must maintain a separate stack of calls to LuaClosure and LibFunction - instances. - Especially when lua-to-java bytecode compiling is being used - via a LuaCompiler such as LuaJC, - this cannot be done in all cases. -

- Typically, this library is included as part of a call to either - JsePlatform#debugGlobals() or JmePlatform#debugGlobals() -

- To instantiate and use it directly, - link it into your globals table via LuaValue.load(LuaValue) using code such as: -

 LuaTable _G = new LuaTable();
- _G.load(new DebugLib());
-  
- Doing so will ensure the library is properly initialized - and loaded into the globals table. -

-

- -

-

-
See Also:
LibFunction, -JsePlatform, -JmePlatform, -http://www.lua.org/manual/5.1/manual.html#5.9
-
- -

- - - - - - - - - - - - - - - - - - - -
-Field Summary
-static booleanCALLS - -
-           
-static booleanDEBUG_ENABLED - -
-           
-static booleanTRACE - -
-           
- - - - - - - -
Fields inherited from class org.luaj.vm2.lib.LibFunction
name, opcode
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaFunction
env, s_metatable
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - -
-Constructor Summary
DebugLib() - -
-           
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
-protected static Varargs_getinfo(Varargs args, - LuaValue level0func) - -
-           
-static voiddebugBytecode(int pc, - Varargs extras, - int top) - -
-          Called by Closures on bytecode execution
-static voiddebugOnCall(LuaThread thread, - int calls, - LuaFunction func) - -
-          Called by Closures and recursing java functions on entry
-static voiddebugOnReturn(LuaThread thread, - int calls) - -
-          Called by Closures and recursing java functions on return
-static voiddebugSetupCall(Varargs args, - LuaValue[] stack) - -
-          Called by Closures to set up stack and arguments to next call
-static java.lang.Stringfileline() - -
-          Get file and line for the nearest calling closure.
-static java.lang.Stringfileline(int level) - -
-          Get file and line for a particular level, even if it is a java function.
- Varargsinvoke(Varargs args) - -
-          Override and implement for the best performance.
-static java.lang.Stringsourceshort(Prototype p) - -
-           
-static java.lang.Stringtraceback(int level) - -
-          Get a traceback as a string for the current thread
-static java.lang.Stringtraceback(LuaThread thread, - int level) - -
-          Get a traceback for a particular thread.
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.VarArgFunction
call, call, call, call, onInvoke
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.LibFunction
bind, bind, newupe, newupl, newupn, tojstring
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaFunction
checkfunction, getfenv, getmetatable, isfunction, optfunction, setfenv, type, typename
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
add, add, add, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, callmt, checkboolean, checkclosure, checkdouble, checkint, checkinteger, checkjstring, checklong, checkmetatag, checknotnil, checknumber, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalidkey, compareerror, compareerror, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, div, div, div, divInto, eq_b, eq, eqmtcall, equals, error, get, get, get, getn, gettable, gt_b, gt_b, gt_b, gt, gt, gt, gteq_b, gteq_b, gteq_b, gteq, gteq, gteq, illegal, inext, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isint, isinttype, islong, isnil, isnumber, isstring, istable, isthread, isuserdata, isuserdata, isweaknil, len, lenerror, length, listOf, listOf, load, lt_b, lt_b, lt_b, lt, lt, lt, lteq_b, lteq_b, lteq_b, lteq, lteq, lteq, metatag, method, method, method, method, method, method, mod, mod, mod, modFrom, mul, mul, mul, narg, neg, neq_b, neq, next, not, optboolean, optclosure, optdouble, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, or, pow, pow, pow, powWith, powWith, presize, raweq, raweq, raweq, raweq, raweq, rawget, rawget, rawget, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setmetatable, settable, strcmp, strcmp, strongkey, strongvalue, strvalue, sub, sub, sub, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, tobyte, tochar, todouble, tofloat, toint, tolong, tonumber, toshort, tostring, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Field Detail
- -

-CALLS

-
-public static final boolean CALLS
-
-
-
-
-
- -

-TRACE

-
-public static final boolean TRACE
-
-
-
-
-
- -

-DEBUG_ENABLED

-
-public static boolean DEBUG_ENABLED
-
-
-
-
- - - - - - - - -
-Constructor Detail
- -

-DebugLib

-
-public DebugLib()
-
-
- - - - - - - - -
-Method Detail
- -

-invoke

-
-public Varargs invoke(Varargs args)
-
-
Description copied from class: VarArgFunction
-
Override and implement for the best performance. - May not have expected behavior for tail calls. - Should not be used if either: - - function needs to be used as a module - - function has a possibility of returning a TailcallVarargs -

-

-
Overrides:
invoke in class VarArgFunction
-
-
-
Parameters:
args - the arguments to the function call. -
Returns:
All return values as a Varargs instance.
See Also:
LuaValue.varargsOf(LuaValue[]), -LuaValue.call(LuaValue), -LuaValue.invoke(), -LuaValue.invoke(LuaValue,Varargs), -LuaValue.invokemethod(String,Varargs), -LuaValue.invokemethod(LuaValue,Varargs)
-
-
-
- -

-debugSetupCall

-
-public static void debugSetupCall(Varargs args,
-                                  LuaValue[] stack)
-
-
Called by Closures to set up stack and arguments to next call -

-

-
-
-
-
- -

-debugOnCall

-
-public static void debugOnCall(LuaThread thread,
-                               int calls,
-                               LuaFunction func)
-
-
Called by Closures and recursing java functions on entry -

-

-
Parameters:
thread - the thread for the call
calls - the number of calls in the call stack
func - the function called
-
-
-
- -

-debugOnReturn

-
-public static void debugOnReturn(LuaThread thread,
-                                 int calls)
-
-
Called by Closures and recursing java functions on return -

-

-
Parameters:
thread - the thread for the call
calls - the number of calls in the call stack
-
-
-
- -

-debugBytecode

-
-public static void debugBytecode(int pc,
-                                 Varargs extras,
-                                 int top)
-
-
Called by Closures on bytecode execution -

-

-
-
-
-
- -

-_getinfo

-
-protected static Varargs _getinfo(Varargs args,
-                                  LuaValue level0func)
-
-
-
-
-
-
- -

-sourceshort

-
-public static java.lang.String sourceshort(Prototype p)
-
-
-
-
-
-
- -

-traceback

-
-public static java.lang.String traceback(int level)
-
-
Get a traceback as a string for the current thread -

-

-
-
-
-
- -

-traceback

-
-public static java.lang.String traceback(LuaThread thread,
-                                         int level)
-
-
Get a traceback for a particular thread. -

-

-
Parameters:
thread - LuaThread to provide stack trace for
level - 0-based level to start reporting on -
Returns:
String containing the stack trace.
-
-
-
- -

-fileline

-
-public static java.lang.String fileline()
-
-
Get file and line for the nearest calling closure. -

-

- -
Returns:
String identifying the file and line of the nearest lua closure, - or the function name of the Java call if no closure is being called.
-
-
-
- -

-fileline

-
-public static java.lang.String fileline(int level)
-
-
Get file and line for a particular level, even if it is a java function. -

-

-
Parameters:
level - 0-based index of level to get -
Returns:
String containing file and line info if available
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/IoLib.File.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/IoLib.File.html deleted file mode 100644 index e64b9dd52..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/IoLib.File.html +++ /dev/null @@ -1,643 +0,0 @@ - - - - - - -IoLib.File (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2.lib -
-Class IoLib.File

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.lib.IoLib.File
-
-
-
Enclosing class:
IoLib
-
-
-
-
protected abstract class IoLib.File
extends LuaValue
- - -

-


- -

- - - - - - - -
-Field Summary
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - - -
-Constructor Summary
-protected IoLib.File() - -
-           
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
-abstract  voidclose() - -
-           
-abstract  voidflush() - -
-           
- LuaValueget(LuaValue key) - -
-          Get a value in a table including metatag processing using INDEX.
-abstract  booleanisclosed() - -
-           
-abstract  booleanisstdfile() - -
-           
-abstract  intpeek() - -
-           
-abstract  intread() - -
-           
-abstract  intread(byte[] bytes, - int offset, - int length) - -
-           
-abstract  intremaining() - -
-           
-abstract  intseek(java.lang.String option, - int bytecount) - -
-           
-abstract  voidsetvbuf(java.lang.String mode, - int size) - -
-           
- java.lang.Stringtojstring() - -
-          Convert to human readable String for any type.
- inttype() - -
-          Get the enumeration value for the type of this value.
- java.lang.Stringtypename() - -
-          Get the String name of the type of this value.
-abstract  voidwrite(LuaString string) - -
-           
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
add, add, add, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, call, call, call, call, callmt, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checkmetatag, checknotnil, checknumber, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalidkey, compareerror, compareerror, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, div, div, div, divInto, eq_b, eq, eqmtcall, equals, error, get, get, getfenv, getmetatable, getn, gettable, gt_b, gt_b, gt_b, gt, gt, gt, gteq_b, gteq_b, gteq_b, gteq, gteq, gteq, illegal, inext, invoke, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isfunction, isint, isinttype, islong, isnil, isnumber, isstring, istable, isthread, isuserdata, isuserdata, isweaknil, len, lenerror, length, listOf, listOf, load, lt_b, lt_b, lt_b, lt, lt, lt, lteq_b, lteq_b, lteq_b, lteq, lteq, lteq, metatag, method, method, method, method, method, method, mod, mod, mod, modFrom, mul, mul, mul, narg, neg, neq_b, neq, next, not, onInvoke, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, or, pow, pow, pow, powWith, powWith, presize, raweq, raweq, raweq, raweq, raweq, rawget, rawget, rawget, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setfenv, setmetatable, settable, strcmp, strcmp, strongkey, strongvalue, strvalue, sub, sub, sub, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, tobyte, tochar, todouble, tofloat, toint, tolong, tonumber, toshort, tostring, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Constructor Detail
- -

-IoLib.File

-
-protected IoLib.File()
-
-
- - - - - - - - -
-Method Detail
- -

-write

-
-public abstract void write(LuaString string)
-                    throws java.io.IOException
-
-
- -
Throws: -
java.io.IOException
-
-
-
- -

-flush

-
-public abstract void flush()
-                    throws java.io.IOException
-
-
- -
Throws: -
java.io.IOException
-
-
-
- -

-isstdfile

-
-public abstract boolean isstdfile()
-
-
-
-
-
-
- -

-close

-
-public abstract void close()
-                    throws java.io.IOException
-
-
- -
Throws: -
java.io.IOException
-
-
-
- -

-isclosed

-
-public abstract boolean isclosed()
-
-
-
-
-
-
- -

-seek

-
-public abstract int seek(java.lang.String option,
-                         int bytecount)
-                  throws java.io.IOException
-
-
- -
Throws: -
java.io.IOException
-
-
-
- -

-setvbuf

-
-public abstract void setvbuf(java.lang.String mode,
-                             int size)
-
-
-
-
-
-
- -

-remaining

-
-public abstract int remaining()
-                       throws java.io.IOException
-
-
- -
Throws: -
java.io.IOException
-
-
-
- -

-peek

-
-public abstract int peek()
-                  throws java.io.IOException,
-                         java.io.EOFException
-
-
- -
Throws: -
java.io.IOException -
java.io.EOFException
-
-
-
- -

-read

-
-public abstract int read()
-                  throws java.io.IOException,
-                         java.io.EOFException
-
-
- -
Throws: -
java.io.IOException -
java.io.EOFException
-
-
-
- -

-read

-
-public abstract int read(byte[] bytes,
-                         int offset,
-                         int length)
-                  throws java.io.IOException
-
-
- -
Throws: -
java.io.IOException
-
-
-
- -

-get

-
-public LuaValue get(LuaValue key)
-
-
Description copied from class: LuaValue
-
Get a value in a table including metatag processing using INDEX. -

-

-
Overrides:
get in class LuaValue
-
-
-
Parameters:
key - the key to look up, must not be NIL or null -
Returns:
LuaValue for that key, or NIL if not found and no metatag
See Also:
LuaValue.get(int), -LuaValue.get(String), -LuaValue.rawget(LuaValue)
-
-
-
- -

-type

-
-public int type()
-
-
Description copied from class: LuaValue
-
Get the enumeration value for the type of this value. -

-

-
Specified by:
type in class LuaValue
-
-
- -
Returns:
value for this type, one of - TNIL, - TBOOLEAN, - TNUMBER, - TSTRING, - TTABLE, - TFUNCTION, - TUSERDATA, - TTHREAD
See Also:
LuaValue.typename()
-
-
-
- -

-typename

-
-public java.lang.String typename()
-
-
Description copied from class: LuaValue
-
Get the String name of the type of this value. -

-

-

-
Specified by:
typename in class LuaValue
-
-
- -
Returns:
name from type name list LuaValue.TYPE_NAMES - corresponding to the type of this value: - "nil", "boolean", "number", "string", - "table", "function", "userdata", "thread"
See Also:
LuaValue.type()
-
-
-
- -

-tojstring

-
-public java.lang.String tojstring()
-
-
Description copied from class: LuaValue
-
Convert to human readable String for any type. -

-

-
Overrides:
tojstring in class LuaValue
-
-
- -
Returns:
String for use by human readers based on type.
See Also:
LuaValue.tostring(), -LuaValue.optjstring(String), -LuaValue.checkjstring(), -LuaValue.isstring(), -TSTRING
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/IoLib.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/IoLib.html deleted file mode 100644 index c79f857d4..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/IoLib.html +++ /dev/null @@ -1,1150 +0,0 @@ - - - - - - -IoLib (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2.lib -
-Class IoLib

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.LuaFunction
-              extended by org.luaj.vm2.lib.LibFunction
-                  extended by org.luaj.vm2.lib.OneArgFunction
-                      extended by org.luaj.vm2.lib.IoLib
-
-
-
Direct Known Subclasses:
JmeIoLib, JseIoLib
-
-
-
-
public abstract class IoLib
extends OneArgFunction
- - -

-Abstract base class extending LibFunction which implements the - core of the lua standard io library. -

- It contains the implementation of the io library support that is common to - the JSE and JME platforms. - In practice on of the concrete IOLib subclasses is chosen: - JseIoLib for the JSE platform, and - JmeIoLib for the JME platform. -

- The JSE implementation conforms almost completely to the C-based lua library, - while the JME implementation follows closely except in the area of random-access files, - which are difficult to support properly on JME. -

- Typically, this library is included as part of a call to either - JsePlatform#standardGlobals() or JmePlatform#standardGlobals() -

- To instantiate and use it directly, - link it into your globals table via LuaValue.load(LuaValue) using code such as: -

 LuaTable _G = new LuaTable();
- _G.load(new JseIoLib());
- LuaThread.setGlobals(_G);
- _G.load(new JseBaseLib());
- _G.load(new PackageLib());
- _G.load(new JseIoLib());
- _G.get("io").get("write").call(LuaValue.valueOf("hello, world\n"));
-  
- Doing so will ensure the library is properly initialized - and loaded into the globals table. -

- This has been implemented to match as closely as possible the behavior in the corresponding library in C. -

- -

-

-
See Also:
LibFunction, -JsePlatform, -JmePlatform, -JseIoLib, -JmeIoLib, -http://www.lua.org/manual/5.1/manual.html#5.7
-
- -

- - - - - - - - - - - -
-Nested Class Summary
-protected  classIoLib.File - -
-           
- - - - - - - - - - - - - - -
-Field Summary
-static java.lang.String[]FILE_NAMES - -
-           
-static java.lang.String[]IO_NAMES - -
-           
- - - - - - - -
Fields inherited from class org.luaj.vm2.lib.LibFunction
name, opcode
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaFunction
env, s_metatable
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - -
-Constructor Summary
IoLib() - -
-           
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
- Varargs_file_close(LuaValue file) - -
-           
- Varargs_file_flush(LuaValue file) - -
-           
- Varargs_file_lines(LuaValue file) - -
-           
- Varargs_file_read(LuaValue file, - Varargs subargs) - -
-           
- Varargs_file_seek(LuaValue file, - java.lang.String whence, - int offset) - -
-           
- Varargs_file_setvbuf(LuaValue file, - java.lang.String mode, - int size) - -
-           
- Varargs_file_write(LuaValue file, - Varargs subargs) - -
-           
- Varargs_io_close(LuaValue file) - -
-           
- Varargs_io_flush() - -
-           
- Varargs_io_index(LuaValue v) - -
-           
- Varargs_io_input(LuaValue file) - -
-           
- Varargs_io_lines(java.lang.String filename) - -
-           
- Varargs_io_open(java.lang.String filename, - java.lang.String mode) - -
-           
- Varargs_io_output(LuaValue filename) - -
-           
- Varargs_io_popen(java.lang.String prog, - java.lang.String mode) - -
-           
- Varargs_io_read(Varargs args) - -
-           
- Varargs_io_tmpfile() - -
-           
- Varargs_io_type(LuaValue obj) - -
-           
- Varargs_io_write(Varargs args) - -
-           
- Varargs_lines_iter(LuaValue file) - -
-           
- LuaValuecall(LuaValue arg) - -
-          Call this with 1 argument, including metatag processing, - and return only the first return value.
-static LuaValuefreadall(IoLib.File f) - -
-           
-static LuaValuefreadbytes(IoLib.File f, - int count) - -
-           
-static LuaValuefreadline(IoLib.File f) - -
-           
-static LuaValuefreadnumber(IoLib.File f) - -
-           
-static LuaValuefreaduntil(IoLib.File f, - boolean lineonly) - -
-           
-protected abstract  IoLib.FileopenFile(java.lang.String filename, - boolean readMode, - boolean appendMode, - boolean updateMode, - boolean binaryMode) - -
-          Open a file in a particular mode.
-protected abstract  IoLib.FileopenProgram(java.lang.String prog, - java.lang.String mode) - -
-          Start a new process and return a file for input or output
-protected abstract  IoLib.FiletmpFile() - -
-          Open a temporary file.
-protected abstract  IoLib.FilewrapStdin() - -
-          Wrap the standard input.
-protected abstract  IoLib.FilewrapStdout() - -
-          Wrap the standard output.
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.OneArgFunction
call, call, call, invoke
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.LibFunction
bind, bind, newupe, newupl, newupn, tojstring
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaFunction
checkfunction, getfenv, getmetatable, isfunction, optfunction, setfenv, type, typename
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
add, add, add, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, callmt, checkboolean, checkclosure, checkdouble, checkint, checkinteger, checkjstring, checklong, checkmetatag, checknotnil, checknumber, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalidkey, compareerror, compareerror, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, div, div, div, divInto, eq_b, eq, eqmtcall, equals, error, get, get, get, getn, gettable, gt_b, gt_b, gt_b, gt, gt, gt, gteq_b, gteq_b, gteq_b, gteq, gteq, gteq, illegal, inext, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isint, isinttype, islong, isnil, isnumber, isstring, istable, isthread, isuserdata, isuserdata, isweaknil, len, lenerror, length, listOf, listOf, load, lt_b, lt_b, lt_b, lt, lt, lt, lteq_b, lteq_b, lteq_b, lteq, lteq, lteq, metatag, method, method, method, method, method, method, mod, mod, mod, modFrom, mul, mul, mul, narg, neg, neq_b, neq, next, not, onInvoke, optboolean, optclosure, optdouble, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, or, pow, pow, pow, powWith, powWith, presize, raweq, raweq, raweq, raweq, raweq, rawget, rawget, rawget, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setmetatable, settable, strcmp, strcmp, strongkey, strongvalue, strvalue, sub, sub, sub, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, tobyte, tochar, todouble, tofloat, toint, tolong, tonumber, toshort, tostring, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Field Detail
- -

-IO_NAMES

-
-public static final java.lang.String[] IO_NAMES
-
-
-
-
-
- -

-FILE_NAMES

-
-public static final java.lang.String[] FILE_NAMES
-
-
-
-
- - - - - - - - -
-Constructor Detail
- -

-IoLib

-
-public IoLib()
-
-
- - - - - - - - -
-Method Detail
- -

-wrapStdin

-
-protected abstract IoLib.File wrapStdin()
-                                 throws java.io.IOException
-
-
Wrap the standard input. -

-

- -
Returns:
File -
Throws: -
java.io.IOException
-
-
-
- -

-wrapStdout

-
-protected abstract IoLib.File wrapStdout()
-                                  throws java.io.IOException
-
-
Wrap the standard output. -

-

- -
Returns:
File -
Throws: -
java.io.IOException
-
-
-
- -

-openFile

-
-protected abstract IoLib.File openFile(java.lang.String filename,
-                                       boolean readMode,
-                                       boolean appendMode,
-                                       boolean updateMode,
-                                       boolean binaryMode)
-                                throws java.io.IOException
-
-
Open a file in a particular mode. -

-

-
Parameters:
filename -
readMode - true if opening in read mode
appendMode - true if opening in append mode
updateMode - true if opening in update mode
binaryMode - true if opening in binary mode -
Returns:
File object if successful -
Throws: -
java.io.IOException - if could not be opened
-
-
-
- -

-tmpFile

-
-protected abstract IoLib.File tmpFile()
-                               throws java.io.IOException
-
-
Open a temporary file. -

-

- -
Returns:
File object if successful -
Throws: -
java.io.IOException - if could not be opened
-
-
-
- -

-openProgram

-
-protected abstract IoLib.File openProgram(java.lang.String prog,
-                                          java.lang.String mode)
-                                   throws java.io.IOException
-
-
Start a new process and return a file for input or output -

-

-
Parameters:
prog - the program to execute
mode - "r" to read, "w" to write -
Returns:
File to read to or write from -
Throws: -
java.io.IOException - if an i/o exception occurs
-
-
-
- -

-call

-
-public LuaValue call(LuaValue arg)
-
-
Description copied from class: LuaValue
-
Call this with 1 argument, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use LuaValue.invoke() instead. -

- To call this as a method call, use LuaValue.method(LuaValue) instead. -

-

-
Specified by:
call in class OneArgFunction
-
-
-
Parameters:
arg - First argument to supply to the called function -
Returns:
First return value (this(arg)), or NIL if there were none.
See Also:
LuaValue.call(), -LuaValue.call(LuaValue,LuaValue), -LuaValue.call(LuaValue, LuaValue, LuaValue), -#invoke(LuaValue), -LuaValue.method(String,LuaValue), -LuaValue.method(LuaValue,LuaValue)
-
-
-
- -

-_io_flush

-
-public Varargs _io_flush()
-                  throws java.io.IOException
-
-
- -
Throws: -
java.io.IOException
-
-
-
- -

-_io_tmpfile

-
-public Varargs _io_tmpfile()
-                    throws java.io.IOException
-
-
- -
Throws: -
java.io.IOException
-
-
-
- -

-_io_close

-
-public Varargs _io_close(LuaValue file)
-                  throws java.io.IOException
-
-
- -
Throws: -
java.io.IOException
-
-
-
- -

-_io_input

-
-public Varargs _io_input(LuaValue file)
-
-
-
-
-
-
- -

-_io_output

-
-public Varargs _io_output(LuaValue filename)
-
-
-
-
-
-
- -

-_io_type

-
-public Varargs _io_type(LuaValue obj)
-
-
-
-
-
-
- -

-_io_popen

-
-public Varargs _io_popen(java.lang.String prog,
-                         java.lang.String mode)
-                  throws java.io.IOException
-
-
- -
Throws: -
java.io.IOException
-
-
-
- -

-_io_open

-
-public Varargs _io_open(java.lang.String filename,
-                        java.lang.String mode)
-                 throws java.io.IOException
-
-
- -
Throws: -
java.io.IOException
-
-
-
- -

-_io_lines

-
-public Varargs _io_lines(java.lang.String filename)
-
-
-
-
-
-
- -

-_io_read

-
-public Varargs _io_read(Varargs args)
-                 throws java.io.IOException
-
-
- -
Throws: -
java.io.IOException
-
-
-
- -

-_io_write

-
-public Varargs _io_write(Varargs args)
-                  throws java.io.IOException
-
-
- -
Throws: -
java.io.IOException
-
-
-
- -

-_file_close

-
-public Varargs _file_close(LuaValue file)
-                    throws java.io.IOException
-
-
- -
Throws: -
java.io.IOException
-
-
-
- -

-_file_flush

-
-public Varargs _file_flush(LuaValue file)
-                    throws java.io.IOException
-
-
- -
Throws: -
java.io.IOException
-
-
-
- -

-_file_setvbuf

-
-public Varargs _file_setvbuf(LuaValue file,
-                             java.lang.String mode,
-                             int size)
-
-
-
-
-
-
- -

-_file_lines

-
-public Varargs _file_lines(LuaValue file)
-
-
-
-
-
-
- -

-_file_read

-
-public Varargs _file_read(LuaValue file,
-                          Varargs subargs)
-                   throws java.io.IOException
-
-
- -
Throws: -
java.io.IOException
-
-
-
- -

-_file_seek

-
-public Varargs _file_seek(LuaValue file,
-                          java.lang.String whence,
-                          int offset)
-                   throws java.io.IOException
-
-
- -
Throws: -
java.io.IOException
-
-
-
- -

-_file_write

-
-public Varargs _file_write(LuaValue file,
-                           Varargs subargs)
-                    throws java.io.IOException
-
-
- -
Throws: -
java.io.IOException
-
-
-
- -

-_io_index

-
-public Varargs _io_index(LuaValue v)
-
-
-
-
-
-
- -

-_lines_iter

-
-public Varargs _lines_iter(LuaValue file)
-                    throws java.io.IOException
-
-
- -
Throws: -
java.io.IOException
-
-
-
- -

-freadbytes

-
-public static LuaValue freadbytes(IoLib.File f,
-                                  int count)
-                           throws java.io.IOException
-
-
- -
Throws: -
java.io.IOException
-
-
-
- -

-freaduntil

-
-public static LuaValue freaduntil(IoLib.File f,
-                                  boolean lineonly)
-                           throws java.io.IOException
-
-
- -
Throws: -
java.io.IOException
-
-
-
- -

-freadline

-
-public static LuaValue freadline(IoLib.File f)
-                          throws java.io.IOException
-
-
- -
Throws: -
java.io.IOException
-
-
-
- -

-freadall

-
-public static LuaValue freadall(IoLib.File f)
-                         throws java.io.IOException
-
-
- -
Throws: -
java.io.IOException
-
-
-
- -

-freadnumber

-
-public static LuaValue freadnumber(IoLib.File f)
-                            throws java.io.IOException
-
-
- -
Throws: -
java.io.IOException
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/LibFunction.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/LibFunction.html deleted file mode 100644 index a91b74694..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/LibFunction.html +++ /dev/null @@ -1,596 +0,0 @@ - - - - - - -LibFunction (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2.lib -
-Class LibFunction

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.LuaFunction
-              extended by org.luaj.vm2.lib.LibFunction
-
-
-
Direct Known Subclasses:
OneArgFunction, ThreeArgFunction, TwoArgFunction, VarArgFunction, ZeroArgFunction
-
-
-
-
public abstract class LibFunction
extends LuaFunction
- - -

-Subclass of LuaFunction common to Java functions exposed to lua. -

- To provide for common implementations in JME and JSE, - library functions are typically grouped on one or more library classes - and an opcode per library function is defined and used to key the switch - to the correct function within the library. -

- Since lua functions can be called with too few or too many arguments, - and there are overloaded LuaValue.call() functions with varying - number of arguments, a Java function exposed in lua needs to handle the - argument fixup when a function is called with a number of arguments - differs from that expected. -

- To simplify the creation of library functions, - there are 5 direct subclasses to handle common cases based on number of - argument values and number of return return values. -

-

- To be a Java library that can be loaded via require, it should have - a public constructor that returns a LuaValue that, when executed, - initializes the library. -

- For example, the following code will implement a library called "hyperbolic" - with two functions, "sinh", and "cosh": -

 import org.luaj.vm2.LuaValue;
- import org.luaj.vm2.lib.OneArgFunction;
- 
- public class hyperbolic extends OneArgFunction {
-
-	public hyperbolic() {}
-
-	public LuaValue call(LuaValue libname) {
-		LuaValue library = tableOf();
-		library.set( "sinh", new sinh() );
-		library.set( "cosh", new cosh() );
-		env.set( "hyperbolic", library );
-		return library;
-	}
-
-	static class sinh extends OneArgFunction {
-		public LuaValue call(LuaValue x) {
-			return LuaValue.valueOf(Math.sinh(x.checkdouble()));
-		}
-	}
-	
-	static class cosh extends OneArgFunction {
-		public LuaValue call(LuaValue x) {
-			return LuaValue.valueOf(Math.cosh(x.checkdouble()));
-		}
-	}
-}
-
- The default constructor is used to instantiate the library - in response to require 'hyperbolic' statement, - provided it is on Javas class path. - This instance is then invoked with the name supplied to require() - as the only argument, and library should initialized whatever global - data it needs to and place it into the environment if needed. - In this case, it creates two function, 'sinh', and 'cosh', and puts - them into a global table called 'hyperbolic.' - It placed the library table into the globals via the LuaFunction.env - local variable which corresponds to the globals that apply when the - library is loaded. -

- To test it, a script such as this can be used: -

 local t = require('hyperbolic')
- print( 't', t )
- print( 'hyperbolic', hyperbolic )
- for k,v in pairs(t) do
- 	print( 'k,v', k,v )
- end
- print( 'sinh(.5)', hyperbolic.sinh(.5) )
- print( 'cosh(.5)', hyperbolic.cosh(.5) )
- 
-

- It should produce something like: -

 t	table: 3dbbd23f
- hyperbolic	table: 3dbbd23f
- k,v	cosh	function: 3dbbd128
- k,v	sinh	function: 3dbbd242
- sinh(.5)	0.5210953
- cosh(.5)	1.127626
- 
-

- See the source code in any of the library functions - such as BaseLib or TableLib for other examples. -

- -

-


- -

- - - - - - - - - - - - - - - -
-Field Summary
-protected  java.lang.Stringname - -
-          The common name for this function, useful for debugging.
-protected  intopcode - -
-          User-defined opcode to differentiate between instances of the library function class.
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaFunction
env, s_metatable
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - - -
-Constructor Summary
-protected LibFunction() - -
-          Default constructor for use by subclasses
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
-protected  voidbind(LuaValue env, - java.lang.Class factory, - java.lang.String[] names) - -
-          Bind a set of library functions.
-protected  voidbind(LuaValue env, - java.lang.Class factory, - java.lang.String[] names, - int firstopcode) - -
-          Bind a set of library functions, with an offset
-protected static LuaValue[]newupe() - -
-          Java code generation utility to allocate storage for upvalue, leave it empty
-protected static LuaValue[]newupl(LuaValue v) - -
-          Java code generation utility to allocate storage for upvalue, initialize with value
-protected static LuaValue[]newupn() - -
-          Java code generation utility to allocate storage for upvalue, initialize with nil
- java.lang.Stringtojstring() - -
-          Convert to human readable String for any type.
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaFunction
checkfunction, getfenv, getmetatable, isfunction, optfunction, setfenv, type, typename
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
add, add, add, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, call, call, call, call, callmt, checkboolean, checkclosure, checkdouble, checkint, checkinteger, checkjstring, checklong, checkmetatag, checknotnil, checknumber, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalidkey, compareerror, compareerror, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, div, div, div, divInto, eq_b, eq, eqmtcall, equals, error, get, get, get, getn, gettable, gt_b, gt_b, gt_b, gt, gt, gt, gteq_b, gteq_b, gteq_b, gteq, gteq, gteq, illegal, inext, invoke, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isint, isinttype, islong, isnil, isnumber, isstring, istable, isthread, isuserdata, isuserdata, isweaknil, len, lenerror, length, listOf, listOf, load, lt_b, lt_b, lt_b, lt, lt, lt, lteq_b, lteq_b, lteq_b, lteq, lteq, lteq, metatag, method, method, method, method, method, method, mod, mod, mod, modFrom, mul, mul, mul, narg, neg, neq_b, neq, next, not, onInvoke, optboolean, optclosure, optdouble, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, or, pow, pow, pow, powWith, powWith, presize, raweq, raweq, raweq, raweq, raweq, rawget, rawget, rawget, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setmetatable, settable, strcmp, strcmp, strongkey, strongvalue, strvalue, sub, sub, sub, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, tobyte, tochar, todouble, tofloat, toint, tolong, tonumber, toshort, tostring, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Field Detail
- -

-opcode

-
-protected int opcode
-
-
User-defined opcode to differentiate between instances of the library function class. -

- Subclass will typicall switch on this value to provide the specific behavior for each function. -

-

-
-
-
- -

-name

-
-protected java.lang.String name
-
-
The common name for this function, useful for debugging. -

- Binding functions initialize this to the name to which it is bound. -

-

-
-
- - - - - - - - -
-Constructor Detail
- -

-LibFunction

-
-protected LibFunction()
-
-
Default constructor for use by subclasses -

-

- - - - - - - - -
-Method Detail
- -

-tojstring

-
-public java.lang.String tojstring()
-
-
Description copied from class: LuaValue
-
Convert to human readable String for any type. -

-

-
Overrides:
tojstring in class LuaValue
-
-
- -
Returns:
String for use by human readers based on type.
See Also:
LuaValue.tostring(), -LuaValue.optjstring(String), -LuaValue.checkjstring(), -LuaValue.isstring(), -TSTRING
-
-
-
- -

-bind

-
-protected void bind(LuaValue env,
-                    java.lang.Class factory,
-                    java.lang.String[] names)
-
-
Bind a set of library functions. -

- An array of names is provided, and the first name is bound - with opcode = 0, second with 1, etc. -

-

-
Parameters:
env - The environment to apply to each bound function
factory - the Class to instantiate for each bound function
names - array of String names, one for each function.
See Also:
bind(LuaValue, Class, String[], int)
-
-
-
- -

-bind

-
-protected void bind(LuaValue env,
-                    java.lang.Class factory,
-                    java.lang.String[] names,
-                    int firstopcode)
-
-
Bind a set of library functions, with an offset -

- An array of names is provided, and the first name is bound - with opcode = firstopcode, second with firstopcode+1, etc. -

-

-
Parameters:
env - The environment to apply to each bound function
factory - the Class to instantiate for each bound function
names - array of String names, one for each function.
firstopcode - the first opcode to use
See Also:
bind(LuaValue, Class, String[])
-
-
-
- -

-newupe

-
-protected static LuaValue[] newupe()
-
-
Java code generation utility to allocate storage for upvalue, leave it empty -

-

-
-
-
-
- -

-newupn

-
-protected static LuaValue[] newupn()
-
-
Java code generation utility to allocate storage for upvalue, initialize with nil -

-

-
-
-
-
- -

-newupl

-
-protected static LuaValue[] newupl(LuaValue v)
-
-
Java code generation utility to allocate storage for upvalue, initialize with value -

-

-
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/MathLib.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/MathLib.html deleted file mode 100644 index 1d4edf088..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/MathLib.html +++ /dev/null @@ -1,528 +0,0 @@ - - - - - - -MathLib (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2.lib -
-Class MathLib

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.LuaFunction
-              extended by org.luaj.vm2.lib.LibFunction
-                  extended by org.luaj.vm2.lib.OneArgFunction
-                      extended by org.luaj.vm2.lib.MathLib
-
-
-
Direct Known Subclasses:
JseMathLib
-
-
-
-
public class MathLib
extends OneArgFunction
- - -

-Subclass of LibFunction which implements the lua standard math - library. -

- It contains only the math library support that is possible on JME. - For a more complete implementation based on math functions specific to JSE - use JseMathLib. - In Particular the following math functions are not implemented by this library: -

-

- The implementations of exp() and pow() are constructed by - hand for JME, so will be slower and less accurate than when executed on the JSE platform. -

- Typically, this library is included as part of a call to either - JmePlatform#standardGlobals() -

- To instantiate and use it directly, - link it into your globals table via LuaValue.load(LuaValue) using code such as: -

 LuaTable _G = new LuaTable();
- LuaThread.setGlobals(_G);
- _G.load(new BaseLib());
- _G.load(new PackageLib());
- _G.load(new MathLib());
- System.out.println( _G.get("math").get("sqrt").call( LuaValue.valueOf(2) ) );
-  
- Doing so will ensure the library is properly initialized - and loaded into the globals table. -

- This has been implemented to match as closely as possible the behavior in the corresponding library in C. -

- -

-

-
See Also:
LibFunction, -JsePlatform, -JmePlatform, -JseMathLib, -http://www.lua.org/manual/5.1/manual.html#5.6
-
- -

- - - - - - - - - - - -
-Field Summary
-static MathLibMATHLIB - -
-           
- - - - - - - -
Fields inherited from class org.luaj.vm2.lib.LibFunction
name, opcode
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaFunction
env, s_metatable
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - -
-Constructor Summary
MathLib() - -
-           
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
- LuaValuecall(LuaValue arg) - -
-          Call this with 1 argument, including metatag processing, - and return only the first return value.
-static doubledpow_d(double a, - double b) - -
-           
-protected static doubledpow_default(double a, - double b) - -
-          Default JME version computes using longhand heuristics.
- doubledpow_lib(double a, - double b) - -
-          Hook to override default dpow behavior with faster implementation.
-static LuaValuedpow(double a, - double b) - -
-          compute power using installed math library, or default if there is no math library installed
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.OneArgFunction
call, call, call, invoke
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.LibFunction
bind, bind, newupe, newupl, newupn, tojstring
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaFunction
checkfunction, getfenv, getmetatable, isfunction, optfunction, setfenv, type, typename
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
add, add, add, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, callmt, checkboolean, checkclosure, checkdouble, checkint, checkinteger, checkjstring, checklong, checkmetatag, checknotnil, checknumber, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalidkey, compareerror, compareerror, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, div, div, div, divInto, eq_b, eq, eqmtcall, equals, error, get, get, get, getn, gettable, gt_b, gt_b, gt_b, gt, gt, gt, gteq_b, gteq_b, gteq_b, gteq, gteq, gteq, illegal, inext, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isint, isinttype, islong, isnil, isnumber, isstring, istable, isthread, isuserdata, isuserdata, isweaknil, len, lenerror, length, listOf, listOf, load, lt_b, lt_b, lt_b, lt, lt, lt, lteq_b, lteq_b, lteq_b, lteq, lteq, lteq, metatag, method, method, method, method, method, method, mod, mod, mod, modFrom, mul, mul, mul, narg, neg, neq_b, neq, next, not, onInvoke, optboolean, optclosure, optdouble, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, or, pow, pow, pow, powWith, powWith, presize, raweq, raweq, raweq, raweq, raweq, rawget, rawget, rawget, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setmetatable, settable, strcmp, strcmp, strongkey, strongvalue, strvalue, sub, sub, sub, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, tobyte, tochar, todouble, tofloat, toint, tolong, tonumber, toshort, tostring, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Field Detail
- -

-MATHLIB

-
-public static MathLib MATHLIB
-
-
-
-
- - - - - - - - -
-Constructor Detail
- -

-MathLib

-
-public MathLib()
-
-
- - - - - - - - -
-Method Detail
- -

-call

-
-public LuaValue call(LuaValue arg)
-
-
Description copied from class: LuaValue
-
Call this with 1 argument, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use LuaValue.invoke() instead. -

- To call this as a method call, use LuaValue.method(LuaValue) instead. -

-

-
Specified by:
call in class OneArgFunction
-
-
-
Parameters:
arg - First argument to supply to the called function -
Returns:
First return value (this(arg)), or NIL if there were none.
See Also:
LuaValue.call(), -LuaValue.call(LuaValue,LuaValue), -LuaValue.call(LuaValue, LuaValue, LuaValue), -#invoke(LuaValue), -LuaValue.method(String,LuaValue), -LuaValue.method(LuaValue,LuaValue)
-
-
-
- -

-dpow

-
-public static LuaValue dpow(double a,
-                            double b)
-
-
compute power using installed math library, or default if there is no math library installed -

-

-
-
-
-
- -

-dpow_d

-
-public static double dpow_d(double a,
-                            double b)
-
-
-
-
-
-
- -

-dpow_lib

-
-public double dpow_lib(double a,
-                       double b)
-
-
Hook to override default dpow behavior with faster implementation. -

-

-
-
-
-
- -

-dpow_default

-
-protected static double dpow_default(double a,
-                                     double b)
-
-
Default JME version computes using longhand heuristics. -

-

-
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/OneArgFunction.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/OneArgFunction.html deleted file mode 100644 index dd2ded291..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/OneArgFunction.html +++ /dev/null @@ -1,571 +0,0 @@ - - - - - - -OneArgFunction (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2.lib -
-Class OneArgFunction

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.LuaFunction
-              extended by org.luaj.vm2.lib.LibFunction
-                  extended by org.luaj.vm2.lib.OneArgFunction
-
-
-
Direct Known Subclasses:
BaseLib, IoLib, JseMathLib.JseMathLib1, MathLib, PackageLib, StringLib, TableLib
-
-
-
-
public abstract class OneArgFunction
extends LibFunction
- - -

-Abstract base class for Java function implementations that take one argument and - return one value. -

- Subclasses need only implement LuaValue.call(LuaValue) to complete this class, - simplifying development. - All other uses of call(), invoke(Varargs),etc, - are routed through this method by this class, - dropping or extending arguments with nil values as required. -

- If more than one argument are required, or no arguments are required, - or variable argument or variable return values, - then use one of the related function - ZeroArgFunction, TwoArgFunction, ThreeArgFunction, or VarArgFunction. -

- See LibFunction for more information on implementation libraries and library functions. -

- -

-

-
See Also:
call(LuaValue), -LibFunction, -ZeroArgFunction, -TwoArgFunction, -ThreeArgFunction, -VarArgFunction
-
- -

- - - - - - - -
-Field Summary
- - - - - - - -
Fields inherited from class org.luaj.vm2.lib.LibFunction
name, opcode
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaFunction
env, s_metatable
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - - - - -
-Constructor Summary
OneArgFunction() - -
-          Default constructor
OneArgFunction(LuaValue env) - -
-          Constructor with specific environment
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
- LuaValuecall() - -
-          Call this with 0 arguments, including metatag processing, - and return only the first return value.
-abstract  LuaValuecall(LuaValue arg) - -
-          Call this with 1 argument, including metatag processing, - and return only the first return value.
- LuaValuecall(LuaValue arg1, - LuaValue arg2) - -
-          Call this with 2 arguments, including metatag processing, - and return only the first return value.
- LuaValuecall(LuaValue arg1, - LuaValue arg2, - LuaValue arg3) - -
-          Call this with 3 arguments, including metatag processing, - and return only the first return value.
- Varargsinvoke(Varargs varargs) - -
-          Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs.
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.LibFunction
bind, bind, newupe, newupl, newupn, tojstring
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaFunction
checkfunction, getfenv, getmetatable, isfunction, optfunction, setfenv, type, typename
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
add, add, add, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, callmt, checkboolean, checkclosure, checkdouble, checkint, checkinteger, checkjstring, checklong, checkmetatag, checknotnil, checknumber, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalidkey, compareerror, compareerror, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, div, div, div, divInto, eq_b, eq, eqmtcall, equals, error, get, get, get, getn, gettable, gt_b, gt_b, gt_b, gt, gt, gt, gteq_b, gteq_b, gteq_b, gteq, gteq, gteq, illegal, inext, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isint, isinttype, islong, isnil, isnumber, isstring, istable, isthread, isuserdata, isuserdata, isweaknil, len, lenerror, length, listOf, listOf, load, lt_b, lt_b, lt_b, lt, lt, lt, lteq_b, lteq_b, lteq_b, lteq, lteq, lteq, metatag, method, method, method, method, method, method, mod, mod, mod, modFrom, mul, mul, mul, narg, neg, neq_b, neq, next, not, onInvoke, optboolean, optclosure, optdouble, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, or, pow, pow, pow, powWith, powWith, presize, raweq, raweq, raweq, raweq, raweq, rawget, rawget, rawget, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setmetatable, settable, strcmp, strcmp, strongkey, strongvalue, strvalue, sub, sub, sub, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, tobyte, tochar, todouble, tofloat, toint, tolong, tonumber, toshort, tostring, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Constructor Detail
- -

-OneArgFunction

-
-public OneArgFunction()
-
-
Default constructor -

-

-
- -

-OneArgFunction

-
-public OneArgFunction(LuaValue env)
-
-
Constructor with specific environment -

-

-
Parameters:
env - The environment to apply during constructon.
-
- - - - - - - - -
-Method Detail
- -

-call

-
-public abstract LuaValue call(LuaValue arg)
-
-
Description copied from class: LuaValue
-
Call this with 1 argument, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use LuaValue.invoke() instead. -

- To call this as a method call, use LuaValue.method(LuaValue) instead. -

-

-
Overrides:
call in class LuaValue
-
-
-
Parameters:
arg - First argument to supply to the called function -
Returns:
First return value (this(arg)), or NIL if there were none.
See Also:
LuaValue.call(), -LuaValue.call(LuaValue,LuaValue), -LuaValue.call(LuaValue, LuaValue, LuaValue), -#invoke(LuaValue), -LuaValue.method(String,LuaValue), -LuaValue.method(LuaValue,LuaValue)
-
-
-
- -

-call

-
-public final LuaValue call()
-
-
Description copied from class: LuaValue
-
Call this with 0 arguments, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use LuaValue.invoke() instead. -

- To call this as a method call, use LuaValue.method(LuaValue) instead. -

-

-
Overrides:
call in class LuaValue
-
-
- -
Returns:
First return value (this()), or NIL if there were none.
See Also:
LuaValue.call(LuaValue), -LuaValue.call(LuaValue,LuaValue), -LuaValue.call(LuaValue, LuaValue, LuaValue), -LuaValue.invoke(), -LuaValue.method(String), -LuaValue.method(LuaValue)
-
-
-
- -

-call

-
-public final LuaValue call(LuaValue arg1,
-                           LuaValue arg2)
-
-
Description copied from class: LuaValue
-
Call this with 2 arguments, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use LuaValue.invoke() instead. -

- To call this as a method call, use LuaValue.method(LuaValue) instead. -

-

-
Overrides:
call in class LuaValue
-
-
-
Parameters:
arg1 - First argument to supply to the called function
arg2 - Second argument to supply to the called function -
Returns:
First return value (this(arg1,arg2)), or NIL if there were none.
See Also:
LuaValue.call(), -LuaValue.call(LuaValue), -LuaValue.call(LuaValue, LuaValue, LuaValue), -#invoke(LuaValue,LuaValue), -LuaValue.method(String,LuaValue,LuaValue), -LuaValue.method(LuaValue,LuaValue,LuaValue)
-
-
-
- -

-call

-
-public LuaValue call(LuaValue arg1,
-                     LuaValue arg2,
-                     LuaValue arg3)
-
-
Description copied from class: LuaValue
-
Call this with 3 arguments, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use LuaValue.invoke() instead. -

- To call this as a method call, use LuaValue.method(LuaValue) instead. -

-

-
Overrides:
call in class LuaValue
-
-
-
Parameters:
arg1 - First argument to supply to the called function
arg2 - Second argument to supply to the called function
arg3 - Second argument to supply to the called function -
Returns:
First return value (this(arg1,arg2,arg3)), or NIL if there were none.
See Also:
LuaValue.call(), -LuaValue.call(LuaValue), -LuaValue.call(LuaValue, LuaValue), -#invoke(LuaValue,LuaValue, LuaValue), -LuaValue.invokemethod(String,Varargs), -LuaValue.invokemethod(LuaValue,Varargs)
-
-
-
- -

-invoke

-
-public Varargs invoke(Varargs varargs)
-
-
Description copied from class: LuaValue
-
Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs. -

- If this is a LuaFunction, call it, and return all values. - Otherwise, look for the CALL metatag and call that. -

- To get a particular return value, us Varargs.arg(int) -

- To call this as a method call, use LuaValue.invokemethod(LuaValue) instead. -

-

-
Overrides:
invoke in class LuaValue
-
-
-
Parameters:
varargs - Varargs containing the arguments to supply to the called function -
Returns:
All return values as a Varargs instance.
See Also:
LuaValue.varargsOf(LuaValue[]), -LuaValue.call(LuaValue), -LuaValue.invoke(), -LuaValue.invoke(LuaValue,Varargs), -LuaValue.invokemethod(String,Varargs), -LuaValue.invokemethod(LuaValue,Varargs)
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/OsLib.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/OsLib.html deleted file mode 100644 index 83026cd3c..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/OsLib.html +++ /dev/null @@ -1,772 +0,0 @@ - - - - - - -OsLib (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2.lib -
-Class OsLib

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.LuaFunction
-              extended by org.luaj.vm2.lib.LibFunction
-                  extended by org.luaj.vm2.lib.VarArgFunction
-                      extended by org.luaj.vm2.lib.OsLib
-
-
-
Direct Known Subclasses:
JseOsLib
-
-
-
-
public class OsLib
extends VarArgFunction
- - -

-Subclass of LibFunction which implements the standard lua os library. -

- It is a usable base with simplified stub functions - for library functions that cannot be implemented uniformly - on Jse and Jme. -

- This can be installed as-is on either platform, or extended - and refined to be used in a complete Jse implementation. -

- Because the nature of the os library is to encapsulate - os-specific features, the behavior of these functions varies considerably - from their counterparts in the C platform. -

- The following functions have limited implementations of features - that are not supported well on Jme: -

-

- Typically, this library is included as part of a call to either - JmePlatform#standardGlobals() -

- To instantiate and use it directly, - link it into your globals table via LuaValue.load(LuaValue) using code such as: -

 LuaTable _G = new LuaTable();
- LuaThread.setGlobals(_G);
- _G.load(new BaseLib());
- _G.load(new PackageLib());
- _G.load(new OsLib());
- System.out.println( _G.get("os").get("time").call() );
-  
- Doing so will ensure the library is properly initialized - and loaded into the globals table. -

-

- -

-

-
See Also:
LibFunction, -JseOsLib, -JsePlatform, -JmePlatform, -http://www.lua.org/manual/5.1/manual.html#5.8
-
- -

- - - - - - - - - - - - - - - -
-Field Summary
-static java.lang.StringTMP_PREFIX - -
-           
-static java.lang.StringTMP_SUFFIX - -
-           
- - - - - - - -
Fields inherited from class org.luaj.vm2.lib.LibFunction
name, opcode
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaFunction
env, s_metatable
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - -
-Constructor Summary
OsLib() - -
-          Create and OsLib instance.
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
-protected  doubleclock() - -
-           
-protected  java.lang.Stringdate(java.lang.String format, - double time) - -
-          If the time argument is present, this is the time to be formatted - (see the os.time function for a description of this value).
-protected  doubledifftime(double t2, - double t1) - -
-          Returns the number of seconds from time t1 to time t2.
-protected  intexecute(java.lang.String command) - -
-          This function is equivalent to the C function system.
-protected  voidexit(int code) - -
-          Calls the C function exit, with an optional code, to terminate the host program.
-protected  java.lang.Stringgetenv(java.lang.String varname) - -
-          Returns the value of the process environment variable varname, - or null if the variable is not defined.
- LuaValueinit() - -
-           
- Varargsinvoke(Varargs args) - -
-          Override and implement for the best performance.
-protected  voidremove(java.lang.String filename) - -
-          Deletes the file or directory with the given name.
-protected  voidrename(java.lang.String oldname, - java.lang.String newname) - -
-          Renames file or directory named oldname to newname.
-protected  java.lang.Stringsetlocale(java.lang.String locale, - java.lang.String category) - -
-          Sets the current locale of the program.
-protected  longtime(LuaTable table) - -
-          Returns the current time when called without arguments, - or a time representing the date and time specified by the given table.
-protected  java.lang.Stringtmpname() - -
-          Returns a string with a file name that can be used for a temporary file.
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.VarArgFunction
call, call, call, call, onInvoke
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.LibFunction
bind, bind, newupe, newupl, newupn, tojstring
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaFunction
checkfunction, getfenv, getmetatable, isfunction, optfunction, setfenv, type, typename
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
add, add, add, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, callmt, checkboolean, checkclosure, checkdouble, checkint, checkinteger, checkjstring, checklong, checkmetatag, checknotnil, checknumber, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalidkey, compareerror, compareerror, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, div, div, div, divInto, eq_b, eq, eqmtcall, equals, error, get, get, get, getn, gettable, gt_b, gt_b, gt_b, gt, gt, gt, gteq_b, gteq_b, gteq_b, gteq, gteq, gteq, illegal, inext, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isint, isinttype, islong, isnil, isnumber, isstring, istable, isthread, isuserdata, isuserdata, isweaknil, len, lenerror, length, listOf, listOf, load, lt_b, lt_b, lt_b, lt, lt, lt, lteq_b, lteq_b, lteq_b, lteq, lteq, lteq, metatag, method, method, method, method, method, method, mod, mod, mod, modFrom, mul, mul, mul, narg, neg, neq_b, neq, next, not, optboolean, optclosure, optdouble, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, or, pow, pow, pow, powWith, powWith, presize, raweq, raweq, raweq, raweq, raweq, rawget, rawget, rawget, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setmetatable, settable, strcmp, strcmp, strongkey, strongvalue, strvalue, sub, sub, sub, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, tobyte, tochar, todouble, tofloat, toint, tolong, tonumber, toshort, tostring, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Field Detail
- -

-TMP_PREFIX

-
-public static java.lang.String TMP_PREFIX
-
-
-
-
-
- -

-TMP_SUFFIX

-
-public static java.lang.String TMP_SUFFIX
-
-
-
-
- - - - - - - - -
-Constructor Detail
- -

-OsLib

-
-public OsLib()
-
-
Create and OsLib instance. -

-

- - - - - - - - -
-Method Detail
- -

-init

-
-public LuaValue init()
-
-
-
-
-
-
- -

-invoke

-
-public Varargs invoke(Varargs args)
-
-
Description copied from class: VarArgFunction
-
Override and implement for the best performance. - May not have expected behavior for tail calls. - Should not be used if either: - - function needs to be used as a module - - function has a possibility of returning a TailcallVarargs -

-

-
Overrides:
invoke in class VarArgFunction
-
-
-
Parameters:
args - the arguments to the function call. -
Returns:
All return values as a Varargs instance.
See Also:
LuaValue.varargsOf(LuaValue[]), -LuaValue.call(LuaValue), -LuaValue.invoke(), -LuaValue.invoke(LuaValue,Varargs), -LuaValue.invokemethod(String,Varargs), -LuaValue.invokemethod(LuaValue,Varargs)
-
-
-
- -

-clock

-
-protected double clock()
-
-
- -
Returns:
an approximation of the amount in seconds of CPU time used by - the program.
-
-
-
- -

-difftime

-
-protected double difftime(double t2,
-                          double t1)
-
-
Returns the number of seconds from time t1 to time t2. - In POSIX, Windows, and some other systems, this value is exactly t2-t1. -

-

-
Parameters:
t2 -
t1 - -
Returns:
diffeence in time values, in seconds
-
-
-
- -

-date

-
-protected java.lang.String date(java.lang.String format,
-                                double time)
-
-
If the time argument is present, this is the time to be formatted - (see the os.time function for a description of this value). - Otherwise, date formats the current time. - - If format starts with '!', then the date is formatted in Coordinated - Universal Time. After this optional character, if format is the string - "*t", then date returns a table with the following fields: year - (four digits), month (1--12), day (1--31), hour (0--23), min (0--59), - sec (0--61), wday (weekday, Sunday is 1), yday (day of the year), - and isdst (daylight saving flag, a boolean). - - If format is not "*t", then date returns the date as a string, - formatted according to the same rules as the C function strftime. - - When called without arguments, date returns a reasonable date and - time representation that depends on the host system and on the - current locale (that is, os.date() is equivalent to os.date("%c")). -

-

-
Parameters:
format -
time - time since epoch, or -1 if not supplied -
Returns:
a LString or a LTable containing date and time, - formatted according to the given string format.
-
-
-
- -

-execute

-
-protected int execute(java.lang.String command)
-
-
This function is equivalent to the C function system. - It passes command to be executed by an operating system shell. - It returns a status code, which is system-dependent. - If command is absent, then it returns nonzero if a shell - is available and zero otherwise. -

-

-
Parameters:
command - command to pass to the system
-
-
-
- -

-exit

-
-protected void exit(int code)
-
-
Calls the C function exit, with an optional code, to terminate the host program. -

-

-
Parameters:
code -
-
-
-
- -

-getenv

-
-protected java.lang.String getenv(java.lang.String varname)
-
-
Returns the value of the process environment variable varname, - or null if the variable is not defined. -

-

-
Parameters:
varname - -
Returns:
String value, or null if not defined
-
-
-
- -

-remove

-
-protected void remove(java.lang.String filename)
-               throws java.io.IOException
-
-
Deletes the file or directory with the given name. - Directories must be empty to be removed. - If this function fails, it throws and IOException -

-

-
Parameters:
filename - -
Throws: -
java.io.IOException - if it fails
-
-
-
- -

-rename

-
-protected void rename(java.lang.String oldname,
-                      java.lang.String newname)
-               throws java.io.IOException
-
-
Renames file or directory named oldname to newname. - If this function fails,it throws and IOException -

-

-
Parameters:
oldname - old file name
newname - new file name -
Throws: -
java.io.IOException - if it fails
-
-
-
- -

-setlocale

-
-protected java.lang.String setlocale(java.lang.String locale,
-                                     java.lang.String category)
-
-
Sets the current locale of the program. locale is a string specifying - a locale; category is an optional string describing which category to change: - "all", "collate", "ctype", "monetary", "numeric", or "time"; the default category - is "all". - - If locale is the empty string, the current locale is set to an implementation- - defined native locale. If locale is the string "C", the current locale is set - to the standard C locale. - - When called with null as the first argument, this function only returns the - name of the current locale for the given category. -

-

-
Parameters:
locale -
category - -
Returns:
the name of the new locale, or null if the request - cannot be honored.
-
-
-
- -

-time

-
-protected long time(LuaTable table)
-
-
Returns the current time when called without arguments, - or a time representing the date and time specified by the given table. - This table must have fields year, month, and day, - and may have fields hour, min, sec, and isdst - (for a description of these fields, see the os.date function). -

-

-
Parameters:
table - -
Returns:
long value for the time
-
-
-
- -

-tmpname

-
-protected java.lang.String tmpname()
-
-
Returns a string with a file name that can be used for a temporary file. - The file must be explicitly opened before its use and explicitly removed - when no longer needed. - - On some systems (POSIX), this function also creates a file with that name, - to avoid security risks. (Someone else might create the file with wrong - permissions in the time between getting the name and creating the file.) - You still have to open the file to use it and to remove it (even if you - do not use it). -

-

- -
Returns:
String filename to use
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/PackageLib.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/PackageLib.html deleted file mode 100644 index 0ae9595a4..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/PackageLib.html +++ /dev/null @@ -1,772 +0,0 @@ - - - - - - -PackageLib (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2.lib -
-Class PackageLib

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.LuaFunction
-              extended by org.luaj.vm2.lib.LibFunction
-                  extended by org.luaj.vm2.lib.OneArgFunction
-                      extended by org.luaj.vm2.lib.PackageLib
-
-
-
-
public class PackageLib
extends OneArgFunction
- - -

-Subclass of LibFunction which implements the lua standard package and module - library functions. - -

- Typically, this library is included as part of a call to either - JsePlatform#standardGlobals() or JmePlatform#standardGlobals() -

- To instantiate and use it directly, - link it into your globals table via LuaValue.load(LuaValue) using code such as: -

 LuaTable _G = new LuaTable();
- LuaThread.setGlobals(_G);
- _G.load(new BaseLib());
- _G.load(new PackageLib());
- System.out.println( _G.get("require").call(LuaValue.valueOf("hyperbolic")) );
-  
- In practice, the first 4 lines of the above are minimal requirements to get - and initialize a globals table capable of basic reqire, print, and other functions, - so it is much more convenient to use the JsePlatform and JmePlatform - utility classes instead. -

- This has been implemented to match as closely as possible the behavior in the corresponding library in C. - However, the default filesystem search semantics are different and delegated to the bas library - as outlined in the BaseLib and JseBaseLib documetnation. -

- -

-

-
See Also:
LibFunction, -BaseLib, -JseBaseLib, -JsePlatform, -JmePlatform, -http://www.lua.org/manual/5.1/manual.html#5.3
-
- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Field Summary
-static java.lang.StringDEFAULT_LUA_PATH - -
-           
-static PackageLibinstance - -
-          Most recent instance of PackageLib
- LuaValuejava_loader - -
-          Loader that loads as a Java class.
- LuaTableLOADED - -
-           
- LuaValuelua_loader - -
-          Loader that loads as a lua script using the LUA_PATH
- LuaTablePACKAGE - -
-           
- LuaValuepreload_loader - -
-          Loader that loads from preload table if found there
- java.io.InputStreamSTDIN - -
-           
- java.io.PrintStreamSTDOUT - -
-           
- - - - - - - -
Fields inherited from class org.luaj.vm2.lib.LibFunction
name, opcode
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaFunction
env, s_metatable
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - -
-Constructor Summary
PackageLib() - -
-           
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
- LuaValuecall(LuaValue arg) - -
-          Call this with 1 argument, including metatag processing, - and return only the first return value.
-static Varargsloadlib(Varargs args) - -
-           
- Varargsmodule(Varargs args) - -
-          module (name [, ...]) - - Creates a module.
- LuaValuerequire(LuaValue arg) - -
-          require (modname) - - Loads the given module.
- voidsetIsLoaded(java.lang.String name, - LuaTable value) - -
-          Allow packages to mark themselves as loaded
- voidsetLuaPath(java.lang.String newLuaPath) - -
-           
-static java.lang.StringtoClassname(java.lang.String filename) - -
-          Convert lua filename to valid class name
- java.lang.Stringtojstring() - -
-          Convert to human readable String for any type.
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.OneArgFunction
call, call, call, invoke
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.LibFunction
bind, bind, newupe, newupl, newupn
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaFunction
checkfunction, getfenv, getmetatable, isfunction, optfunction, setfenv, type, typename
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
add, add, add, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, callmt, checkboolean, checkclosure, checkdouble, checkint, checkinteger, checkjstring, checklong, checkmetatag, checknotnil, checknumber, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalidkey, compareerror, compareerror, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, div, div, div, divInto, eq_b, eq, eqmtcall, equals, error, get, get, get, getn, gettable, gt_b, gt_b, gt_b, gt, gt, gt, gteq_b, gteq_b, gteq_b, gteq, gteq, gteq, illegal, inext, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isint, isinttype, islong, isnil, isnumber, isstring, istable, isthread, isuserdata, isuserdata, isweaknil, len, lenerror, length, listOf, listOf, load, lt_b, lt_b, lt_b, lt, lt, lt, lteq_b, lteq_b, lteq_b, lteq, lteq, lteq, metatag, method, method, method, method, method, method, mod, mod, mod, modFrom, mul, mul, mul, narg, neg, neq_b, neq, next, not, onInvoke, optboolean, optclosure, optdouble, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, or, pow, pow, pow, powWith, powWith, presize, raweq, raweq, raweq, raweq, raweq, rawget, rawget, rawget, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setmetatable, settable, strcmp, strcmp, strongkey, strongvalue, strvalue, sub, sub, sub, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, tobyte, tochar, todouble, tofloat, toint, tolong, tonumber, toshort, tostring, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Field Detail
- -

-DEFAULT_LUA_PATH

-
-public static java.lang.String DEFAULT_LUA_PATH
-
-
-
-
-
- -

-STDIN

-
-public java.io.InputStream STDIN
-
-
-
-
-
- -

-STDOUT

-
-public java.io.PrintStream STDOUT
-
-
-
-
-
- -

-LOADED

-
-public LuaTable LOADED
-
-
-
-
-
- -

-PACKAGE

-
-public LuaTable PACKAGE
-
-
-
-
-
- -

-instance

-
-public static PackageLib instance
-
-
Most recent instance of PackageLib -

-

-
-
-
- -

-preload_loader

-
-public LuaValue preload_loader
-
-
Loader that loads from preload table if found there -

-

-
-
-
- -

-lua_loader

-
-public LuaValue lua_loader
-
-
Loader that loads as a lua script using the LUA_PATH -

-

-
-
-
- -

-java_loader

-
-public LuaValue java_loader
-
-
Loader that loads as a Java class. Class must have public constructor and be a LuaValue -

-

-
-
- - - - - - - - -
-Constructor Detail
- -

-PackageLib

-
-public PackageLib()
-
-
- - - - - - - - -
-Method Detail
- -

-call

-
-public LuaValue call(LuaValue arg)
-
-
Description copied from class: LuaValue
-
Call this with 1 argument, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use LuaValue.invoke() instead. -

- To call this as a method call, use LuaValue.method(LuaValue) instead. -

-

-
Specified by:
call in class OneArgFunction
-
-
-
Parameters:
arg - First argument to supply to the called function -
Returns:
First return value (this(arg)), or NIL if there were none.
See Also:
LuaValue.call(), -LuaValue.call(LuaValue,LuaValue), -LuaValue.call(LuaValue, LuaValue, LuaValue), -#invoke(LuaValue), -LuaValue.method(String,LuaValue), -LuaValue.method(LuaValue,LuaValue)
-
-
-
- -

-setIsLoaded

-
-public void setIsLoaded(java.lang.String name,
-                        LuaTable value)
-
-
Allow packages to mark themselves as loaded -

-

-
-
-
-
- -

-setLuaPath

-
-public void setLuaPath(java.lang.String newLuaPath)
-
-
-
-
-
-
- -

-tojstring

-
-public java.lang.String tojstring()
-
-
Description copied from class: LuaValue
-
Convert to human readable String for any type. -

-

-
Overrides:
tojstring in class LibFunction
-
-
- -
Returns:
String for use by human readers based on type.
See Also:
LuaValue.tostring(), -LuaValue.optjstring(String), -LuaValue.checkjstring(), -LuaValue.isstring(), -TSTRING
-
-
-
- -

-module

-
-public Varargs module(Varargs args)
-
-
module (name [, ...]) - - Creates a module. If there is a table in package.loaded[name], this table - is the module. Otherwise, if there is a global table t with the given - name, this table is the module. Otherwise creates a new table t and sets - it as the value of the global name and the value of package.loaded[name]. - This function also initializes t._NAME with the given name, t._M with the - module (t itself), and t._PACKAGE with the package name (the full module - name minus last component; see below). Finally, module sets t as the new - environment of the current function and the new value of - package.loaded[name], so that require returns t. - - If name is a compound name (that is, one with components separated by - dots), module creates (or reuses, if they already exist) tables for each - component. For instance, if name is a.b.c, then module stores the module - table in field c of field b of global a. - - This function may receive optional options after the module name, where - each option is a function to be applied over the module. -

-

-
-
-
-
- -

-require

-
-public LuaValue require(LuaValue arg)
-
-
require (modname) - - Loads the given module. The function starts by looking into the package.loaded table to - determine whether modname is already loaded. If it is, then require returns the value - stored at package.loaded[modname]. Otherwise, it tries to find a loader for the module. - - To find a loader, require is guided by the package.loaders array. By changing this array, - we can change how require looks for a module. The following explanation is based on the - default configuration for package.loaders. - - First require queries package.preload[modname]. If it has a value, this value - (which should be a function) is the loader. Otherwise require searches for a Lua loader - using the path stored in package.path. If that also fails, it searches for a C loader - using the path stored in package.cpath. If that also fails, it tries an all-in-one loader - (see package.loaders). - - Once a loader is found, require calls the loader with a single argument, modname. - If the loader returns any value, require assigns the returned value to package.loaded[modname]. - If the loader returns no value and has not assigned any value to package.loaded[modname], - then require assigns true to this entry. In any case, require returns the final value of - package.loaded[modname]. - - If there is any error loading or running the module, or if it cannot find any loader for - the module, then require signals an error. -

-

-
-
-
-
- -

-loadlib

-
-public static Varargs loadlib(Varargs args)
-
-
-
-
-
-
- -

-toClassname

-
-public static final java.lang.String toClassname(java.lang.String filename)
-
-
Convert lua filename to valid class name -

-

-
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/ResourceFinder.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/ResourceFinder.html deleted file mode 100644 index 81ff0032a..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/ResourceFinder.html +++ /dev/null @@ -1,234 +0,0 @@ - - - - - - -ResourceFinder (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2.lib -
-Interface ResourceFinder

-
-
All Known Implementing Classes:
BaseLib, JseBaseLib
-
-
-
-
public interface ResourceFinder
- - -

-Interface for opening application resource files such as scripts sources. -

- This is used by required to load files that are part of - the application, and implemented by BaseLib - for both the Jme and Jse platforms. -

- The Jme version of base lib BaseLib - implements BaseLib.FINDER via Class.getResourceAsStream(String), - while the Jse version JseBaseLib implements it using File.File(String). -

- The io library does not use this API for file manipulation. -

-

- -

-

-
See Also:
BaseLib, -BaseLib.FINDER, -JseBaseLib, -JmePlatform, -JsePlatform
-
- -

- - - - - - - - - - - - -
-Method Summary
- java.io.InputStreamfindResource(java.lang.String filename) - -
-          Try to open a file, or return null if not found.
-  -

- - - - - - - - -
-Method Detail
- -

-findResource

-
-java.io.InputStream findResource(java.lang.String filename)
-
-
Try to open a file, or return null if not found. -

-

-
Parameters:
filename - -
Returns:
InputStream, or null if not found.
See Also:
BaseLib, -JseBaseLib
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/StringLib.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/StringLib.html deleted file mode 100644 index 33403d285..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/StringLib.html +++ /dev/null @@ -1,445 +0,0 @@ - - - - - - -StringLib (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2.lib -
-Class StringLib

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.LuaFunction
-              extended by org.luaj.vm2.lib.LibFunction
-                  extended by org.luaj.vm2.lib.OneArgFunction
-                      extended by org.luaj.vm2.lib.StringLib
-
-
-
-
public class StringLib
extends OneArgFunction
- - -

-Subclass of LibFunction which implements the lua standard string - library. - -

- Typically, this library is included as part of a call to either - JsePlatform#standardGlobals() or JmePlatform#standardGlobals() -

- To instantiate and use it directly, - link it into your globals table via LuaValue.load(LuaValue) using code such as: -

 LuaTable _G = new LuaTable();
- LuaThread.setGlobals(_G);
- _G.load(new BaseLib());
- _G.load(new PackageLib());
- _G.load(new StringLib());
- System.out.println( _G.get("string").get("upper").call( LuaValue.valueOf("abcde") ) );
-  
- Doing so will ensure the library is properly initialized - and loaded into the globals table. -

- This is a direct port of the corresponding library in C. -

- -

-

-
See Also:
LibFunction, -JsePlatform, -JmePlatform, -http://www.lua.org/manual/5.1/manual.html#5.4
-
- -

- - - - - - - - - - - -
-Field Summary
-static LuaTableinstance - -
-           
- - - - - - - -
Fields inherited from class org.luaj.vm2.lib.LibFunction
name, opcode
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaFunction
env, s_metatable
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - -
-Constructor Summary
StringLib() - -
-           
-  - - - - - - - - - - - - - - - -
-Method Summary
- LuaValuecall(LuaValue arg) - -
-          Call this with 1 argument, including metatag processing, - and return only the first return value.
-static Varargschar_(Varargs args) - -
-          string.char (...) - - Receives zero or more integers.
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.OneArgFunction
call, call, call, invoke
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.LibFunction
bind, bind, newupe, newupl, newupn, tojstring
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaFunction
checkfunction, getfenv, getmetatable, isfunction, optfunction, setfenv, type, typename
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
add, add, add, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, callmt, checkboolean, checkclosure, checkdouble, checkint, checkinteger, checkjstring, checklong, checkmetatag, checknotnil, checknumber, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalidkey, compareerror, compareerror, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, div, div, div, divInto, eq_b, eq, eqmtcall, equals, error, get, get, get, getn, gettable, gt_b, gt_b, gt_b, gt, gt, gt, gteq_b, gteq_b, gteq_b, gteq, gteq, gteq, illegal, inext, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isint, isinttype, islong, isnil, isnumber, isstring, istable, isthread, isuserdata, isuserdata, isweaknil, len, lenerror, length, listOf, listOf, load, lt_b, lt_b, lt_b, lt, lt, lt, lteq_b, lteq_b, lteq_b, lteq, lteq, lteq, metatag, method, method, method, method, method, method, mod, mod, mod, modFrom, mul, mul, mul, narg, neg, neq_b, neq, next, not, onInvoke, optboolean, optclosure, optdouble, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, or, pow, pow, pow, powWith, powWith, presize, raweq, raweq, raweq, raweq, raweq, rawget, rawget, rawget, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setmetatable, settable, strcmp, strcmp, strongkey, strongvalue, strvalue, sub, sub, sub, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, tobyte, tochar, todouble, tofloat, toint, tolong, tonumber, toshort, tostring, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Field Detail
- -

-instance

-
-public static LuaTable instance
-
-
-
-
- - - - - - - - -
-Constructor Detail
- -

-StringLib

-
-public StringLib()
-
-
- - - - - - - - -
-Method Detail
- -

-call

-
-public LuaValue call(LuaValue arg)
-
-
Description copied from class: LuaValue
-
Call this with 1 argument, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use LuaValue.invoke() instead. -

- To call this as a method call, use LuaValue.method(LuaValue) instead. -

-

-
Specified by:
call in class OneArgFunction
-
-
-
Parameters:
arg - First argument to supply to the called function -
Returns:
First return value (this(arg)), or NIL if there were none.
See Also:
LuaValue.call(), -LuaValue.call(LuaValue,LuaValue), -LuaValue.call(LuaValue, LuaValue, LuaValue), -#invoke(LuaValue), -LuaValue.method(String,LuaValue), -LuaValue.method(LuaValue,LuaValue)
-
-
-
- -

-char_

-
-public static Varargs char_(Varargs args)
-
-
string.char (...) - - Receives zero or more integers. Returns a string with length equal - to the number of arguments, in which each character has the internal - numerical code equal to its corresponding argument. - - Note that numerical codes are not necessarily portable across platforms. -

-

-
Parameters:
args - the calling VM
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/TableLib.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/TableLib.html deleted file mode 100644 index bd0c8bab1..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/TableLib.html +++ /dev/null @@ -1,393 +0,0 @@ - - - - - - -TableLib (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2.lib -
-Class TableLib

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.LuaFunction
-              extended by org.luaj.vm2.lib.LibFunction
-                  extended by org.luaj.vm2.lib.OneArgFunction
-                      extended by org.luaj.vm2.lib.TableLib
-
-
-
-
public class TableLib
extends OneArgFunction
- - -

-Subclass of LibFunction which implements the lua standard table - library. - -

- Typically, this library is included as part of a call to either - JsePlatform#standardGlobals() or JmePlatform#standardGlobals() -

- To instantiate and use it directly, - link it into your globals table via LuaValue.load(LuaValue) using code such as: -

 LuaTable _G = new LuaTable();
- LuaThread.setGlobals(_G);
- _G.load(new BaseLib());
- _G.load(new PackageLib());
- _G.load(new TableLib());
- LuaValue tbl = LuaValue.listOf( new LuaValue[] {
- 		LuaValue.valueOf( "abc" ),
- 		LuaValue.valueOf( "def" ) } );
- LuaValue sep = LuaValue.valueOf( "-" );
- System.out.println( _G.get("table").get("concat").call( tbl, sep ) );
-  
- Doing so will ensure the library is properly initialized - and loaded into the globals table. -

- This has been implemented to match as closely as possible the behavior in the corresponding library in C. -

- -

-

-
See Also:
LibFunction, -JsePlatform, -JmePlatform, -http://www.lua.org/manual/5.1/manual.html#5.5
-
- -

- - - - - - - -
-Field Summary
- - - - - - - -
Fields inherited from class org.luaj.vm2.lib.LibFunction
name, opcode
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaFunction
env, s_metatable
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - -
-Constructor Summary
TableLib() - -
-           
-  - - - - - - - - - - - -
-Method Summary
- LuaValuecall(LuaValue arg) - -
-          Call this with 1 argument, including metatag processing, - and return only the first return value.
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.OneArgFunction
call, call, call, invoke
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.LibFunction
bind, bind, newupe, newupl, newupn, tojstring
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaFunction
checkfunction, getfenv, getmetatable, isfunction, optfunction, setfenv, type, typename
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
add, add, add, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, callmt, checkboolean, checkclosure, checkdouble, checkint, checkinteger, checkjstring, checklong, checkmetatag, checknotnil, checknumber, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalidkey, compareerror, compareerror, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, div, div, div, divInto, eq_b, eq, eqmtcall, equals, error, get, get, get, getn, gettable, gt_b, gt_b, gt_b, gt, gt, gt, gteq_b, gteq_b, gteq_b, gteq, gteq, gteq, illegal, inext, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isint, isinttype, islong, isnil, isnumber, isstring, istable, isthread, isuserdata, isuserdata, isweaknil, len, lenerror, length, listOf, listOf, load, lt_b, lt_b, lt_b, lt, lt, lt, lteq_b, lteq_b, lteq_b, lteq, lteq, lteq, metatag, method, method, method, method, method, method, mod, mod, mod, modFrom, mul, mul, mul, narg, neg, neq_b, neq, next, not, onInvoke, optboolean, optclosure, optdouble, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, or, pow, pow, pow, powWith, powWith, presize, raweq, raweq, raweq, raweq, raweq, rawget, rawget, rawget, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setmetatable, settable, strcmp, strcmp, strongkey, strongvalue, strvalue, sub, sub, sub, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, tobyte, tochar, todouble, tofloat, toint, tolong, tonumber, toshort, tostring, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Constructor Detail
- -

-TableLib

-
-public TableLib()
-
-
- - - - - - - - -
-Method Detail
- -

-call

-
-public LuaValue call(LuaValue arg)
-
-
Description copied from class: LuaValue
-
Call this with 1 argument, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use LuaValue.invoke() instead. -

- To call this as a method call, use LuaValue.method(LuaValue) instead. -

-

-
Specified by:
call in class OneArgFunction
-
-
-
Parameters:
arg - First argument to supply to the called function -
Returns:
First return value (this(arg)), or NIL if there were none.
See Also:
LuaValue.call(), -LuaValue.call(LuaValue,LuaValue), -LuaValue.call(LuaValue, LuaValue, LuaValue), -#invoke(LuaValue), -LuaValue.method(String,LuaValue), -LuaValue.method(LuaValue,LuaValue)
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/ThreeArgFunction.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/ThreeArgFunction.html deleted file mode 100644 index 7a5bdd728..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/ThreeArgFunction.html +++ /dev/null @@ -1,568 +0,0 @@ - - - - - - -ThreeArgFunction (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2.lib -
-Class ThreeArgFunction

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.LuaFunction
-              extended by org.luaj.vm2.lib.LibFunction
-                  extended by org.luaj.vm2.lib.ThreeArgFunction
-
-
-
-
public abstract class ThreeArgFunction
extends LibFunction
- - -

-Abstract base class for Java function implementations that take two arguments and - return one value. -

- Subclasses need only implement LuaValue.call(LuaValue,LuaValue,LuaValue) to complete this class, - simplifying development. - All other uses of call(), invoke(Varargs),etc, - are routed through this method by this class, - dropping or extending arguments with nil values as required. -

- If more or less than three arguments are required, - or variable argument or variable return values, - then use one of the related function - ZeroArgFunction, OneArgFunction, TwoArgFunction, or VarArgFunction. -

- See LibFunction for more information on implementation libraries and library functions. -

- -

-

-
See Also:
call(LuaValue,LuaValue,LuaValue), -LibFunction, -ZeroArgFunction, -OneArgFunction, -TwoArgFunction, -VarArgFunction
-
- -

- - - - - - - -
-Field Summary
- - - - - - - -
Fields inherited from class org.luaj.vm2.lib.LibFunction
name, opcode
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaFunction
env, s_metatable
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - - - - -
-Constructor Summary
ThreeArgFunction() - -
-          Default constructor
ThreeArgFunction(LuaValue env) - -
-          Constructor with specific environment
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
- LuaValuecall() - -
-          Call this with 0 arguments, including metatag processing, - and return only the first return value.
- LuaValuecall(LuaValue arg) - -
-          Call this with 1 argument, including metatag processing, - and return only the first return value.
- LuaValuecall(LuaValue arg1, - LuaValue arg2) - -
-          Call this with 2 arguments, including metatag processing, - and return only the first return value.
-abstract  LuaValuecall(LuaValue arg1, - LuaValue arg2, - LuaValue arg3) - -
-          Call this with 3 arguments, including metatag processing, - and return only the first return value.
- Varargsinvoke(Varargs varargs) - -
-          Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs.
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.LibFunction
bind, bind, newupe, newupl, newupn, tojstring
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaFunction
checkfunction, getfenv, getmetatable, isfunction, optfunction, setfenv, type, typename
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
add, add, add, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, callmt, checkboolean, checkclosure, checkdouble, checkint, checkinteger, checkjstring, checklong, checkmetatag, checknotnil, checknumber, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalidkey, compareerror, compareerror, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, div, div, div, divInto, eq_b, eq, eqmtcall, equals, error, get, get, get, getn, gettable, gt_b, gt_b, gt_b, gt, gt, gt, gteq_b, gteq_b, gteq_b, gteq, gteq, gteq, illegal, inext, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isint, isinttype, islong, isnil, isnumber, isstring, istable, isthread, isuserdata, isuserdata, isweaknil, len, lenerror, length, listOf, listOf, load, lt_b, lt_b, lt_b, lt, lt, lt, lteq_b, lteq_b, lteq_b, lteq, lteq, lteq, metatag, method, method, method, method, method, method, mod, mod, mod, modFrom, mul, mul, mul, narg, neg, neq_b, neq, next, not, onInvoke, optboolean, optclosure, optdouble, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, or, pow, pow, pow, powWith, powWith, presize, raweq, raweq, raweq, raweq, raweq, rawget, rawget, rawget, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setmetatable, settable, strcmp, strcmp, strongkey, strongvalue, strvalue, sub, sub, sub, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, tobyte, tochar, todouble, tofloat, toint, tolong, tonumber, toshort, tostring, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Constructor Detail
- -

-ThreeArgFunction

-
-public ThreeArgFunction()
-
-
Default constructor -

-

-
- -

-ThreeArgFunction

-
-public ThreeArgFunction(LuaValue env)
-
-
Constructor with specific environment -

-

-
Parameters:
env - The environment to apply during constructon.
-
- - - - - - - - -
-Method Detail
- -

-call

-
-public abstract LuaValue call(LuaValue arg1,
-                              LuaValue arg2,
-                              LuaValue arg3)
-
-
Description copied from class: LuaValue
-
Call this with 3 arguments, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use LuaValue.invoke() instead. -

- To call this as a method call, use LuaValue.method(LuaValue) instead. -

-

-
Overrides:
call in class LuaValue
-
-
-
Parameters:
arg1 - First argument to supply to the called function
arg2 - Second argument to supply to the called function
arg3 - Second argument to supply to the called function -
Returns:
First return value (this(arg1,arg2,arg3)), or NIL if there were none.
See Also:
LuaValue.call(), -LuaValue.call(LuaValue), -LuaValue.call(LuaValue, LuaValue), -#invoke(LuaValue,LuaValue, LuaValue), -LuaValue.invokemethod(String,Varargs), -LuaValue.invokemethod(LuaValue,Varargs)
-
-
-
- -

-call

-
-public final LuaValue call()
-
-
Description copied from class: LuaValue
-
Call this with 0 arguments, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use LuaValue.invoke() instead. -

- To call this as a method call, use LuaValue.method(LuaValue) instead. -

-

-
Overrides:
call in class LuaValue
-
-
- -
Returns:
First return value (this()), or NIL if there were none.
See Also:
LuaValue.call(LuaValue), -LuaValue.call(LuaValue,LuaValue), -LuaValue.call(LuaValue, LuaValue, LuaValue), -LuaValue.invoke(), -LuaValue.method(String), -LuaValue.method(LuaValue)
-
-
-
- -

-call

-
-public final LuaValue call(LuaValue arg)
-
-
Description copied from class: LuaValue
-
Call this with 1 argument, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use LuaValue.invoke() instead. -

- To call this as a method call, use LuaValue.method(LuaValue) instead. -

-

-
Overrides:
call in class LuaValue
-
-
-
Parameters:
arg - First argument to supply to the called function -
Returns:
First return value (this(arg)), or NIL if there were none.
See Also:
LuaValue.call(), -LuaValue.call(LuaValue,LuaValue), -LuaValue.call(LuaValue, LuaValue, LuaValue), -#invoke(LuaValue), -LuaValue.method(String,LuaValue), -LuaValue.method(LuaValue,LuaValue)
-
-
-
- -

-call

-
-public LuaValue call(LuaValue arg1,
-                     LuaValue arg2)
-
-
Description copied from class: LuaValue
-
Call this with 2 arguments, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use LuaValue.invoke() instead. -

- To call this as a method call, use LuaValue.method(LuaValue) instead. -

-

-
Overrides:
call in class LuaValue
-
-
-
Parameters:
arg1 - First argument to supply to the called function
arg2 - Second argument to supply to the called function -
Returns:
First return value (this(arg1,arg2)), or NIL if there were none.
See Also:
LuaValue.call(), -LuaValue.call(LuaValue), -LuaValue.call(LuaValue, LuaValue, LuaValue), -#invoke(LuaValue,LuaValue), -LuaValue.method(String,LuaValue,LuaValue), -LuaValue.method(LuaValue,LuaValue,LuaValue)
-
-
-
- -

-invoke

-
-public Varargs invoke(Varargs varargs)
-
-
Description copied from class: LuaValue
-
Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs. -

- If this is a LuaFunction, call it, and return all values. - Otherwise, look for the CALL metatag and call that. -

- To get a particular return value, us Varargs.arg(int) -

- To call this as a method call, use LuaValue.invokemethod(LuaValue) instead. -

-

-
Overrides:
invoke in class LuaValue
-
-
-
Parameters:
varargs - Varargs containing the arguments to supply to the called function -
Returns:
All return values as a Varargs instance.
See Also:
LuaValue.varargsOf(LuaValue[]), -LuaValue.call(LuaValue), -LuaValue.invoke(), -LuaValue.invoke(LuaValue,Varargs), -LuaValue.invokemethod(String,Varargs), -LuaValue.invokemethod(LuaValue,Varargs)
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/TwoArgFunction.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/TwoArgFunction.html deleted file mode 100644 index 1a51ef6b1..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/TwoArgFunction.html +++ /dev/null @@ -1,571 +0,0 @@ - - - - - - -TwoArgFunction (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2.lib -
-Class TwoArgFunction

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.LuaFunction
-              extended by org.luaj.vm2.lib.LibFunction
-                  extended by org.luaj.vm2.lib.TwoArgFunction
-
-
-
Direct Known Subclasses:
JseMathLib.JseMathLib2
-
-
-
-
public abstract class TwoArgFunction
extends LibFunction
- - -

-Abstract base class for Java function implementations that take two arguments and - return one value. -

- Subclasses need only implement LuaValue.call(LuaValue,LuaValue) to complete this class, - simplifying development. - All other uses of call(), invoke(Varargs),etc, - are routed through this method by this class, - dropping or extending arguments with nil values as required. -

- If more or less than two arguments are required, - or variable argument or variable return values, - then use one of the related function - ZeroArgFunction, OneArgFunction, ThreeArgFunction, or VarArgFunction. -

- See LibFunction for more information on implementation libraries and library functions. -

- -

-

-
See Also:
call(LuaValue,LuaValue), -LibFunction, -ZeroArgFunction, -OneArgFunction, -ThreeArgFunction, -VarArgFunction
-
- -

- - - - - - - -
-Field Summary
- - - - - - - -
Fields inherited from class org.luaj.vm2.lib.LibFunction
name, opcode
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaFunction
env, s_metatable
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - - - - -
-Constructor Summary
TwoArgFunction() - -
-          Default constructor
TwoArgFunction(LuaValue env) - -
-          Constructor with specific environment
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
- LuaValuecall() - -
-          Call this with 0 arguments, including metatag processing, - and return only the first return value.
- LuaValuecall(LuaValue arg) - -
-          Call this with 1 argument, including metatag processing, - and return only the first return value.
-abstract  LuaValuecall(LuaValue arg1, - LuaValue arg2) - -
-          Call this with 2 arguments, including metatag processing, - and return only the first return value.
- LuaValuecall(LuaValue arg1, - LuaValue arg2, - LuaValue arg3) - -
-          Call this with 3 arguments, including metatag processing, - and return only the first return value.
- Varargsinvoke(Varargs varargs) - -
-          Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs.
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.LibFunction
bind, bind, newupe, newupl, newupn, tojstring
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaFunction
checkfunction, getfenv, getmetatable, isfunction, optfunction, setfenv, type, typename
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
add, add, add, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, callmt, checkboolean, checkclosure, checkdouble, checkint, checkinteger, checkjstring, checklong, checkmetatag, checknotnil, checknumber, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalidkey, compareerror, compareerror, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, div, div, div, divInto, eq_b, eq, eqmtcall, equals, error, get, get, get, getn, gettable, gt_b, gt_b, gt_b, gt, gt, gt, gteq_b, gteq_b, gteq_b, gteq, gteq, gteq, illegal, inext, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isint, isinttype, islong, isnil, isnumber, isstring, istable, isthread, isuserdata, isuserdata, isweaknil, len, lenerror, length, listOf, listOf, load, lt_b, lt_b, lt_b, lt, lt, lt, lteq_b, lteq_b, lteq_b, lteq, lteq, lteq, metatag, method, method, method, method, method, method, mod, mod, mod, modFrom, mul, mul, mul, narg, neg, neq_b, neq, next, not, onInvoke, optboolean, optclosure, optdouble, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, or, pow, pow, pow, powWith, powWith, presize, raweq, raweq, raweq, raweq, raweq, rawget, rawget, rawget, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setmetatable, settable, strcmp, strcmp, strongkey, strongvalue, strvalue, sub, sub, sub, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, tobyte, tochar, todouble, tofloat, toint, tolong, tonumber, toshort, tostring, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Constructor Detail
- -

-TwoArgFunction

-
-public TwoArgFunction()
-
-
Default constructor -

-

-
- -

-TwoArgFunction

-
-public TwoArgFunction(LuaValue env)
-
-
Constructor with specific environment -

-

-
Parameters:
env - The environment to apply during constructon.
-
- - - - - - - - -
-Method Detail
- -

-call

-
-public abstract LuaValue call(LuaValue arg1,
-                              LuaValue arg2)
-
-
Description copied from class: LuaValue
-
Call this with 2 arguments, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use LuaValue.invoke() instead. -

- To call this as a method call, use LuaValue.method(LuaValue) instead. -

-

-
Overrides:
call in class LuaValue
-
-
-
Parameters:
arg1 - First argument to supply to the called function
arg2 - Second argument to supply to the called function -
Returns:
First return value (this(arg1,arg2)), or NIL if there were none.
See Also:
LuaValue.call(), -LuaValue.call(LuaValue), -LuaValue.call(LuaValue, LuaValue, LuaValue), -#invoke(LuaValue,LuaValue), -LuaValue.method(String,LuaValue,LuaValue), -LuaValue.method(LuaValue,LuaValue,LuaValue)
-
-
-
- -

-call

-
-public final LuaValue call()
-
-
Description copied from class: LuaValue
-
Call this with 0 arguments, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use LuaValue.invoke() instead. -

- To call this as a method call, use LuaValue.method(LuaValue) instead. -

-

-
Overrides:
call in class LuaValue
-
-
- -
Returns:
First return value (this()), or NIL if there were none.
See Also:
LuaValue.call(LuaValue), -LuaValue.call(LuaValue,LuaValue), -LuaValue.call(LuaValue, LuaValue, LuaValue), -LuaValue.invoke(), -LuaValue.method(String), -LuaValue.method(LuaValue)
-
-
-
- -

-call

-
-public final LuaValue call(LuaValue arg)
-
-
Description copied from class: LuaValue
-
Call this with 1 argument, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use LuaValue.invoke() instead. -

- To call this as a method call, use LuaValue.method(LuaValue) instead. -

-

-
Overrides:
call in class LuaValue
-
-
-
Parameters:
arg - First argument to supply to the called function -
Returns:
First return value (this(arg)), or NIL if there were none.
See Also:
LuaValue.call(), -LuaValue.call(LuaValue,LuaValue), -LuaValue.call(LuaValue, LuaValue, LuaValue), -#invoke(LuaValue), -LuaValue.method(String,LuaValue), -LuaValue.method(LuaValue,LuaValue)
-
-
-
- -

-call

-
-public LuaValue call(LuaValue arg1,
-                     LuaValue arg2,
-                     LuaValue arg3)
-
-
Description copied from class: LuaValue
-
Call this with 3 arguments, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use LuaValue.invoke() instead. -

- To call this as a method call, use LuaValue.method(LuaValue) instead. -

-

-
Overrides:
call in class LuaValue
-
-
-
Parameters:
arg1 - First argument to supply to the called function
arg2 - Second argument to supply to the called function
arg3 - Second argument to supply to the called function -
Returns:
First return value (this(arg1,arg2,arg3)), or NIL if there were none.
See Also:
LuaValue.call(), -LuaValue.call(LuaValue), -LuaValue.call(LuaValue, LuaValue), -#invoke(LuaValue,LuaValue, LuaValue), -LuaValue.invokemethod(String,Varargs), -LuaValue.invokemethod(LuaValue,Varargs)
-
-
-
- -

-invoke

-
-public Varargs invoke(Varargs varargs)
-
-
Description copied from class: LuaValue
-
Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs. -

- If this is a LuaFunction, call it, and return all values. - Otherwise, look for the CALL metatag and call that. -

- To get a particular return value, us Varargs.arg(int) -

- To call this as a method call, use LuaValue.invokemethod(LuaValue) instead. -

-

-
Overrides:
invoke in class LuaValue
-
-
-
Parameters:
varargs - Varargs containing the arguments to supply to the called function -
Returns:
All return values as a Varargs instance.
See Also:
LuaValue.varargsOf(LuaValue[]), -LuaValue.call(LuaValue), -LuaValue.invoke(), -LuaValue.invoke(LuaValue,Varargs), -LuaValue.invokemethod(String,Varargs), -LuaValue.invokemethod(LuaValue,Varargs)
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/VarArgFunction.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/VarArgFunction.html deleted file mode 100644 index 90bc5e636..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/VarArgFunction.html +++ /dev/null @@ -1,590 +0,0 @@ - - - - - - -VarArgFunction (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2.lib -
-Class VarArgFunction

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.LuaFunction
-              extended by org.luaj.vm2.lib.LibFunction
-                  extended by org.luaj.vm2.lib.VarArgFunction
-
-
-
Direct Known Subclasses:
CoroutineLib, DebugLib, LuajavaLib, OsLib
-
-
-
-
public abstract class VarArgFunction
extends LibFunction
- - -

-Abstract base class for Java function implementations that takes varaiable arguments and - returns multiple return values. -

- Subclasses need only implement LuaValue.invoke(Varargs) to complete this class, - simplifying development. - All other uses of call(LuaValue), LuaValue.invoke(),etc, - are routed through this method by this class, - converting arguments to and - dropping or extending return values with nil values as required. -

- If between one and three arguments are required, and only one return value is returned, - ZeroArgFunction, OneArgFunction, TwoArgFunction, or ThreeArgFunction. -

- See LibFunction for more information on implementation libraries and library functions. -

- -

-

-
See Also:
invoke(Varargs), -LibFunction, -ZeroArgFunction, -OneArgFunction, -TwoArgFunction, -ThreeArgFunction
-
- -

- - - - - - - -
-Field Summary
- - - - - - - -
Fields inherited from class org.luaj.vm2.lib.LibFunction
name, opcode
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaFunction
env, s_metatable
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - - - - -
-Constructor Summary
VarArgFunction() - -
-           
VarArgFunction(LuaValue env) - -
-           
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
- LuaValuecall() - -
-          Call this with 0 arguments, including metatag processing, - and return only the first return value.
- LuaValuecall(LuaValue arg) - -
-          Call this with 1 argument, including metatag processing, - and return only the first return value.
- LuaValuecall(LuaValue arg1, - LuaValue arg2) - -
-          Call this with 2 arguments, including metatag processing, - and return only the first return value.
- LuaValuecall(LuaValue arg1, - LuaValue arg2, - LuaValue arg3) - -
-          Call this with 3 arguments, including metatag processing, - and return only the first return value.
- Varargsinvoke(Varargs args) - -
-          Override and implement for the best performance.
- VarargsonInvoke(Varargs args) - -
-          Override to provide a call implementation that runs in an environment - that can participate in setfenv, and behaves as expected - when returning TailcallVarargs.
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.LibFunction
bind, bind, newupe, newupl, newupn, tojstring
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaFunction
checkfunction, getfenv, getmetatable, isfunction, optfunction, setfenv, type, typename
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
add, add, add, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, callmt, checkboolean, checkclosure, checkdouble, checkint, checkinteger, checkjstring, checklong, checkmetatag, checknotnil, checknumber, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalidkey, compareerror, compareerror, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, div, div, div, divInto, eq_b, eq, eqmtcall, equals, error, get, get, get, getn, gettable, gt_b, gt_b, gt_b, gt, gt, gt, gteq_b, gteq_b, gteq_b, gteq, gteq, gteq, illegal, inext, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isint, isinttype, islong, isnil, isnumber, isstring, istable, isthread, isuserdata, isuserdata, isweaknil, len, lenerror, length, listOf, listOf, load, lt_b, lt_b, lt_b, lt, lt, lt, lteq_b, lteq_b, lteq_b, lteq, lteq, lteq, metatag, method, method, method, method, method, method, mod, mod, mod, modFrom, mul, mul, mul, narg, neg, neq_b, neq, next, not, optboolean, optclosure, optdouble, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, or, pow, pow, pow, powWith, powWith, presize, raweq, raweq, raweq, raweq, raweq, rawget, rawget, rawget, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setmetatable, settable, strcmp, strcmp, strongkey, strongvalue, strvalue, sub, sub, sub, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, tobyte, tochar, todouble, tofloat, toint, tolong, tonumber, toshort, tostring, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Constructor Detail
- -

-VarArgFunction

-
-public VarArgFunction()
-
-
-
- -

-VarArgFunction

-
-public VarArgFunction(LuaValue env)
-
-
- - - - - - - - -
-Method Detail
- -

-call

-
-public LuaValue call()
-
-
Description copied from class: LuaValue
-
Call this with 0 arguments, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use LuaValue.invoke() instead. -

- To call this as a method call, use LuaValue.method(LuaValue) instead. -

-

-
Overrides:
call in class LuaValue
-
-
- -
Returns:
First return value (this()), or NIL if there were none.
See Also:
LuaValue.call(LuaValue), -LuaValue.call(LuaValue,LuaValue), -LuaValue.call(LuaValue, LuaValue, LuaValue), -LuaValue.invoke(), -LuaValue.method(String), -LuaValue.method(LuaValue)
-
-
-
- -

-call

-
-public LuaValue call(LuaValue arg)
-
-
Description copied from class: LuaValue
-
Call this with 1 argument, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use LuaValue.invoke() instead. -

- To call this as a method call, use LuaValue.method(LuaValue) instead. -

-

-
Overrides:
call in class LuaValue
-
-
-
Parameters:
arg - First argument to supply to the called function -
Returns:
First return value (this(arg)), or NIL if there were none.
See Also:
LuaValue.call(), -LuaValue.call(LuaValue,LuaValue), -LuaValue.call(LuaValue, LuaValue, LuaValue), -#invoke(LuaValue), -LuaValue.method(String,LuaValue), -LuaValue.method(LuaValue,LuaValue)
-
-
-
- -

-call

-
-public LuaValue call(LuaValue arg1,
-                     LuaValue arg2)
-
-
Description copied from class: LuaValue
-
Call this with 2 arguments, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use LuaValue.invoke() instead. -

- To call this as a method call, use LuaValue.method(LuaValue) instead. -

-

-
Overrides:
call in class LuaValue
-
-
-
Parameters:
arg1 - First argument to supply to the called function
arg2 - Second argument to supply to the called function -
Returns:
First return value (this(arg1,arg2)), or NIL if there were none.
See Also:
LuaValue.call(), -LuaValue.call(LuaValue), -LuaValue.call(LuaValue, LuaValue, LuaValue), -#invoke(LuaValue,LuaValue), -LuaValue.method(String,LuaValue,LuaValue), -LuaValue.method(LuaValue,LuaValue,LuaValue)
-
-
-
- -

-call

-
-public LuaValue call(LuaValue arg1,
-                     LuaValue arg2,
-                     LuaValue arg3)
-
-
Description copied from class: LuaValue
-
Call this with 3 arguments, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use LuaValue.invoke() instead. -

- To call this as a method call, use LuaValue.method(LuaValue) instead. -

-

-
Overrides:
call in class LuaValue
-
-
-
Parameters:
arg1 - First argument to supply to the called function
arg2 - Second argument to supply to the called function
arg3 - Second argument to supply to the called function -
Returns:
First return value (this(arg1,arg2,arg3)), or NIL if there were none.
See Also:
LuaValue.call(), -LuaValue.call(LuaValue), -LuaValue.call(LuaValue, LuaValue), -#invoke(LuaValue,LuaValue, LuaValue), -LuaValue.invokemethod(String,Varargs), -LuaValue.invokemethod(LuaValue,Varargs)
-
-
-
- -

-invoke

-
-public Varargs invoke(Varargs args)
-
-
Override and implement for the best performance. - May not have expected behavior for tail calls. - Should not be used if either: - - function needs to be used as a module - - function has a possibility of returning a TailcallVarargs -

-

-
Overrides:
invoke in class LuaValue
-
-
-
Parameters:
args - the arguments to the function call. -
Returns:
All return values as a Varargs instance.
See Also:
LuaValue.varargsOf(LuaValue[]), -LuaValue.call(LuaValue), -LuaValue.invoke(), -LuaValue.invoke(LuaValue,Varargs), -LuaValue.invokemethod(String,Varargs), -LuaValue.invokemethod(LuaValue,Varargs)
-
-
-
- -

-onInvoke

-
-public Varargs onInvoke(Varargs args)
-
-
Override to provide a call implementation that runs in an environment - that can participate in setfenv, and behaves as expected - when returning TailcallVarargs. -

-

-
Overrides:
onInvoke in class LuaValue
-
-
-
Parameters:
args - the arguments to the function call. -
Returns:
Varargs the return values, possible a TailcallVarargs.
See Also:
LuaValue.call(), -LuaValue.invoke(), -LuaValue.method(LuaValue), -LuaValue.invokemethod(LuaValue)
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/ZeroArgFunction.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/ZeroArgFunction.html deleted file mode 100644 index adecefd31..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/ZeroArgFunction.html +++ /dev/null @@ -1,566 +0,0 @@ - - - - - - -ZeroArgFunction (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2.lib -
-Class ZeroArgFunction

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.LuaFunction
-              extended by org.luaj.vm2.lib.LibFunction
-                  extended by org.luaj.vm2.lib.ZeroArgFunction
-
-
-
-
public abstract class ZeroArgFunction
extends LibFunction
- - -

-Abstract base class for Java function implementations that take no arguments and - return one value. -

- Subclasses need only implement LuaValue.call() to complete this class, - simplifying development. - All other uses of call(LuaValue), invoke(Varargs),etc, - are routed through this method by this class. -

- If one or more arguments are required, or variable argument or variable return values, - then use one of the related function - OneArgFunction, TwoArgFunction, ThreeArgFunction, or VarArgFunction. -

- See LibFunction for more information on implementation libraries and library functions. -

- -

-

-
See Also:
call(), -LibFunction, -OneArgFunction, -TwoArgFunction, -ThreeArgFunction, -VarArgFunction
-
- -

- - - - - - - -
-Field Summary
- - - - - - - -
Fields inherited from class org.luaj.vm2.lib.LibFunction
name, opcode
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaFunction
env, s_metatable
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - - - - -
-Constructor Summary
ZeroArgFunction() - -
-          Default constructor
ZeroArgFunction(LuaValue env) - -
-          Constructor with specific environment
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
-abstract  LuaValuecall() - -
-          Call this with 0 arguments, including metatag processing, - and return only the first return value.
- LuaValuecall(LuaValue arg) - -
-          Call this with 1 argument, including metatag processing, - and return only the first return value.
- LuaValuecall(LuaValue arg1, - LuaValue arg2) - -
-          Call this with 2 arguments, including metatag processing, - and return only the first return value.
- LuaValuecall(LuaValue arg1, - LuaValue arg2, - LuaValue arg3) - -
-          Call this with 3 arguments, including metatag processing, - and return only the first return value.
- Varargsinvoke(Varargs varargs) - -
-          Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs.
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.LibFunction
bind, bind, newupe, newupl, newupn, tojstring
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaFunction
checkfunction, getfenv, getmetatable, isfunction, optfunction, setfenv, type, typename
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
add, add, add, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, callmt, checkboolean, checkclosure, checkdouble, checkint, checkinteger, checkjstring, checklong, checkmetatag, checknotnil, checknumber, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalidkey, compareerror, compareerror, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, div, div, div, divInto, eq_b, eq, eqmtcall, equals, error, get, get, get, getn, gettable, gt_b, gt_b, gt_b, gt, gt, gt, gteq_b, gteq_b, gteq_b, gteq, gteq, gteq, illegal, inext, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isint, isinttype, islong, isnil, isnumber, isstring, istable, isthread, isuserdata, isuserdata, isweaknil, len, lenerror, length, listOf, listOf, load, lt_b, lt_b, lt_b, lt, lt, lt, lteq_b, lteq_b, lteq_b, lteq, lteq, lteq, metatag, method, method, method, method, method, method, mod, mod, mod, modFrom, mul, mul, mul, narg, neg, neq_b, neq, next, not, onInvoke, optboolean, optclosure, optdouble, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, or, pow, pow, pow, powWith, powWith, presize, raweq, raweq, raweq, raweq, raweq, rawget, rawget, rawget, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setmetatable, settable, strcmp, strcmp, strongkey, strongvalue, strvalue, sub, sub, sub, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, tobyte, tochar, todouble, tofloat, toint, tolong, tonumber, toshort, tostring, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Constructor Detail
- -

-ZeroArgFunction

-
-public ZeroArgFunction()
-
-
Default constructor -

-

-
- -

-ZeroArgFunction

-
-public ZeroArgFunction(LuaValue env)
-
-
Constructor with specific environment -

-

-
Parameters:
env - The environment to apply during constructon.
-
- - - - - - - - -
-Method Detail
- -

-call

-
-public abstract LuaValue call()
-
-
Description copied from class: LuaValue
-
Call this with 0 arguments, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use LuaValue.invoke() instead. -

- To call this as a method call, use LuaValue.method(LuaValue) instead. -

-

-
Overrides:
call in class LuaValue
-
-
- -
Returns:
First return value (this()), or NIL if there were none.
See Also:
LuaValue.call(LuaValue), -LuaValue.call(LuaValue,LuaValue), -LuaValue.call(LuaValue, LuaValue, LuaValue), -LuaValue.invoke(), -LuaValue.method(String), -LuaValue.method(LuaValue)
-
-
-
- -

-call

-
-public LuaValue call(LuaValue arg)
-
-
Description copied from class: LuaValue
-
Call this with 1 argument, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use LuaValue.invoke() instead. -

- To call this as a method call, use LuaValue.method(LuaValue) instead. -

-

-
Overrides:
call in class LuaValue
-
-
-
Parameters:
arg - First argument to supply to the called function -
Returns:
First return value (this(arg)), or NIL if there were none.
See Also:
LuaValue.call(), -LuaValue.call(LuaValue,LuaValue), -LuaValue.call(LuaValue, LuaValue, LuaValue), -#invoke(LuaValue), -LuaValue.method(String,LuaValue), -LuaValue.method(LuaValue,LuaValue)
-
-
-
- -

-call

-
-public LuaValue call(LuaValue arg1,
-                     LuaValue arg2)
-
-
Description copied from class: LuaValue
-
Call this with 2 arguments, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use LuaValue.invoke() instead. -

- To call this as a method call, use LuaValue.method(LuaValue) instead. -

-

-
Overrides:
call in class LuaValue
-
-
-
Parameters:
arg1 - First argument to supply to the called function
arg2 - Second argument to supply to the called function -
Returns:
First return value (this(arg1,arg2)), or NIL if there were none.
See Also:
LuaValue.call(), -LuaValue.call(LuaValue), -LuaValue.call(LuaValue, LuaValue, LuaValue), -#invoke(LuaValue,LuaValue), -LuaValue.method(String,LuaValue,LuaValue), -LuaValue.method(LuaValue,LuaValue,LuaValue)
-
-
-
- -

-call

-
-public LuaValue call(LuaValue arg1,
-                     LuaValue arg2,
-                     LuaValue arg3)
-
-
Description copied from class: LuaValue
-
Call this with 3 arguments, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use LuaValue.invoke() instead. -

- To call this as a method call, use LuaValue.method(LuaValue) instead. -

-

-
Overrides:
call in class LuaValue
-
-
-
Parameters:
arg1 - First argument to supply to the called function
arg2 - Second argument to supply to the called function
arg3 - Second argument to supply to the called function -
Returns:
First return value (this(arg1,arg2,arg3)), or NIL if there were none.
See Also:
LuaValue.call(), -LuaValue.call(LuaValue), -LuaValue.call(LuaValue, LuaValue), -#invoke(LuaValue,LuaValue, LuaValue), -LuaValue.invokemethod(String,Varargs), -LuaValue.invokemethod(LuaValue,Varargs)
-
-
-
- -

-invoke

-
-public Varargs invoke(Varargs varargs)
-
-
Description copied from class: LuaValue
-
Call this with variable arguments, including metatag processing, - and retain all return values in a Varargs. -

- If this is a LuaFunction, call it, and return all values. - Otherwise, look for the CALL metatag and call that. -

- To get a particular return value, us Varargs.arg(int) -

- To call this as a method call, use LuaValue.invokemethod(LuaValue) instead. -

-

-
Overrides:
invoke in class LuaValue
-
-
-
Parameters:
varargs - Varargs containing the arguments to supply to the called function -
Returns:
All return values as a Varargs instance.
See Also:
LuaValue.varargsOf(LuaValue[]), -LuaValue.call(LuaValue), -LuaValue.invoke(), -LuaValue.invoke(LuaValue,Varargs), -LuaValue.invokemethod(String,Varargs), -LuaValue.invokemethod(LuaValue,Varargs)
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/BaseLib.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/BaseLib.html deleted file mode 100644 index bb7be7907..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/BaseLib.html +++ /dev/null @@ -1,210 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.lib.BaseLib (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.lib.BaseLib

-
- - - - - - - - - - - - - -
-Packages that use BaseLib
org.luaj.vm2.lib  
org.luaj.vm2.lib.jse  
-  -

- - - - - -
-Uses of BaseLib in org.luaj.vm2.lib
-  -

- - - - - - - - - -
Fields in org.luaj.vm2.lib declared as BaseLib
-static BaseLibBaseLib.instance - -
-           
-  -

- - - - - -
-Uses of BaseLib in org.luaj.vm2.lib.jse
-  -

- - - - - - - - - -
Subclasses of BaseLib in org.luaj.vm2.lib.jse
- classJseBaseLib - -
-          Subclass of BaseLib and LibFunction which implements the lua basic library functions - and provides a directory based ResourceFinder as the FINDER.
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/CoroutineLib.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/CoroutineLib.html deleted file mode 100644 index 64ab86d6d..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/CoroutineLib.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.lib.CoroutineLib (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.lib.CoroutineLib

-
-No usage of org.luaj.vm2.lib.CoroutineLib -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/DebugLib.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/DebugLib.html deleted file mode 100644 index aed890dc2..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/DebugLib.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.lib.DebugLib (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.lib.DebugLib

-
-No usage of org.luaj.vm2.lib.DebugLib -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/IoLib.File.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/IoLib.File.html deleted file mode 100644 index 34c3543fb..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/IoLib.File.html +++ /dev/null @@ -1,399 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.lib.IoLib.File (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.lib.IoLib.File

-
- - - - - - - - - - - - - - - - - -
-Packages that use IoLib.File
org.luaj.vm2.lib  
org.luaj.vm2.lib.jme  
org.luaj.vm2.lib.jse  
-  -

- - - - - -
-Uses of IoLib.File in org.luaj.vm2.lib
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - -
Methods in org.luaj.vm2.lib that return IoLib.File
-protected abstract  IoLib.FileIoLib.openFile(java.lang.String filename, - boolean readMode, - boolean appendMode, - boolean updateMode, - boolean binaryMode) - -
-          Open a file in a particular mode.
-protected abstract  IoLib.FileIoLib.openProgram(java.lang.String prog, - java.lang.String mode) - -
-          Start a new process and return a file for input or output
-protected abstract  IoLib.FileIoLib.tmpFile() - -
-          Open a temporary file.
-protected abstract  IoLib.FileIoLib.wrapStdin() - -
-          Wrap the standard input.
-protected abstract  IoLib.FileIoLib.wrapStdout() - -
-          Wrap the standard output.
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - -
Methods in org.luaj.vm2.lib with parameters of type IoLib.File
-static LuaValueIoLib.freadall(IoLib.File f) - -
-           
-static LuaValueIoLib.freadbytes(IoLib.File f, - int count) - -
-           
-static LuaValueIoLib.freadline(IoLib.File f) - -
-           
-static LuaValueIoLib.freadnumber(IoLib.File f) - -
-           
-static LuaValueIoLib.freaduntil(IoLib.File f, - boolean lineonly) - -
-           
-  -

- - - - - -
-Uses of IoLib.File in org.luaj.vm2.lib.jme
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - -
Methods in org.luaj.vm2.lib.jme that return IoLib.File
-protected  IoLib.FileJmeIoLib.openFile(java.lang.String filename, - boolean readMode, - boolean appendMode, - boolean updateMode, - boolean binaryMode) - -
-           
-protected  IoLib.FileJmeIoLib.openProgram(java.lang.String prog, - java.lang.String mode) - -
-           
-protected  IoLib.FileJmeIoLib.tmpFile() - -
-           
-protected  IoLib.FileJmeIoLib.wrapStdin() - -
-           
-protected  IoLib.FileJmeIoLib.wrapStdout() - -
-           
-  -

- - - - - -
-Uses of IoLib.File in org.luaj.vm2.lib.jse
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - -
Methods in org.luaj.vm2.lib.jse that return IoLib.File
-protected  IoLib.FileJseIoLib.openFile(java.lang.String filename, - boolean readMode, - boolean appendMode, - boolean updateMode, - boolean binaryMode) - -
-           
-protected  IoLib.FileJseIoLib.openProgram(java.lang.String prog, - java.lang.String mode) - -
-           
-protected  IoLib.FileJseIoLib.tmpFile() - -
-           
-protected  IoLib.FileJseIoLib.wrapStdin() - -
-           
-protected  IoLib.FileJseIoLib.wrapStdout() - -
-           
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/IoLib.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/IoLib.html deleted file mode 100644 index 00c1e2523..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/IoLib.html +++ /dev/null @@ -1,211 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.lib.IoLib (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.lib.IoLib

-
- - - - - - - - - - - - - -
-Packages that use IoLib
org.luaj.vm2.lib.jme  
org.luaj.vm2.lib.jse  
-  -

- - - - - -
-Uses of IoLib in org.luaj.vm2.lib.jme
-  -

- - - - - - - - - -
Subclasses of IoLib in org.luaj.vm2.lib.jme
- classJmeIoLib - -
-          Subclass of IoLib and therefore LibFunction which implements the lua standard io - library for the JSE platform.
-  -

- - - - - -
-Uses of IoLib in org.luaj.vm2.lib.jse
-  -

- - - - - - - - - -
Subclasses of IoLib in org.luaj.vm2.lib.jse
- classJseIoLib - -
-          Subclass of IoLib and therefore LibFunction which implements the lua standard io - library for the JSE platform.
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/LibFunction.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/LibFunction.html deleted file mode 100644 index a67cc7cf1..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/LibFunction.html +++ /dev/null @@ -1,406 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.lib.LibFunction (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.lib.LibFunction

-
- - - - - - - - - - - - - - - - - -
-Packages that use LibFunction
org.luaj.vm2.lib  
org.luaj.vm2.lib.jme  
org.luaj.vm2.lib.jse  
-  -

- - - - - -
-Uses of LibFunction in org.luaj.vm2.lib
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Subclasses of LibFunction in org.luaj.vm2.lib
- classBaseLib - -
-          Subclass of LibFunction which implements the lua basic library functions.
- classCoroutineLib - -
-          Subclass of LibFunction which implements the lua standard coroutine - library.
- classDebugLib - -
-          Subclass of LibFunction which implements the lua standard debug - library.
- classIoLib - -
-          Abstract base class extending LibFunction which implements the - core of the lua standard io library.
- classMathLib - -
-          Subclass of LibFunction which implements the lua standard math - library.
- classOneArgFunction - -
-          Abstract base class for Java function implementations that take one argument and - return one value.
- classOsLib - -
-          Subclass of LibFunction which implements the standard lua os library.
- classPackageLib - -
-          Subclass of LibFunction which implements the lua standard package and module - library functions.
- classStringLib - -
-          Subclass of LibFunction which implements the lua standard string - library.
- classTableLib - -
-          Subclass of LibFunction which implements the lua standard table - library.
- classThreeArgFunction - -
-          Abstract base class for Java function implementations that take two arguments and - return one value.
- classTwoArgFunction - -
-          Abstract base class for Java function implementations that take two arguments and - return one value.
- classVarArgFunction - -
-          Abstract base class for Java function implementations that takes varaiable arguments and - returns multiple return values.
- classZeroArgFunction - -
-          Abstract base class for Java function implementations that take no arguments and - return one value.
-  -

- - - - - -
-Uses of LibFunction in org.luaj.vm2.lib.jme
-  -

- - - - - - - - - -
Subclasses of LibFunction in org.luaj.vm2.lib.jme
- classJmeIoLib - -
-          Subclass of IoLib and therefore LibFunction which implements the lua standard io - library for the JSE platform.
-  -

- - - - - -
-Uses of LibFunction in org.luaj.vm2.lib.jse
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Subclasses of LibFunction in org.luaj.vm2.lib.jse
- classJseBaseLib - -
-          Subclass of BaseLib and LibFunction which implements the lua basic library functions - and provides a directory based ResourceFinder as the BaseLib.FINDER.
- classJseIoLib - -
-          Subclass of IoLib and therefore LibFunction which implements the lua standard io - library for the JSE platform.
- classJseMathLib - -
-          Subclass of LibFunction which implements the lua standard math - library.
-static classJseMathLib.JseMathLib1 - -
-           
-static classJseMathLib.JseMathLib2 - -
-           
- classJseOsLib - -
-          Subclass of LibFunction which implements the standard lua os library.
- classLuajavaLib - -
-          Subclass of LibFunction which implements the features of the luajava package.
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/MathLib.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/MathLib.html deleted file mode 100644 index 529ecba9f..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/MathLib.html +++ /dev/null @@ -1,210 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.lib.MathLib (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.lib.MathLib

-
- - - - - - - - - - - - - -
-Packages that use MathLib
org.luaj.vm2.lib  
org.luaj.vm2.lib.jse  
-  -

- - - - - -
-Uses of MathLib in org.luaj.vm2.lib
-  -

- - - - - - - - - -
Fields in org.luaj.vm2.lib declared as MathLib
-static MathLibMathLib.MATHLIB - -
-           
-  -

- - - - - -
-Uses of MathLib in org.luaj.vm2.lib.jse
-  -

- - - - - - - - - -
Subclasses of MathLib in org.luaj.vm2.lib.jse
- classJseMathLib - -
-          Subclass of LibFunction which implements the lua standard math - library.
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/OneArgFunction.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/OneArgFunction.html deleted file mode 100644 index be4a740a3..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/OneArgFunction.html +++ /dev/null @@ -1,311 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.lib.OneArgFunction (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.lib.OneArgFunction

-
- - - - - - - - - - - - - - - - - -
-Packages that use OneArgFunction
org.luaj.vm2.lib  
org.luaj.vm2.lib.jme  
org.luaj.vm2.lib.jse  
-  -

- - - - - -
-Uses of OneArgFunction in org.luaj.vm2.lib
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Subclasses of OneArgFunction in org.luaj.vm2.lib
- classBaseLib - -
-          Subclass of LibFunction which implements the lua basic library functions.
- classIoLib - -
-          Abstract base class extending LibFunction which implements the - core of the lua standard io library.
- classMathLib - -
-          Subclass of LibFunction which implements the lua standard math - library.
- classPackageLib - -
-          Subclass of LibFunction which implements the lua standard package and module - library functions.
- classStringLib - -
-          Subclass of LibFunction which implements the lua standard string - library.
- classTableLib - -
-          Subclass of LibFunction which implements the lua standard table - library.
-  -

- - - - - -
-Uses of OneArgFunction in org.luaj.vm2.lib.jme
-  -

- - - - - - - - - -
Subclasses of OneArgFunction in org.luaj.vm2.lib.jme
- classJmeIoLib - -
-          Subclass of IoLib and therefore LibFunction which implements the lua standard io - library for the JSE platform.
-  -

- - - - - -
-Uses of OneArgFunction in org.luaj.vm2.lib.jse
-  -

- - - - - - - - - - - - - - - - - - - - - -
Subclasses of OneArgFunction in org.luaj.vm2.lib.jse
- classJseBaseLib - -
-          Subclass of BaseLib and LibFunction which implements the lua basic library functions - and provides a directory based ResourceFinder as the BaseLib.FINDER.
- classJseIoLib - -
-          Subclass of IoLib and therefore LibFunction which implements the lua standard io - library for the JSE platform.
- classJseMathLib - -
-          Subclass of LibFunction which implements the lua standard math - library.
-static classJseMathLib.JseMathLib1 - -
-           
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/OsLib.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/OsLib.html deleted file mode 100644 index 65573d5ae..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/OsLib.html +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.lib.OsLib (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.lib.OsLib

-
- - - - - - - - - -
-Packages that use OsLib
org.luaj.vm2.lib.jse  
-  -

- - - - - -
-Uses of OsLib in org.luaj.vm2.lib.jse
-  -

- - - - - - - - - -
Subclasses of OsLib in org.luaj.vm2.lib.jse
- classJseOsLib - -
-          Subclass of LibFunction which implements the standard lua os library.
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/PackageLib.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/PackageLib.html deleted file mode 100644 index bb6be5cae..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/PackageLib.html +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.lib.PackageLib (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.lib.PackageLib

-
- - - - - - - - - -
-Packages that use PackageLib
org.luaj.vm2.lib  
-  -

- - - - - -
-Uses of PackageLib in org.luaj.vm2.lib
-  -

- - - - - - - - - -
Fields in org.luaj.vm2.lib declared as PackageLib
-static PackageLibPackageLib.instance - -
-          Most recent instance of PackageLib
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/ResourceFinder.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/ResourceFinder.html deleted file mode 100644 index 1cdf69f92..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/ResourceFinder.html +++ /dev/null @@ -1,226 +0,0 @@ - - - - - - -Uses of Interface org.luaj.vm2.lib.ResourceFinder (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Interface
org.luaj.vm2.lib.ResourceFinder

-
- - - - - - - - - - - - - -
-Packages that use ResourceFinder
org.luaj.vm2.lib  
org.luaj.vm2.lib.jse  
-  -

- - - - - -
-Uses of ResourceFinder in org.luaj.vm2.lib
-  -

- - - - - - - - - -
Classes in org.luaj.vm2.lib that implement ResourceFinder
- classBaseLib - -
-          Subclass of LibFunction which implements the lua basic library functions.
-  -

- - - - - - - - - -
Fields in org.luaj.vm2.lib declared as ResourceFinder
-static ResourceFinderBaseLib.FINDER - -
-          Singleton file opener for this Java ClassLoader realm.
-  -

- - - - - -
-Uses of ResourceFinder in org.luaj.vm2.lib.jse
-  -

- - - - - - - - - -
Classes in org.luaj.vm2.lib.jse that implement ResourceFinder
- classJseBaseLib - -
-          Subclass of BaseLib and LibFunction which implements the lua basic library functions - and provides a directory based ResourceFinder as the BaseLib.FINDER.
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/StringLib.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/StringLib.html deleted file mode 100644 index dc4b13388..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/StringLib.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.lib.StringLib (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.lib.StringLib

-
-No usage of org.luaj.vm2.lib.StringLib -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/TableLib.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/TableLib.html deleted file mode 100644 index b31307ee4..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/TableLib.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.lib.TableLib (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.lib.TableLib

-
-No usage of org.luaj.vm2.lib.TableLib -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/ThreeArgFunction.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/ThreeArgFunction.html deleted file mode 100644 index 2b8b7ee5f..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/ThreeArgFunction.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.lib.ThreeArgFunction (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.lib.ThreeArgFunction

-
-No usage of org.luaj.vm2.lib.ThreeArgFunction -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/TwoArgFunction.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/TwoArgFunction.html deleted file mode 100644 index ef9fb4ba3..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/TwoArgFunction.html +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.lib.TwoArgFunction (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.lib.TwoArgFunction

-
- - - - - - - - - -
-Packages that use TwoArgFunction
org.luaj.vm2.lib.jse  
-  -

- - - - - -
-Uses of TwoArgFunction in org.luaj.vm2.lib.jse
-  -

- - - - - - - - - -
Subclasses of TwoArgFunction in org.luaj.vm2.lib.jse
-static classJseMathLib.JseMathLib2 - -
-           
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/VarArgFunction.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/VarArgFunction.html deleted file mode 100644 index 370ac3b33..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/VarArgFunction.html +++ /dev/null @@ -1,235 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.lib.VarArgFunction (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.lib.VarArgFunction

-
- - - - - - - - - - - - - -
-Packages that use VarArgFunction
org.luaj.vm2.lib  
org.luaj.vm2.lib.jse  
-  -

- - - - - -
-Uses of VarArgFunction in org.luaj.vm2.lib
-  -

- - - - - - - - - - - - - - - - - -
Subclasses of VarArgFunction in org.luaj.vm2.lib
- classCoroutineLib - -
-          Subclass of LibFunction which implements the lua standard coroutine - library.
- classDebugLib - -
-          Subclass of LibFunction which implements the lua standard debug - library.
- classOsLib - -
-          Subclass of LibFunction which implements the standard lua os library.
-  -

- - - - - -
-Uses of VarArgFunction in org.luaj.vm2.lib.jse
-  -

- - - - - - - - - - - - - -
Subclasses of VarArgFunction in org.luaj.vm2.lib.jse
- classJseOsLib - -
-          Subclass of LibFunction which implements the standard lua os library.
- classLuajavaLib - -
-          Subclass of LibFunction which implements the features of the luajava package.
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/ZeroArgFunction.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/ZeroArgFunction.html deleted file mode 100644 index 3acbff89a..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/class-use/ZeroArgFunction.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.lib.ZeroArgFunction (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.lib.ZeroArgFunction

-
-No usage of org.luaj.vm2.lib.ZeroArgFunction -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jme/JmeIoLib.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jme/JmeIoLib.html deleted file mode 100644 index 4cb9936d9..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jme/JmeIoLib.html +++ /dev/null @@ -1,544 +0,0 @@ - - - - - - -JmeIoLib (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2.lib.jme -
-Class JmeIoLib

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.LuaFunction
-              extended by org.luaj.vm2.lib.LibFunction
-                  extended by org.luaj.vm2.lib.OneArgFunction
-                      extended by org.luaj.vm2.lib.IoLib
-                          extended by org.luaj.vm2.lib.jme.JmeIoLib
-
-
-
-
public class JmeIoLib
extends IoLib
- - -

-Subclass of IoLib and therefore LibFunction which implements the lua standard io - library for the JSE platform. -

- The implementation of the is based on CLDC 1.0 and StreamConnection. - However, seek is not supported. -

- Typically, this library is included as part of a call to - JmePlatform.standardGlobals() -

- To instantiate and use it directly, - link it into your globals table via LuaValue.load(LuaValue) using code such as: -

 LuaTable _G = new LuaTable();
- LuaThread.setGlobals(_G);
- _G.load(new BaseLib());
- _G.load(new PackageLib());
- _G.load(new JmeIoLib());
- _G.get("io").get("write").call(LuaValue.valueOf("hello, world\n"));
-  
- Doing so will ensure the library is properly initialized - and loaded into the globals table. -

- This has been implemented to match as closely as possible the behavior in the corresponding library in C. -

- -

-

-
See Also:
LibFunction, -JsePlatform, -JmePlatform, -IoLib, -JseIoLib, -http://www.lua.org/manual/5.1/manual.html#5.6
-
- -

- - - - - - - -
-Nested Class Summary
- - - - - - - -
Nested classes/interfaces inherited from class org.luaj.vm2.lib.IoLib
IoLib.File
-  - - - - - - - -
-Field Summary
- - - - - - - -
Fields inherited from class org.luaj.vm2.lib.IoLib
FILE_NAMES, IO_NAMES
- - - - - - - -
Fields inherited from class org.luaj.vm2.lib.LibFunction
name, opcode
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaFunction
env, s_metatable
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - -
-Constructor Summary
JmeIoLib() - -
-           
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
-protected  IoLib.FileopenFile(java.lang.String filename, - boolean readMode, - boolean appendMode, - boolean updateMode, - boolean binaryMode) - -
-          Open a file in a particular mode.
-protected  IoLib.FileopenProgram(java.lang.String prog, - java.lang.String mode) - -
-          Start a new process and return a file for input or output
-protected  IoLib.FiletmpFile() - -
-          Open a temporary file.
-protected  IoLib.FilewrapStdin() - -
-          Wrap the standard input.
-protected  IoLib.FilewrapStdout() - -
-          Wrap the standard output.
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.IoLib
_file_close, _file_flush, _file_lines, _file_read, _file_seek, _file_setvbuf, _file_write, _io_close, _io_flush, _io_index, _io_input, _io_lines, _io_open, _io_output, _io_popen, _io_read, _io_tmpfile, _io_type, _io_write, _lines_iter, call, freadall, freadbytes, freadline, freadnumber, freaduntil
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.OneArgFunction
call, call, call, invoke
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.LibFunction
bind, bind, newupe, newupl, newupn, tojstring
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaFunction
checkfunction, getfenv, getmetatable, isfunction, optfunction, setfenv, type, typename
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
add, add, add, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, callmt, checkboolean, checkclosure, checkdouble, checkint, checkinteger, checkjstring, checklong, checkmetatag, checknotnil, checknumber, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalidkey, compareerror, compareerror, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, div, div, div, divInto, eq_b, eq, eqmtcall, equals, error, get, get, get, getn, gettable, gt_b, gt_b, gt_b, gt, gt, gt, gteq_b, gteq_b, gteq_b, gteq, gteq, gteq, illegal, inext, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isint, isinttype, islong, isnil, isnumber, isstring, istable, isthread, isuserdata, isuserdata, isweaknil, len, lenerror, length, listOf, listOf, load, lt_b, lt_b, lt_b, lt, lt, lt, lteq_b, lteq_b, lteq_b, lteq, lteq, lteq, metatag, method, method, method, method, method, method, mod, mod, mod, modFrom, mul, mul, mul, narg, neg, neq_b, neq, next, not, onInvoke, optboolean, optclosure, optdouble, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, or, pow, pow, pow, powWith, powWith, presize, raweq, raweq, raweq, raweq, raweq, rawget, rawget, rawget, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setmetatable, settable, strcmp, strcmp, strongkey, strongvalue, strvalue, sub, sub, sub, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, tobyte, tochar, todouble, tofloat, toint, tolong, tonumber, toshort, tostring, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Constructor Detail
- -

-JmeIoLib

-
-public JmeIoLib()
-
-
- - - - - - - - -
-Method Detail
- -

-wrapStdin

-
-protected IoLib.File wrapStdin()
-                        throws java.io.IOException
-
-
Description copied from class: IoLib
-
Wrap the standard input. -

-

-
Specified by:
wrapStdin in class IoLib
-
-
- -
Returns:
File -
Throws: -
java.io.IOException
-
-
-
- -

-wrapStdout

-
-protected IoLib.File wrapStdout()
-                         throws java.io.IOException
-
-
Description copied from class: IoLib
-
Wrap the standard output. -

-

-
Specified by:
wrapStdout in class IoLib
-
-
- -
Returns:
File -
Throws: -
java.io.IOException
-
-
-
- -

-openFile

-
-protected IoLib.File openFile(java.lang.String filename,
-                              boolean readMode,
-                              boolean appendMode,
-                              boolean updateMode,
-                              boolean binaryMode)
-                       throws java.io.IOException
-
-
Description copied from class: IoLib
-
Open a file in a particular mode. -

-

-
Specified by:
openFile in class IoLib
-
-
-
readMode - true if opening in read mode
appendMode - true if opening in append mode
updateMode - true if opening in update mode
binaryMode - true if opening in binary mode -
Returns:
File object if successful -
Throws: -
java.io.IOException - if could not be opened
-
-
-
- -

-openProgram

-
-protected IoLib.File openProgram(java.lang.String prog,
-                                 java.lang.String mode)
-                          throws java.io.IOException
-
-
Description copied from class: IoLib
-
Start a new process and return a file for input or output -

-

-
Specified by:
openProgram in class IoLib
-
-
-
Parameters:
prog - the program to execute
mode - "r" to read, "w" to write -
Returns:
File to read to or write from -
Throws: -
java.io.IOException - if an i/o exception occurs
-
-
-
- -

-tmpFile

-
-protected IoLib.File tmpFile()
-                      throws java.io.IOException
-
-
Description copied from class: IoLib
-
Open a temporary file. -

-

-
Specified by:
tmpFile in class IoLib
-
-
- -
Returns:
File object if successful -
Throws: -
java.io.IOException - if could not be opened
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jme/JmePlatform.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jme/JmePlatform.html deleted file mode 100644 index 41e03de03..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jme/JmePlatform.html +++ /dev/null @@ -1,336 +0,0 @@ - - - - - - -JmePlatform (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2.lib.jme -
-Class JmePlatform

-
-java.lang.Object
-  extended by org.luaj.vm2.lib.jme.JmePlatform
-
-
-
-
public class JmePlatform
extends java.lang.Object
- - -

-The JmePlatform class is a convenience class to standardize - how globals tables are initialized for the JME platform. -

- The JME platform, being limited, cannot implement all libraries in all aspects. The main limitations are -

-

- It is used to allocate either a set of standard globals using - standardGlobals() or debug globals using debugGlobals() -

- A simple example of initializing globals and using them from Java is: -

 LuaValue _G = JmePlatform.standardGlobals();
- _G.get("print").call(LuaValue.valueOf("hello, world"));
-  
-

- Once globals are created, a simple way to load and run a script is: -

 LoadState.load( getClass().getResourceAsStream("main.lua"), "main.lua", _G ).call();
-  
-

- although require could also be used: -

 _G.get("require").call(LuaValue.valueOf("main"));
-  
- For this to succeed, the file "main.lua" must be a resource in the class path. - See BaseLib for details on finding scripts using ResourceFinder. -

- The standard globals will contain all standard libraries in their JME flavors: -

- In addition, the LuaC compiler is installed so lua files may be loaded in their source form. -

- The debug globals are simply the standard globals plus the debug library DebugLib. -

-

- The class ensures that initialization is done in the correct order, - and that linkage is made to LuaThread.setGlobals(LuaValue). -

- -

-

-
See Also:
JsePlatform, -LoadState
-
- -

- - - - - - - - - - - -
-Constructor Summary
JmePlatform() - -
-           
-  - - - - - - - - - - - - - - - -
-Method Summary
-static LuaTabledebugGlobals() - -
-          Create standard globals including the debug library.
-static LuaTablestandardGlobals() - -
-          Create a standard set of globals for JME including all the libraries.
- - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-  -

- - - - - - - - -
-Constructor Detail
- -

-JmePlatform

-
-public JmePlatform()
-
-
- - - - - - - - -
-Method Detail
- -

-standardGlobals

-
-public static LuaTable standardGlobals()
-
-
Create a standard set of globals for JME including all the libraries. -

-

- -
Returns:
Table of globals initialized with the standard JME libraries
See Also:
debugGlobals(), -JsePlatform, -JmePlatform
-
-
-
- -

-debugGlobals

-
-public static LuaTable debugGlobals()
-
-
Create standard globals including the debug library. -

-

- -
Returns:
Table of globals initialized with the standard JSE and debug libraries
See Also:
#standarsGlobals(), -JsePlatform, -JmePlatform, -DebugLib
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jme/class-use/JmeIoLib.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jme/class-use/JmeIoLib.html deleted file mode 100644 index 71cb0ad31..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jme/class-use/JmeIoLib.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.lib.jme.JmeIoLib (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.lib.jme.JmeIoLib

-
-No usage of org.luaj.vm2.lib.jme.JmeIoLib -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jme/class-use/JmePlatform.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jme/class-use/JmePlatform.html deleted file mode 100644 index b1c12c7cc..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jme/class-use/JmePlatform.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.lib.jme.JmePlatform (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.lib.jme.JmePlatform

-
-No usage of org.luaj.vm2.lib.jme.JmePlatform -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jme/package-frame.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jme/package-frame.html deleted file mode 100644 index d481b52a9..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jme/package-frame.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - -org.luaj.vm2.lib.jme (Luaj API) - - - - - - - - - - - -org.luaj.vm2.lib.jme - - - - -
-Classes  - -
-JmeIoLib -
-JmePlatform
- - - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jme/package-summary.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jme/package-summary.html deleted file mode 100644 index e0e17cd7a..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jme/package-summary.html +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - -org.luaj.vm2.lib.jme (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-

-Package org.luaj.vm2.lib.jme -

- - - - - - - - - - - - - -
-Class Summary
JmeIoLibSubclass of IoLib and therefore LibFunction which implements the lua standard io - library for the JSE platform.
JmePlatformThe JmePlatform class is a convenience class to standardize - how globals tables are initialized for the JME platform.
-  - -

-

-
-
- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jme/package-tree.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jme/package-tree.html deleted file mode 100644 index 23cb703d6..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jme/package-tree.html +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - -org.luaj.vm2.lib.jme Class Hierarchy (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Hierarchy For Package org.luaj.vm2.lib.jme -

-
-
-
Package Hierarchies:
All Packages
-
-

-Class Hierarchy -

- -
- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jme/package-use.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jme/package-use.html deleted file mode 100644 index 2ad589af8..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jme/package-use.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Package org.luaj.vm2.lib.jme (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Package
org.luaj.vm2.lib.jme

-
-No usage of org.luaj.vm2.lib.jme -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/CoerceJavaToLua.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/CoerceJavaToLua.html deleted file mode 100644 index 4002e8794..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/CoerceJavaToLua.html +++ /dev/null @@ -1,297 +0,0 @@ - - - - - - -CoerceJavaToLua (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2.lib.jse -
-Class CoerceJavaToLua

-
-java.lang.Object
-  extended by org.luaj.vm2.lib.jse.CoerceJavaToLua
-
-
-
-
public class CoerceJavaToLua
extends java.lang.Object
- - -

-Helper class to coerce values from Java to lua within the luajava library. -

- This class is primarily used by the LuajavaLib, - but can also be used directly when working with Java/lua bindings. -

- To coerce scalar types, the various, generally the valueOf(type) methods - on LuaValue may be used: -

-

- To coerce arrays of objects and lists, the listOf(..) and tableOf(...) methods - on LuaValue may be used: -

- The method coerce(Object) looks as the type and dimesioning - of the argument and tries to guess the best fit for corrsponding lua scalar, - table, or table of tables. -

- -

-

-
See Also:
coerce(Object), -LuajavaLib
-
- -

- - - - - - - - - - - -
-Constructor Summary
CoerceJavaToLua() - -
-           
-  - - - - - - - - - - - -
-Method Summary
-static LuaValuecoerce(java.lang.Object o) - -
-          Coerse a Java object to a corresponding lua value.
- - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-  -

- - - - - - - - -
-Constructor Detail
- -

-CoerceJavaToLua

-
-public CoerceJavaToLua()
-
-
- - - - - - - - -
-Method Detail
- -

-coerce

-
-public static LuaValue coerce(java.lang.Object o)
-
-
Coerse a Java object to a corresponding lua value. -

- Integral types boolean, byte, char, and int - will become LuaInteger; - long, float, and double will become LuaDouble; - String and byte[] will become LuaString; - other types will become LuaUserdata. -

-

-
Parameters:
o - Java object needing conversion -
Returns:
LuaValue corresponding to the supplied Java value.
See Also:
LuaValue, -LuaInteger, -LuaDouble, -LuaString, -LuaUserdata
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/CoerceLuaToJava.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/CoerceLuaToJava.html deleted file mode 100644 index 6f4d952b3..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/CoerceLuaToJava.html +++ /dev/null @@ -1,285 +0,0 @@ - - - - - - -CoerceLuaToJava (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2.lib.jse -
-Class CoerceLuaToJava

-
-java.lang.Object
-  extended by org.luaj.vm2.lib.jse.CoerceLuaToJava
-
-
-
-
public class CoerceLuaToJava
extends java.lang.Object
- - -

-Helper class to coerce values from lua to Java within the luajava library. -

- This class is primarily used by the LuajavaLib, - but can also be used directly when working with Java/lua bindings. -

- To coerce to specific Java values, generally the toType() methods - on LuaValue may be used: -

-

- For data in lua tables, the various methods on LuaTable can be used directly - to convert data to something more useful. -

- -

-

-
See Also:
LuajavaLib, -CoerceJavaToLua
-
- -

- - - - - - - - - - - -
-Constructor Summary
CoerceLuaToJava() - -
-           
-  - - - - - - - - - - - -
-Method Summary
-static java.lang.Objectcoerce(LuaValue value, - java.lang.Class clazz) - -
-          Coerce a LuaValue value to a specified java class
- - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-  -

- - - - - - - - -
-Constructor Detail
- -

-CoerceLuaToJava

-
-public CoerceLuaToJava()
-
-
- - - - - - - - -
-Method Detail
- -

-coerce

-
-public static java.lang.Object coerce(LuaValue value,
-                                      java.lang.Class clazz)
-
-
Coerce a LuaValue value to a specified java class -

-

-
Parameters:
value - LuaValue to coerce
clazz - Class to coerce into -
Returns:
Object of type clazz (or a subclass) with the corresponding value.
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/JseBaseLib.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/JseBaseLib.html deleted file mode 100644 index 901161126..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/JseBaseLib.html +++ /dev/null @@ -1,409 +0,0 @@ - - - - - - -JseBaseLib (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2.lib.jse -
-Class JseBaseLib

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.LuaFunction
-              extended by org.luaj.vm2.lib.LibFunction
-                  extended by org.luaj.vm2.lib.OneArgFunction
-                      extended by org.luaj.vm2.lib.BaseLib
-                          extended by org.luaj.vm2.lib.jse.JseBaseLib
-
-
-
All Implemented Interfaces:
ResourceFinder
-
-
-
-
public class JseBaseLib
extends BaseLib
- - -

-Subclass of BaseLib and LibFunction which implements the lua basic library functions - and provides a directory based ResourceFinder as the BaseLib.FINDER. -

- Since JME has no file system by default, BaseLib implements - ResourceFinder using Class.getResource(String). - The JseBaseLib implements FINDER by scanning the current directory - first, then falling back to Class.getResource(String) if that fails. - Otherwise, the behavior is the same as that of BaseLib. -

- Typically, this library is included as part of a call to - JsePlatform.standardGlobals() -

- To instantiate and use it directly, - link it into your globals table via LuaValue.load(LuaValue) using code such as: -

 LuaTable _G = new LuaTable();
- LuaThread.setGlobals(_G);
- _G.load(new JseBaseLib());
- _G.get("print").call(LuaValue.valueOf("hello, world"));
-  
- Doing so will ensure the library is properly initialized - and loaded into the globals table. -

- This is a direct port of the corresponding library in C. -

- -

-

-
See Also:
BaseLib, -ResourceFinder, -BaseLib.FINDER, -LibFunction, -JsePlatform, -JmePlatform, -http://www.lua.org/manual/5.1/manual.html#5.1
-
- -

- - - - - - - -
-Field Summary
- - - - - - - -
Fields inherited from class org.luaj.vm2.lib.BaseLib
FINDER, instance, STDERR, STDIN, STDOUT
- - - - - - - -
Fields inherited from class org.luaj.vm2.lib.LibFunction
name, opcode
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaFunction
env, s_metatable
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - -
-Constructor Summary
JseBaseLib() - -
-          Construct a JSE base library instance
-  - - - - - - - - - - - -
-Method Summary
- java.io.InputStreamfindResource(java.lang.String filename) - -
-          Try to open a file in the current working directory, - or fall back to base opener if not found.
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.BaseLib
call, loadFile, loadStream, pcall
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.OneArgFunction
call, call, call, invoke
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.LibFunction
bind, bind, newupe, newupl, newupn, tojstring
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaFunction
checkfunction, getfenv, getmetatable, isfunction, optfunction, setfenv, type, typename
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
add, add, add, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, callmt, checkboolean, checkclosure, checkdouble, checkint, checkinteger, checkjstring, checklong, checkmetatag, checknotnil, checknumber, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalidkey, compareerror, compareerror, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, div, div, div, divInto, eq_b, eq, eqmtcall, equals, error, get, get, get, getn, gettable, gt_b, gt_b, gt_b, gt, gt, gt, gteq_b, gteq_b, gteq_b, gteq, gteq, gteq, illegal, inext, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isint, isinttype, islong, isnil, isnumber, isstring, istable, isthread, isuserdata, isuserdata, isweaknil, len, lenerror, length, listOf, listOf, load, lt_b, lt_b, lt_b, lt, lt, lt, lteq_b, lteq_b, lteq_b, lteq, lteq, lteq, metatag, method, method, method, method, method, method, mod, mod, mod, modFrom, mul, mul, mul, narg, neg, neq_b, neq, next, not, onInvoke, optboolean, optclosure, optdouble, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, or, pow, pow, pow, powWith, powWith, presize, raweq, raweq, raweq, raweq, raweq, rawget, rawget, rawget, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setmetatable, settable, strcmp, strcmp, strongkey, strongvalue, strvalue, sub, sub, sub, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, tobyte, tochar, todouble, tofloat, toint, tolong, tonumber, toshort, tostring, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Constructor Detail
- -

-JseBaseLib

-
-public JseBaseLib()
-
-
Construct a JSE base library instance -

-

- - - - - - - - -
-Method Detail
- -

-findResource

-
-public java.io.InputStream findResource(java.lang.String filename)
-
-
Try to open a file in the current working directory, - or fall back to base opener if not found. - - This implementation attempts to open the file using new File(filename). - It falls back to the base implementation that looks it up as a resource - in the class path if not found as a plain file. -

-

-
Specified by:
findResource in interface ResourceFinder
Overrides:
findResource in class BaseLib
-
-
-
Parameters:
filename - -
Returns:
InputStream, or null if not found.
See Also:
BaseLib, -ResourceFinder
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/JseIoLib.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/JseIoLib.html deleted file mode 100644 index 2dbd43950..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/JseIoLib.html +++ /dev/null @@ -1,543 +0,0 @@ - - - - - - -JseIoLib (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2.lib.jse -
-Class JseIoLib

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.LuaFunction
-              extended by org.luaj.vm2.lib.LibFunction
-                  extended by org.luaj.vm2.lib.OneArgFunction
-                      extended by org.luaj.vm2.lib.IoLib
-                          extended by org.luaj.vm2.lib.jse.JseIoLib
-
-
-
-
public class JseIoLib
extends IoLib
- - -

-Subclass of IoLib and therefore LibFunction which implements the lua standard io - library for the JSE platform. -

- It uses RandomAccessFile to implement seek on files. -

- Typically, this library is included as part of a call to - JsePlatform.standardGlobals() -

- To instantiate and use it directly, - link it into your globals table via LuaValue.load(LuaValue) using code such as: -

 LuaTable _G = new LuaTable();
- LuaThread.setGlobals(_G);
- _G.load(new JseBaseLib());
- _G.load(new PackageLib());
- _G.load(new JseIoLib());
- _G.get("io").get("write").call(LuaValue.valueOf("hello, world\n"));
-  
- Doing so will ensure the library is properly initialized - and loaded into the globals table. -

- This has been implemented to match as closely as possible the behavior in the corresponding library in C. -

- -

-

-
See Also:
LibFunction, -JsePlatform, -JmePlatform, -IoLib, -JmeIoLib, -http://www.lua.org/manual/5.1/manual.html#5.7
-
- -

- - - - - - - -
-Nested Class Summary
- - - - - - - -
Nested classes/interfaces inherited from class org.luaj.vm2.lib.IoLib
IoLib.File
-  - - - - - - - -
-Field Summary
- - - - - - - -
Fields inherited from class org.luaj.vm2.lib.IoLib
FILE_NAMES, IO_NAMES
- - - - - - - -
Fields inherited from class org.luaj.vm2.lib.LibFunction
name, opcode
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaFunction
env, s_metatable
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - -
-Constructor Summary
JseIoLib() - -
-           
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
-protected  IoLib.FileopenFile(java.lang.String filename, - boolean readMode, - boolean appendMode, - boolean updateMode, - boolean binaryMode) - -
-          Open a file in a particular mode.
-protected  IoLib.FileopenProgram(java.lang.String prog, - java.lang.String mode) - -
-          Start a new process and return a file for input or output
-protected  IoLib.FiletmpFile() - -
-          Open a temporary file.
-protected  IoLib.FilewrapStdin() - -
-          Wrap the standard input.
-protected  IoLib.FilewrapStdout() - -
-          Wrap the standard output.
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.IoLib
_file_close, _file_flush, _file_lines, _file_read, _file_seek, _file_setvbuf, _file_write, _io_close, _io_flush, _io_index, _io_input, _io_lines, _io_open, _io_output, _io_popen, _io_read, _io_tmpfile, _io_type, _io_write, _lines_iter, call, freadall, freadbytes, freadline, freadnumber, freaduntil
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.OneArgFunction
call, call, call, invoke
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.LibFunction
bind, bind, newupe, newupl, newupn, tojstring
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaFunction
checkfunction, getfenv, getmetatable, isfunction, optfunction, setfenv, type, typename
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
add, add, add, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, callmt, checkboolean, checkclosure, checkdouble, checkint, checkinteger, checkjstring, checklong, checkmetatag, checknotnil, checknumber, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalidkey, compareerror, compareerror, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, div, div, div, divInto, eq_b, eq, eqmtcall, equals, error, get, get, get, getn, gettable, gt_b, gt_b, gt_b, gt, gt, gt, gteq_b, gteq_b, gteq_b, gteq, gteq, gteq, illegal, inext, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isint, isinttype, islong, isnil, isnumber, isstring, istable, isthread, isuserdata, isuserdata, isweaknil, len, lenerror, length, listOf, listOf, load, lt_b, lt_b, lt_b, lt, lt, lt, lteq_b, lteq_b, lteq_b, lteq, lteq, lteq, metatag, method, method, method, method, method, method, mod, mod, mod, modFrom, mul, mul, mul, narg, neg, neq_b, neq, next, not, onInvoke, optboolean, optclosure, optdouble, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, or, pow, pow, pow, powWith, powWith, presize, raweq, raweq, raweq, raweq, raweq, rawget, rawget, rawget, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setmetatable, settable, strcmp, strcmp, strongkey, strongvalue, strvalue, sub, sub, sub, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, tobyte, tochar, todouble, tofloat, toint, tolong, tonumber, toshort, tostring, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Constructor Detail
- -

-JseIoLib

-
-public JseIoLib()
-
-
- - - - - - - - -
-Method Detail
- -

-wrapStdin

-
-protected IoLib.File wrapStdin()
-                        throws java.io.IOException
-
-
Description copied from class: IoLib
-
Wrap the standard input. -

-

-
Specified by:
wrapStdin in class IoLib
-
-
- -
Returns:
File -
Throws: -
java.io.IOException
-
-
-
- -

-wrapStdout

-
-protected IoLib.File wrapStdout()
-                         throws java.io.IOException
-
-
Description copied from class: IoLib
-
Wrap the standard output. -

-

-
Specified by:
wrapStdout in class IoLib
-
-
- -
Returns:
File -
Throws: -
java.io.IOException
-
-
-
- -

-openFile

-
-protected IoLib.File openFile(java.lang.String filename,
-                              boolean readMode,
-                              boolean appendMode,
-                              boolean updateMode,
-                              boolean binaryMode)
-                       throws java.io.IOException
-
-
Description copied from class: IoLib
-
Open a file in a particular mode. -

-

-
Specified by:
openFile in class IoLib
-
-
-
readMode - true if opening in read mode
appendMode - true if opening in append mode
updateMode - true if opening in update mode
binaryMode - true if opening in binary mode -
Returns:
File object if successful -
Throws: -
java.io.IOException - if could not be opened
-
-
-
- -

-openProgram

-
-protected IoLib.File openProgram(java.lang.String prog,
-                                 java.lang.String mode)
-                          throws java.io.IOException
-
-
Description copied from class: IoLib
-
Start a new process and return a file for input or output -

-

-
Specified by:
openProgram in class IoLib
-
-
-
Parameters:
prog - the program to execute
mode - "r" to read, "w" to write -
Returns:
File to read to or write from -
Throws: -
java.io.IOException - if an i/o exception occurs
-
-
-
- -

-tmpFile

-
-protected IoLib.File tmpFile()
-                      throws java.io.IOException
-
-
Description copied from class: IoLib
-
Open a temporary file. -

-

-
Specified by:
tmpFile in class IoLib
-
-
- -
Returns:
File object if successful -
Throws: -
java.io.IOException - if could not be opened
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/JseMathLib.JseMathLib1.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/JseMathLib.JseMathLib1.html deleted file mode 100644 index 1d7aaec0f..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/JseMathLib.JseMathLib1.html +++ /dev/null @@ -1,364 +0,0 @@ - - - - - - -JseMathLib.JseMathLib1 (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2.lib.jse -
-Class JseMathLib.JseMathLib1

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.LuaFunction
-              extended by org.luaj.vm2.lib.LibFunction
-                  extended by org.luaj.vm2.lib.OneArgFunction
-                      extended by org.luaj.vm2.lib.jse.JseMathLib.JseMathLib1
-
-
-
Enclosing class:
JseMathLib
-
-
-
-
public static final class JseMathLib.JseMathLib1
extends OneArgFunction
- - -

-


- -

- - - - - - - -
-Field Summary
- - - - - - - -
Fields inherited from class org.luaj.vm2.lib.LibFunction
name, opcode
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaFunction
env, s_metatable
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - -
-Constructor Summary
JseMathLib.JseMathLib1() - -
-           
-  - - - - - - - - - - - -
-Method Summary
- LuaValuecall(LuaValue arg) - -
-          Call this with 1 argument, including metatag processing, - and return only the first return value.
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.OneArgFunction
call, call, call, invoke
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.LibFunction
bind, bind, newupe, newupl, newupn, tojstring
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaFunction
checkfunction, getfenv, getmetatable, isfunction, optfunction, setfenv, type, typename
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
add, add, add, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, callmt, checkboolean, checkclosure, checkdouble, checkint, checkinteger, checkjstring, checklong, checkmetatag, checknotnil, checknumber, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalidkey, compareerror, compareerror, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, div, div, div, divInto, eq_b, eq, eqmtcall, equals, error, get, get, get, getn, gettable, gt_b, gt_b, gt_b, gt, gt, gt, gteq_b, gteq_b, gteq_b, gteq, gteq, gteq, illegal, inext, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isint, isinttype, islong, isnil, isnumber, isstring, istable, isthread, isuserdata, isuserdata, isweaknil, len, lenerror, length, listOf, listOf, load, lt_b, lt_b, lt_b, lt, lt, lt, lteq_b, lteq_b, lteq_b, lteq, lteq, lteq, metatag, method, method, method, method, method, method, mod, mod, mod, modFrom, mul, mul, mul, narg, neg, neq_b, neq, next, not, onInvoke, optboolean, optclosure, optdouble, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, or, pow, pow, pow, powWith, powWith, presize, raweq, raweq, raweq, raweq, raweq, rawget, rawget, rawget, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setmetatable, settable, strcmp, strcmp, strongkey, strongvalue, strvalue, sub, sub, sub, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, tobyte, tochar, todouble, tofloat, toint, tolong, tonumber, toshort, tostring, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Constructor Detail
- -

-JseMathLib.JseMathLib1

-
-public JseMathLib.JseMathLib1()
-
-
- - - - - - - - -
-Method Detail
- -

-call

-
-public LuaValue call(LuaValue arg)
-
-
Description copied from class: LuaValue
-
Call this with 1 argument, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use LuaValue.invoke() instead. -

- To call this as a method call, use LuaValue.method(LuaValue) instead. -

-

-
Specified by:
call in class OneArgFunction
-
-
-
Parameters:
arg - First argument to supply to the called function -
Returns:
First return value (this(arg)), or NIL if there were none.
See Also:
LuaValue.call(), -LuaValue.call(LuaValue,LuaValue), -LuaValue.call(LuaValue, LuaValue, LuaValue), -#invoke(LuaValue), -LuaValue.method(String,LuaValue), -LuaValue.method(LuaValue,LuaValue)
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/JseMathLib.JseMathLib2.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/JseMathLib.JseMathLib2.html deleted file mode 100644 index 34a29d1bc..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/JseMathLib.JseMathLib2.html +++ /dev/null @@ -1,366 +0,0 @@ - - - - - - -JseMathLib.JseMathLib2 (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2.lib.jse -
-Class JseMathLib.JseMathLib2

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.LuaFunction
-              extended by org.luaj.vm2.lib.LibFunction
-                  extended by org.luaj.vm2.lib.TwoArgFunction
-                      extended by org.luaj.vm2.lib.jse.JseMathLib.JseMathLib2
-
-
-
Enclosing class:
JseMathLib
-
-
-
-
public static final class JseMathLib.JseMathLib2
extends TwoArgFunction
- - -

-


- -

- - - - - - - -
-Field Summary
- - - - - - - -
Fields inherited from class org.luaj.vm2.lib.LibFunction
name, opcode
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaFunction
env, s_metatable
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - -
-Constructor Summary
JseMathLib.JseMathLib2() - -
-           
-  - - - - - - - - - - - -
-Method Summary
- LuaValuecall(LuaValue arg1, - LuaValue arg2) - -
-          Call this with 2 arguments, including metatag processing, - and return only the first return value.
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.TwoArgFunction
call, call, call, invoke
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.LibFunction
bind, bind, newupe, newupl, newupn, tojstring
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaFunction
checkfunction, getfenv, getmetatable, isfunction, optfunction, setfenv, type, typename
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
add, add, add, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, callmt, checkboolean, checkclosure, checkdouble, checkint, checkinteger, checkjstring, checklong, checkmetatag, checknotnil, checknumber, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalidkey, compareerror, compareerror, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, div, div, div, divInto, eq_b, eq, eqmtcall, equals, error, get, get, get, getn, gettable, gt_b, gt_b, gt_b, gt, gt, gt, gteq_b, gteq_b, gteq_b, gteq, gteq, gteq, illegal, inext, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isint, isinttype, islong, isnil, isnumber, isstring, istable, isthread, isuserdata, isuserdata, isweaknil, len, lenerror, length, listOf, listOf, load, lt_b, lt_b, lt_b, lt, lt, lt, lteq_b, lteq_b, lteq_b, lteq, lteq, lteq, metatag, method, method, method, method, method, method, mod, mod, mod, modFrom, mul, mul, mul, narg, neg, neq_b, neq, next, not, onInvoke, optboolean, optclosure, optdouble, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, or, pow, pow, pow, powWith, powWith, presize, raweq, raweq, raweq, raweq, raweq, rawget, rawget, rawget, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setmetatable, settable, strcmp, strcmp, strongkey, strongvalue, strvalue, sub, sub, sub, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, tobyte, tochar, todouble, tofloat, toint, tolong, tonumber, toshort, tostring, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Constructor Detail
- -

-JseMathLib.JseMathLib2

-
-public JseMathLib.JseMathLib2()
-
-
- - - - - - - - -
-Method Detail
- -

-call

-
-public LuaValue call(LuaValue arg1,
-                     LuaValue arg2)
-
-
Description copied from class: LuaValue
-
Call this with 2 arguments, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use LuaValue.invoke() instead. -

- To call this as a method call, use LuaValue.method(LuaValue) instead. -

-

-
Specified by:
call in class TwoArgFunction
-
-
-
Parameters:
arg1 - First argument to supply to the called function
arg2 - Second argument to supply to the called function -
Returns:
First return value (this(arg1,arg2)), or NIL if there were none.
See Also:
LuaValue.call(), -LuaValue.call(LuaValue), -LuaValue.call(LuaValue, LuaValue, LuaValue), -#invoke(LuaValue,LuaValue), -LuaValue.method(String,LuaValue,LuaValue), -LuaValue.method(LuaValue,LuaValue,LuaValue)
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/JseMathLib.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/JseMathLib.html deleted file mode 100644 index c682c7eeb..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/JseMathLib.html +++ /dev/null @@ -1,462 +0,0 @@ - - - - - - -JseMathLib (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2.lib.jse -
-Class JseMathLib

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.LuaFunction
-              extended by org.luaj.vm2.lib.LibFunction
-                  extended by org.luaj.vm2.lib.OneArgFunction
-                      extended by org.luaj.vm2.lib.MathLib
-                          extended by org.luaj.vm2.lib.jse.JseMathLib
-
-
-
-
public class JseMathLib
extends MathLib
- - -

-Subclass of LibFunction which implements the lua standard math - library. -

- It contains all lua math functions, including those not available on the JME platform. - See org.luaj.lib.MathLib for the exception list. -

- Typically, this library is included as part of a call to - JsePlatform.standardGlobals() -

- To instantiate and use it directly, - link it into your globals table via LuaValue.load(LuaValue) using code such as: -

 LuaTable _G = new LuaTable();
- LuaThread.setGlobals(_G);
- _G.load(new JseBaseLib());
- _G.load(new PackageLib());
- _G.load(new JseMathLib());
- System.out.println( _G.get("math").get("sqrt").call( LuaValue.valueOf(2) ) );
-  
- Doing so will ensure the library is properly initialized - and loaded into the globals table. -

- This has been implemented to match as closely as possible the behavior in the corresponding library in C. -

- -

-

-
See Also:
LibFunction, -JsePlatform, -JmePlatform, -JseMathLib, -http://www.lua.org/manual/5.1/manual.html#5.6
-
- -

- - - - - - - - - - - - - - - -
-Nested Class Summary
-static classJseMathLib.JseMathLib1 - -
-           
-static classJseMathLib.JseMathLib2 - -
-           
- - - - - - -
-Field Summary
- - - - - - - -
Fields inherited from class org.luaj.vm2.lib.MathLib
MATHLIB
- - - - - - - -
Fields inherited from class org.luaj.vm2.lib.LibFunction
name, opcode
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaFunction
env, s_metatable
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - -
-Constructor Summary
JseMathLib() - -
-           
-  - - - - - - - - - - - - - - - -
-Method Summary
- LuaValuecall(LuaValue arg) - -
-          Call this with 1 argument, including metatag processing, - and return only the first return value.
- doubledpow_lib(double a, - double b) - -
-          Faster, better version of pow() used by arithmetic operator ^
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.MathLib
dpow_d, dpow_default, dpow
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.OneArgFunction
call, call, call, invoke
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.LibFunction
bind, bind, newupe, newupl, newupn, tojstring
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaFunction
checkfunction, getfenv, getmetatable, isfunction, optfunction, setfenv, type, typename
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
add, add, add, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, callmt, checkboolean, checkclosure, checkdouble, checkint, checkinteger, checkjstring, checklong, checkmetatag, checknotnil, checknumber, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalidkey, compareerror, compareerror, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, div, div, div, divInto, eq_b, eq, eqmtcall, equals, error, get, get, get, getn, gettable, gt_b, gt_b, gt_b, gt, gt, gt, gteq_b, gteq_b, gteq_b, gteq, gteq, gteq, illegal, inext, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isint, isinttype, islong, isnil, isnumber, isstring, istable, isthread, isuserdata, isuserdata, isweaknil, len, lenerror, length, listOf, listOf, load, lt_b, lt_b, lt_b, lt, lt, lt, lteq_b, lteq_b, lteq_b, lteq, lteq, lteq, metatag, method, method, method, method, method, method, mod, mod, mod, modFrom, mul, mul, mul, narg, neg, neq_b, neq, next, not, onInvoke, optboolean, optclosure, optdouble, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, or, pow, pow, pow, powWith, powWith, presize, raweq, raweq, raweq, raweq, raweq, rawget, rawget, rawget, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setmetatable, settable, strcmp, strcmp, strongkey, strongvalue, strvalue, sub, sub, sub, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, tobyte, tochar, todouble, tofloat, toint, tolong, tonumber, toshort, tostring, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Constructor Detail
- -

-JseMathLib

-
-public JseMathLib()
-
-
- - - - - - - - -
-Method Detail
- -

-call

-
-public LuaValue call(LuaValue arg)
-
-
Description copied from class: LuaValue
-
Call this with 1 argument, including metatag processing, - and return only the first return value. -

- If this is a LuaFunction, call it, - and return only its first return value, dropping any others. - Otherwise, look for the CALL metatag and call that. -

- If the return value is a Varargs, only the 1st value will be returned. - To get multiple values, use LuaValue.invoke() instead. -

- To call this as a method call, use LuaValue.method(LuaValue) instead. -

-

-
Overrides:
call in class MathLib
-
-
-
Parameters:
arg - First argument to supply to the called function -
Returns:
First return value (this(arg)), or NIL if there were none.
See Also:
LuaValue.call(), -LuaValue.call(LuaValue,LuaValue), -LuaValue.call(LuaValue, LuaValue, LuaValue), -#invoke(LuaValue), -LuaValue.method(String,LuaValue), -LuaValue.method(LuaValue,LuaValue)
-
-
-
- -

-dpow_lib

-
-public double dpow_lib(double a,
-                       double b)
-
-
Faster, better version of pow() used by arithmetic operator ^ -

-

-
Overrides:
dpow_lib in class MathLib
-
-
-
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/JseOsLib.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/JseOsLib.html deleted file mode 100644 index 01353df70..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/JseOsLib.html +++ /dev/null @@ -1,572 +0,0 @@ - - - - - - -JseOsLib (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2.lib.jse -
-Class JseOsLib

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.LuaFunction
-              extended by org.luaj.vm2.lib.LibFunction
-                  extended by org.luaj.vm2.lib.VarArgFunction
-                      extended by org.luaj.vm2.lib.OsLib
-                          extended by org.luaj.vm2.lib.jse.JseOsLib
-
-
-
-
public class JseOsLib
extends OsLib
- - -

-Subclass of LibFunction which implements the standard lua os library. -

- This contains more complete implementations of the following functions - using features that are specific to JSE: -

-

- Because the nature of the os library is to encapsulate - os-specific features, the behavior of these functions varies considerably - from their counterparts in the C platform. -

- Typically, this library is included as part of a call to either - JsePlatform.standardGlobals() -

- To instantiate and use it directly, - link it into your globals table via LuaValue.load(LuaValue) using code such as: -

 LuaTable _G = new LuaTable();
- LuaThread.setGlobals(_G);
- _G.load(new JseBaseLib());
- _G.load(new PackageLib());
- _G.load(new JseOsLib());
- System.out.println( _G.get("os").get("time").call() );
-  
- Doing so will ensure the library is properly initialized - and loaded into the globals table. -

-

- -

-

-
See Also:
LibFunction, -OsLib, -JsePlatform, -JmePlatform, -http://www.lua.org/manual/5.1/manual.html#5.8
-
- -

- - - - - - - - - - - - - - - - - - - -
-Field Summary
-static intEXEC_ERROR - -
-          return code indicating the execute() threw an unknown exception
-static intEXEC_INTERRUPTED - -
-          return code indicating the execute() was interrupted
-static intEXEC_IOEXCEPTION - -
-          return code indicating the execute() threw an I/O exception
- - - - - - - -
Fields inherited from class org.luaj.vm2.lib.OsLib
TMP_PREFIX, TMP_SUFFIX
- - - - - - - -
Fields inherited from class org.luaj.vm2.lib.LibFunction
name, opcode
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaFunction
env, s_metatable
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - -
-Constructor Summary
JseOsLib() - -
-          public constructor
-  - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
-protected  intexecute(java.lang.String command) - -
-          This function is equivalent to the C function system.
-protected  voidremove(java.lang.String filename) - -
-          Deletes the file or directory with the given name.
-protected  voidrename(java.lang.String oldname, - java.lang.String newname) - -
-          Renames file or directory named oldname to newname.
-protected  java.lang.Stringtmpname() - -
-          Returns a string with a file name that can be used for a temporary file.
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.OsLib
clock, date, difftime, exit, getenv, init, invoke, setlocale, time
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.VarArgFunction
call, call, call, call, onInvoke
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.LibFunction
bind, bind, newupe, newupl, newupn, tojstring
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaFunction
checkfunction, getfenv, getmetatable, isfunction, optfunction, setfenv, type, typename
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
add, add, add, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, callmt, checkboolean, checkclosure, checkdouble, checkint, checkinteger, checkjstring, checklong, checkmetatag, checknotnil, checknumber, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalidkey, compareerror, compareerror, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, div, div, div, divInto, eq_b, eq, eqmtcall, equals, error, get, get, get, getn, gettable, gt_b, gt_b, gt_b, gt, gt, gt, gteq_b, gteq_b, gteq_b, gteq, gteq, gteq, illegal, inext, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isint, isinttype, islong, isnil, isnumber, isstring, istable, isthread, isuserdata, isuserdata, isweaknil, len, lenerror, length, listOf, listOf, load, lt_b, lt_b, lt_b, lt, lt, lt, lteq_b, lteq_b, lteq_b, lteq, lteq, lteq, metatag, method, method, method, method, method, method, mod, mod, mod, modFrom, mul, mul, mul, narg, neg, neq_b, neq, next, not, optboolean, optclosure, optdouble, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, or, pow, pow, pow, powWith, powWith, presize, raweq, raweq, raweq, raweq, raweq, rawget, rawget, rawget, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setmetatable, settable, strcmp, strcmp, strongkey, strongvalue, strvalue, sub, sub, sub, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, tobyte, tochar, todouble, tofloat, toint, tolong, tonumber, toshort, tostring, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Field Detail
- -

-EXEC_IOEXCEPTION

-
-public static int EXEC_IOEXCEPTION
-
-
return code indicating the execute() threw an I/O exception -

-

-
-
-
- -

-EXEC_INTERRUPTED

-
-public static int EXEC_INTERRUPTED
-
-
return code indicating the execute() was interrupted -

-

-
-
-
- -

-EXEC_ERROR

-
-public static int EXEC_ERROR
-
-
return code indicating the execute() threw an unknown exception -

-

-
-
- - - - - - - - -
-Constructor Detail
- -

-JseOsLib

-
-public JseOsLib()
-
-
public constructor -

-

- - - - - - - - -
-Method Detail
- -

-execute

-
-protected int execute(java.lang.String command)
-
-
Description copied from class: OsLib
-
This function is equivalent to the C function system. - It passes command to be executed by an operating system shell. - It returns a status code, which is system-dependent. - If command is absent, then it returns nonzero if a shell - is available and zero otherwise. -

-

-
Overrides:
execute in class OsLib
-
-
-
Parameters:
command - command to pass to the system
-
-
-
- -

-remove

-
-protected void remove(java.lang.String filename)
-               throws java.io.IOException
-
-
Description copied from class: OsLib
-
Deletes the file or directory with the given name. - Directories must be empty to be removed. - If this function fails, it throws and IOException -

-

-
Overrides:
remove in class OsLib
-
-
- -
Throws: -
java.io.IOException - if it fails
-
-
-
- -

-rename

-
-protected void rename(java.lang.String oldname,
-                      java.lang.String newname)
-               throws java.io.IOException
-
-
Description copied from class: OsLib
-
Renames file or directory named oldname to newname. - If this function fails,it throws and IOException -

-

-
Overrides:
rename in class OsLib
-
-
-
Parameters:
oldname - old file name
newname - new file name -
Throws: -
java.io.IOException - if it fails
-
-
-
- -

-tmpname

-
-protected java.lang.String tmpname()
-
-
Description copied from class: OsLib
-
Returns a string with a file name that can be used for a temporary file. - The file must be explicitly opened before its use and explicitly removed - when no longer needed. - - On some systems (POSIX), this function also creates a file with that name, - to avoid security risks. (Someone else might create the file with wrong - permissions in the time between getting the name and creating the file.) - You still have to open the file to use it and to remove it (even if you - do not use it). -

-

-
Overrides:
tmpname in class OsLib
-
-
- -
Returns:
String filename to use
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/JsePlatform.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/JsePlatform.html deleted file mode 100644 index f00150d5d..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/JsePlatform.html +++ /dev/null @@ -1,326 +0,0 @@ - - - - - - -JsePlatform (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2.lib.jse -
-Class JsePlatform

-
-java.lang.Object
-  extended by org.luaj.vm2.lib.jse.JsePlatform
-
-
-
-
public class JsePlatform
extends java.lang.Object
- - -

-The JsePlatform class is a convenience class to standardize - how globals tables are initialized for the JSE platform. -

- It is used to allocate either a set of standard globals using - standardGlobals() or debug globals using debugGlobals() -

- A simple example of initializing globals and using them from Java is: -

 LuaValue _G = JsePlatform.standardGlobals();
- _G.get("print").call(LuaValue.valueOf("hello, world"));
-  
-

- Once globals are created, a simple way to load and run a script is: -

 LoadState.load( new FileInputStream("main.lua"), "main.lua", _G ).call();
-  
-

- although require could also be used: -

 _G.get("require").call(LuaValue.valueOf("main"));
-  
- For this to succeed, the file "main.lua" must be in the current directory or a resource. - See JseBaseLib for details on finding scripts using ResourceFinder. -

- The standard globals will contain all standard libraries plus luajava: -

- In addition, the LuaC compiler is installed so lua files may be loaded in their source form. -

- The debug globals are simply the standard globals plus the debug library DebugLib. -

- The class ensures that initialization is done in the correct order, - and that linkage is made to LuaThread.setGlobals(LuaValue). -

- -

-

-
See Also:
JmePlatform
-
- -

- - - - - - - - - - - -
-Constructor Summary
JsePlatform() - -
-           
-  - - - - - - - - - - - - - - - -
-Method Summary
-static LuaTabledebugGlobals() - -
-          Create standard globals including the debug library.
-static LuaTablestandardGlobals() - -
-          Create a standard set of globals for JSE including all the libraries.
- - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-  -

- - - - - - - - -
-Constructor Detail
- -

-JsePlatform

-
-public JsePlatform()
-
-
- - - - - - - - -
-Method Detail
- -

-standardGlobals

-
-public static LuaTable standardGlobals()
-
-
Create a standard set of globals for JSE including all the libraries. -

-

- -
Returns:
Table of globals initialized with the standard JSE libraries
See Also:
debugGlobals(), -JsePlatform, -JmePlatform
-
-
-
- -

-debugGlobals

-
-public static LuaTable debugGlobals()
-
-
Create standard globals including the debug library. -

-

- -
Returns:
Table of globals initialized with the standard JSE and debug libraries
See Also:
standardGlobals(), -JsePlatform, -JmePlatform, -DebugLib
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/JseProcess.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/JseProcess.html deleted file mode 100644 index 297ffaa92..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/JseProcess.html +++ /dev/null @@ -1,323 +0,0 @@ - - - - - - -JseProcess (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2.lib.jse -
-Class JseProcess

-
-java.lang.Object
-  extended by org.luaj.vm2.lib.jse.JseProcess
-
-
-
-
public class JseProcess
extends java.lang.Object
- - -

-Analog of Process that pipes input and output to client-specified streams. -

- -

-


- -

- - - - - - - - - - - - - - -
-Constructor Summary
JseProcess(java.lang.String[] cmd, - java.io.InputStream stdin, - java.io.OutputStream stdout, - java.io.OutputStream stderr) - -
-          Construct a process around a command, with specified streams to redirect input and output to.
JseProcess(java.lang.String cmd, - java.io.InputStream stdin, - java.io.OutputStream stdout, - java.io.OutputStream stderr) - -
-          Construct a process around a command, with specified streams to redirect input and output to.
-  - - - - - - - - - - - - - - - -
-Method Summary
- intexitValue() - -
-          Get the exit value of the process.
- intwaitFor() - -
-          Wait for the process to complete, and all pending output to finish.
- - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-  -

- - - - - - - - -
-Constructor Detail
- -

-JseProcess

-
-public JseProcess(java.lang.String[] cmd,
-                  java.io.InputStream stdin,
-                  java.io.OutputStream stdout,
-                  java.io.OutputStream stderr)
-           throws java.io.IOException
-
-
Construct a process around a command, with specified streams to redirect input and output to. -

-

-
Parameters:
cmd - The command to execute, including arguments, if any
stdin - Optional InputStream to read from as process input, or null if input is not needed.
stdout - Optional OutputStream to copy process output to, or null if output is ignored.
stderr - Optinoal OutputStream to copy process stderr output to, or null if output is ignored. -
Throws: -
java.io.IOException - If the system process could not be created.
See Also:
Process
-
-
- -

-JseProcess

-
-public JseProcess(java.lang.String cmd,
-                  java.io.InputStream stdin,
-                  java.io.OutputStream stdout,
-                  java.io.OutputStream stderr)
-           throws java.io.IOException
-
-
Construct a process around a command, with specified streams to redirect input and output to. -

-

-
Parameters:
cmd - The command to execute, including arguments, if any
stdin - Optional InputStream to read from as process input, or null if input is not needed.
stdout - Optional OutputStream to copy process output to, or null if output is ignored.
stderr - Optinoal OutputStream to copy process stderr output to, or null if output is ignored. -
Throws: -
java.io.IOException - If the system process could not be created.
See Also:
Process
-
- - - - - - - - -
-Method Detail
- -

-exitValue

-
-public int exitValue()
-
-
Get the exit value of the process. -

-

-
-
-
-
- -

-waitFor

-
-public int waitFor()
-            throws java.lang.InterruptedException
-
-
Wait for the process to complete, and all pending output to finish. -

-

- -
Returns:
The exit status. -
Throws: -
java.lang.InterruptedException
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/LuajavaLib.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/LuajavaLib.html deleted file mode 100644 index ff4c39403..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/LuajavaLib.html +++ /dev/null @@ -1,412 +0,0 @@ - - - - - - -LuajavaLib (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2.lib.jse -
-Class LuajavaLib

-
-java.lang.Object
-  extended by org.luaj.vm2.Varargs
-      extended by org.luaj.vm2.LuaValue
-          extended by org.luaj.vm2.LuaFunction
-              extended by org.luaj.vm2.lib.LibFunction
-                  extended by org.luaj.vm2.lib.VarArgFunction
-                      extended by org.luaj.vm2.lib.jse.LuajavaLib
-
-
-
-
public class LuajavaLib
extends VarArgFunction
- - -

-Subclass of LibFunction which implements the features of the luajava package. -

- Luajava is an approach to mixing lua and java using simple functions that bind - java classes and methods to lua dynamically. The API is documented on the - luajava documentation pages. -

- Typically, this library is included as part of a call to either - JsePlatform.standardGlobals() -

- To instantiate and use it directly, - link it into your globals table via LuaValue.load(LuaValue) using code such as: -

 LuaTable _G = new LuaTable();
- LuaThread.setGlobals(_G);
- LuaC.install();
- _G.load(new BaseLib());
- _G.load(new PackageLib());
- _G.load(new LuajavaLib());
- _G.get("loadstring").call( LuaValue.valueOf( 
- 		"sys = luajava.bindClass('java.lang.System')\n"+
- 		"print ( sys:currentTimeMillis() )\n" ) ).call(); 
-  
- This example is not intended to be realistic - only to show how the LuajavaLib - may be initialized by hand. In practice, the luajava library is available - on all JSE platforms via the call to JsePlatform.standardGlobals() - and the luajava api's are simply invoked from lua. -

- This has been implemented to match as closely as possible the behavior in the corresponding library in C. -

- -

-

-
See Also:
LibFunction, -JsePlatform, -JmePlatform, -LuaC, -http://www.keplerproject.org/luajava/manual.html#luareference
-
- -

- - - - - - - -
-Field Summary
- - - - - - - -
Fields inherited from class org.luaj.vm2.lib.LibFunction
name, opcode
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaFunction
env, s_metatable
- - - - - - - -
Fields inherited from class org.luaj.vm2.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO
-  - - - - - - - - - - -
-Constructor Summary
LuajavaLib() - -
-           
-  - - - - - - - - - - - - - - - -
-Method Summary
-protected  java.lang.ClassclassForName(java.lang.String name) - -
-           
- Varargsinvoke(Varargs args) - -
-          Override and implement for the best performance.
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.VarArgFunction
call, call, call, call, onInvoke
- - - - - - - -
Methods inherited from class org.luaj.vm2.lib.LibFunction
bind, bind, newupe, newupl, newupn, tojstring
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaFunction
checkfunction, getfenv, getmetatable, isfunction, optfunction, setfenv, type, typename
- - - - - - - -
Methods inherited from class org.luaj.vm2.LuaValue
add, add, add, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, buffer, callmt, checkboolean, checkclosure, checkdouble, checkint, checkinteger, checkjstring, checklong, checkmetatag, checknotnil, checknumber, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalidkey, compareerror, compareerror, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, div, div, div, divInto, eq_b, eq, eqmtcall, equals, error, get, get, get, getn, gettable, gt_b, gt_b, gt_b, gt, gt, gt, gteq_b, gteq_b, gteq_b, gteq, gteq, gteq, illegal, inext, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isint, isinttype, islong, isnil, isnumber, isstring, istable, isthread, isuserdata, isuserdata, isweaknil, len, lenerror, length, listOf, listOf, load, lt_b, lt_b, lt_b, lt, lt, lt, lteq_b, lteq_b, lteq_b, lteq, lteq, lteq, metatag, method, method, method, method, method, method, mod, mod, mod, modFrom, mul, mul, mul, narg, neg, neq_b, neq, next, not, optboolean, optclosure, optdouble, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, or, pow, pow, pow, powWith, powWith, presize, raweq, raweq, raweq, raweq, raweq, rawget, rawget, rawget, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setmetatable, settable, strcmp, strcmp, strongkey, strongvalue, strvalue, sub, sub, sub, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, tobyte, tochar, todouble, tofloat, toint, tolong, tonumber, toshort, tostring, toString, touserdata, touserdata, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
- - - - - - - -
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
- - - - - - - -
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - -
-Constructor Detail
- -

-LuajavaLib

-
-public LuajavaLib()
-
-
- - - - - - - - -
-Method Detail
- -

-invoke

-
-public Varargs invoke(Varargs args)
-
-
Description copied from class: VarArgFunction
-
Override and implement for the best performance. - May not have expected behavior for tail calls. - Should not be used if either: - - function needs to be used as a module - - function has a possibility of returning a TailcallVarargs -

-

-
Overrides:
invoke in class VarArgFunction
-
-
-
Parameters:
args - the arguments to the function call. -
Returns:
All return values as a Varargs instance.
See Also:
LuaValue.varargsOf(LuaValue[]), -LuaValue.call(LuaValue), -LuaValue.invoke(), -LuaValue.invoke(LuaValue,Varargs), -LuaValue.invokemethod(String,Varargs), -LuaValue.invokemethod(LuaValue,Varargs)
-
-
-
- -

-classForName

-
-protected java.lang.Class classForName(java.lang.String name)
-                                throws java.lang.ClassNotFoundException
-
-
- -
Throws: -
java.lang.ClassNotFoundException
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/class-use/CoerceJavaToLua.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/class-use/CoerceJavaToLua.html deleted file mode 100644 index 4fe33652b..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/class-use/CoerceJavaToLua.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.lib.jse.CoerceJavaToLua (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.lib.jse.CoerceJavaToLua

-
-No usage of org.luaj.vm2.lib.jse.CoerceJavaToLua -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/class-use/CoerceLuaToJava.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/class-use/CoerceLuaToJava.html deleted file mode 100644 index 314ef66ec..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/class-use/CoerceLuaToJava.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.lib.jse.CoerceLuaToJava (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.lib.jse.CoerceLuaToJava

-
-No usage of org.luaj.vm2.lib.jse.CoerceLuaToJava -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/class-use/JseBaseLib.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/class-use/JseBaseLib.html deleted file mode 100644 index 9bfc0d2c4..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/class-use/JseBaseLib.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.lib.jse.JseBaseLib (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.lib.jse.JseBaseLib

-
-No usage of org.luaj.vm2.lib.jse.JseBaseLib -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/class-use/JseIoLib.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/class-use/JseIoLib.html deleted file mode 100644 index dfb67e270..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/class-use/JseIoLib.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.lib.jse.JseIoLib (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.lib.jse.JseIoLib

-
-No usage of org.luaj.vm2.lib.jse.JseIoLib -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/class-use/JseMathLib.JseMathLib1.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/class-use/JseMathLib.JseMathLib1.html deleted file mode 100644 index 00bb0c1be..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/class-use/JseMathLib.JseMathLib1.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.lib.jse.JseMathLib.JseMathLib1 (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.lib.jse.JseMathLib.JseMathLib1

-
-No usage of org.luaj.vm2.lib.jse.JseMathLib.JseMathLib1 -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/class-use/JseMathLib.JseMathLib2.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/class-use/JseMathLib.JseMathLib2.html deleted file mode 100644 index acc814aab..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/class-use/JseMathLib.JseMathLib2.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.lib.jse.JseMathLib.JseMathLib2 (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.lib.jse.JseMathLib.JseMathLib2

-
-No usage of org.luaj.vm2.lib.jse.JseMathLib.JseMathLib2 -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/class-use/JseMathLib.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/class-use/JseMathLib.html deleted file mode 100644 index f4eaed13a..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/class-use/JseMathLib.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.lib.jse.JseMathLib (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.lib.jse.JseMathLib

-
-No usage of org.luaj.vm2.lib.jse.JseMathLib -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/class-use/JseOsLib.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/class-use/JseOsLib.html deleted file mode 100644 index 2a1d5c213..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/class-use/JseOsLib.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.lib.jse.JseOsLib (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.lib.jse.JseOsLib

-
-No usage of org.luaj.vm2.lib.jse.JseOsLib -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/class-use/JsePlatform.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/class-use/JsePlatform.html deleted file mode 100644 index d679f0d2a..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/class-use/JsePlatform.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.lib.jse.JsePlatform (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.lib.jse.JsePlatform

-
-No usage of org.luaj.vm2.lib.jse.JsePlatform -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/class-use/JseProcess.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/class-use/JseProcess.html deleted file mode 100644 index f577d206a..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/class-use/JseProcess.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.lib.jse.JseProcess (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.lib.jse.JseProcess

-
-No usage of org.luaj.vm2.lib.jse.JseProcess -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/class-use/LuajavaLib.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/class-use/LuajavaLib.html deleted file mode 100644 index 5d6c1bc20..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/class-use/LuajavaLib.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.lib.jse.LuajavaLib (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.lib.jse.LuajavaLib

-
-No usage of org.luaj.vm2.lib.jse.LuajavaLib -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/package-frame.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/package-frame.html deleted file mode 100644 index 61b8dc7c2..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/package-frame.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - -org.luaj.vm2.lib.jse (Luaj API) - - - - - - - - - - - -org.luaj.vm2.lib.jse - - - - -
-Classes  - -
-CoerceJavaToLua -
-CoerceLuaToJava -
-JseBaseLib -
-JseIoLib -
-JseMathLib -
-JseMathLib.JseMathLib1 -
-JseMathLib.JseMathLib2 -
-JseOsLib -
-JsePlatform -
-JseProcess -
-LuajavaLib
- - - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/package-summary.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/package-summary.html deleted file mode 100644 index 5b0f77337..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/package-summary.html +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - -org.luaj.vm2.lib.jse (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-

-Package org.luaj.vm2.lib.jse -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class Summary
CoerceJavaToLuaHelper class to coerce values from Java to lua within the luajava library.
CoerceLuaToJavaHelper class to coerce values from lua to Java within the luajava library.
JseBaseLibSubclass of BaseLib and LibFunction which implements the lua basic library functions - and provides a directory based ResourceFinder as the BaseLib.FINDER.
JseIoLibSubclass of IoLib and therefore LibFunction which implements the lua standard io - library for the JSE platform.
JseMathLibSubclass of LibFunction which implements the lua standard math - library.
JseMathLib.JseMathLib1 
JseMathLib.JseMathLib2 
JseOsLibSubclass of LibFunction which implements the standard lua os library.
JsePlatformThe JsePlatform class is a convenience class to standardize - how globals tables are initialized for the JSE platform.
JseProcessAnalog of Process that pipes input and output to client-specified streams.
LuajavaLibSubclass of LibFunction which implements the features of the luajava package.
-  - -

-

-
-
- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/package-tree.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/package-tree.html deleted file mode 100644 index 785d3f9f1..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/package-tree.html +++ /dev/null @@ -1,176 +0,0 @@ - - - - - - -org.luaj.vm2.lib.jse Class Hierarchy (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Hierarchy For Package org.luaj.vm2.lib.jse -

-
-
-
Package Hierarchies:
All Packages
-
-

-Class Hierarchy -

- -
- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/package-use.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/package-use.html deleted file mode 100644 index 7f9f47ee3..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/jse/package-use.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -Uses of Package org.luaj.vm2.lib.jse (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Package
org.luaj.vm2.lib.jse

-
-No usage of org.luaj.vm2.lib.jse -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/package-frame.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/package-frame.html deleted file mode 100644 index a838fe26d..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/package-frame.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - -org.luaj.vm2.lib (Luaj API) - - - - - - - - - - - -org.luaj.vm2.lib - - - - -
-Interfaces  - -
-ResourceFinder
- - - - - - -
-Classes  - -
-BaseLib -
-CoroutineLib -
-DebugLib -
-IoLib -
-LibFunction -
-MathLib -
-OneArgFunction -
-OsLib -
-PackageLib -
-StringLib -
-TableLib -
-ThreeArgFunction -
-TwoArgFunction -
-VarArgFunction -
-ZeroArgFunction
- - - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/package-summary.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/package-summary.html deleted file mode 100644 index 90cc76ef9..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/package-summary.html +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - -org.luaj.vm2.lib (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-

-Package org.luaj.vm2.lib -

- - - - - - - - - -
-Interface Summary
ResourceFinderInterface for opening application resource files such as scripts sources.
-  - -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class Summary
BaseLibSubclass of LibFunction which implements the lua basic library functions.
CoroutineLibSubclass of LibFunction which implements the lua standard coroutine - library.
DebugLibSubclass of LibFunction which implements the lua standard debug - library.
IoLibAbstract base class extending LibFunction which implements the - core of the lua standard io library.
LibFunctionSubclass of LuaFunction common to Java functions exposed to lua.
MathLibSubclass of LibFunction which implements the lua standard math - library.
OneArgFunctionAbstract base class for Java function implementations that take one argument and - return one value.
OsLibSubclass of LibFunction which implements the standard lua os library.
PackageLibSubclass of LibFunction which implements the lua standard package and module - library functions.
StringLibSubclass of LibFunction which implements the lua standard string - library.
TableLibSubclass of LibFunction which implements the lua standard table - library.
ThreeArgFunctionAbstract base class for Java function implementations that take two arguments and - return one value.
TwoArgFunctionAbstract base class for Java function implementations that take two arguments and - return one value.
VarArgFunctionAbstract base class for Java function implementations that takes varaiable arguments and - returns multiple return values.
ZeroArgFunctionAbstract base class for Java function implementations that take no arguments and - return one value.
-  - -

-

-
-
- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/package-tree.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/package-tree.html deleted file mode 100644 index bdd86f02a..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/package-tree.html +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - -org.luaj.vm2.lib Class Hierarchy (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Hierarchy For Package org.luaj.vm2.lib -

-
-
-
Package Hierarchies:
All Packages
-
-

-Class Hierarchy -

- -

-Interface Hierarchy -

- -
- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/package-use.html b/luaj-2.0.3/docs/api/org/luaj/vm2/lib/package-use.html deleted file mode 100644 index f5484bf6f..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/lib/package-use.html +++ /dev/null @@ -1,333 +0,0 @@ - - - - - - -Uses of Package org.luaj.vm2.lib (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Package
org.luaj.vm2.lib

-
- - - - - - - - - - - - - - - - - -
-Packages that use org.luaj.vm2.lib
org.luaj.vm2.lib  
org.luaj.vm2.lib.jme  
org.luaj.vm2.lib.jse  
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Classes in org.luaj.vm2.lib used by org.luaj.vm2.lib
BaseLib - -
-          Subclass of LibFunction which implements the lua basic library functions.
IoLib.File - -
-           
LibFunction - -
-          Subclass of LuaFunction common to Java functions exposed to lua.
MathLib - -
-          Subclass of LibFunction which implements the lua standard math - library.
OneArgFunction - -
-          Abstract base class for Java function implementations that take one argument and - return one value.
PackageLib - -
-          Subclass of LibFunction which implements the lua standard package and module - library functions.
ResourceFinder - -
-          Interface for opening application resource files such as scripts sources.
VarArgFunction - -
-          Abstract base class for Java function implementations that takes varaiable arguments and - returns multiple return values.
-  -

- - - - - - - - - - - - - - - - - -
-Classes in org.luaj.vm2.lib used by org.luaj.vm2.lib.jme
IoLib - -
-          Abstract base class extending LibFunction which implements the - core of the lua standard io library.
IoLib.File - -
-           
LibFunction - -
-          Subclass of LuaFunction common to Java functions exposed to lua.
OneArgFunction - -
-          Abstract base class for Java function implementations that take one argument and - return one value.
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Classes in org.luaj.vm2.lib used by org.luaj.vm2.lib.jse
BaseLib - -
-          Subclass of LibFunction which implements the lua basic library functions.
IoLib - -
-          Abstract base class extending LibFunction which implements the - core of the lua standard io library.
IoLib.File - -
-           
LibFunction - -
-          Subclass of LuaFunction common to Java functions exposed to lua.
MathLib - -
-          Subclass of LibFunction which implements the lua standard math - library.
OneArgFunction - -
-          Abstract base class for Java function implementations that take one argument and - return one value.
OsLib - -
-          Subclass of LibFunction which implements the standard lua os library.
ResourceFinder - -
-          Interface for opening application resource files such as scripts sources.
TwoArgFunction - -
-          Abstract base class for Java function implementations that take two arguments and - return one value.
VarArgFunction - -
-          Abstract base class for Java function implementations that takes varaiable arguments and - returns multiple return values.
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/luajc/LuaJC.html b/luaj-2.0.3/docs/api/org/luaj/vm2/luajc/LuaJC.html deleted file mode 100644 index d5d6b0bdb..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/luajc/LuaJC.html +++ /dev/null @@ -1,369 +0,0 @@ - - - - - - -LuaJC (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
- -

- -org.luaj.vm2.luajc -
-Class LuaJC

-
-java.lang.Object
-  extended by org.luaj.vm2.luajc.LuaJC
-
-
-
All Implemented Interfaces:
LoadState.LuaCompiler
-
-
-
-
public class LuaJC
extends java.lang.Object
implements LoadState.LuaCompiler
- - -

-Implementation of LoadState.LuaCompiler which does direct - lua-to-java-bytecode compiling. -

- This requires the bcel library to be on the class path to work as expected. - If the library is not found, the default LuaC lua-to-lua-bytecode - compiler will be used. -

- The compiler should be installed as part of globals initialization, - and before any scripts or lua code is executed. - A typical example is to install it following the globals creation, - as in the following: -

 LuaValue _G = JsePlatform.standardGlobals();
- LuaJC.install();
- LoadState.load( new ByteArrayInputStream("print 'hello'".getBytes()), "main.lua", _G ).call();
-  
-

- -

-

-
See Also:
LoadState.LuaCompiler, -LuaC, -JsePlatform, -JmePlatform, -BaseLib, -LuaValue
-
- -

- - - - - - - - - - - -
-Constructor Summary
LuaJC() - -
-           
-  - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
- java.util.HashtablecompileAll(java.io.InputStream script, - java.lang.String chunkname, - java.lang.String filename) - -
-           
-static LuaJCgetInstance() - -
-           
-static voidinstall() - -
-          Install the compiler as the main compiler to use.
- LuaFunctionload(java.io.InputStream stream, - java.lang.String name, - LuaValue env) - -
-          Load into a Closure or LuaFunction from a Stream and initializes the environment
- - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-  -

- - - - - - - - -
-Constructor Detail
- -

-LuaJC

-
-public LuaJC()
-
-
- - - - - - - - -
-Method Detail
- -

-getInstance

-
-public static LuaJC getInstance()
-
-
-
-
-
-
-
-
-
- -

-install

-
-public static final void install()
-
-
Install the compiler as the main compiler to use. - Will fall back to the LuaC prototype compiler. -

-

-
-
-
-
-
-
-
- -

-compileAll

-
-public java.util.Hashtable compileAll(java.io.InputStream script,
-                                      java.lang.String chunkname,
-                                      java.lang.String filename)
-                               throws java.io.IOException
-
-
-
-
-
- -
Throws: -
java.io.IOException
-
-
-
- -

-load

-
-public LuaFunction load(java.io.InputStream stream,
-                        java.lang.String name,
-                        LuaValue env)
-                 throws java.io.IOException
-
-
Description copied from interface: LoadState.LuaCompiler
-
Load into a Closure or LuaFunction from a Stream and initializes the environment -

-

-
Specified by:
load in interface LoadState.LuaCompiler
-
-
- -
Throws: -
java.io.IOException
-
-
- -
- - - - - - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/luajc/class-use/LuaJC.html b/luaj-2.0.3/docs/api/org/luaj/vm2/luajc/class-use/LuaJC.html deleted file mode 100644 index 36590848d..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/luajc/class-use/LuaJC.html +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - -Uses of Class org.luaj.vm2.luajc.LuaJC (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Class
org.luaj.vm2.luajc.LuaJC

-
- - - - - - - - - -
-Packages that use LuaJC
org.luaj.vm2.luajc  
-  -

- - - - - -
-Uses of LuaJC in org.luaj.vm2.luajc
-  -

- - - - - - - - - -
Methods in org.luaj.vm2.luajc that return LuaJC
-static LuaJCLuaJC.getInstance() - -
-           
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/luajc/package-frame.html b/luaj-2.0.3/docs/api/org/luaj/vm2/luajc/package-frame.html deleted file mode 100644 index ae6ace9b7..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/luajc/package-frame.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - -org.luaj.vm2.luajc (Luaj API) - - - - - - - - - - - -org.luaj.vm2.luajc - - - - -
-Classes  - -
-LuaJC
- - - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/luajc/package-summary.html b/luaj-2.0.3/docs/api/org/luaj/vm2/luajc/package-summary.html deleted file mode 100644 index 3446959c7..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/luajc/package-summary.html +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - -org.luaj.vm2.luajc (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-

-Package org.luaj.vm2.luajc -

- - - - - - - - - -
-Class Summary
LuaJCImplementation of LoadState.LuaCompiler which does direct - lua-to-java-bytecode compiling.
-  - -

-

-
-
- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/luajc/package-tree.html b/luaj-2.0.3/docs/api/org/luaj/vm2/luajc/package-tree.html deleted file mode 100644 index c7e60e2cb..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/luajc/package-tree.html +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - -org.luaj.vm2.luajc Class Hierarchy (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Hierarchy For Package org.luaj.vm2.luajc -

-
-
-
Package Hierarchies:
All Packages
-
-

-Class Hierarchy -

- -
- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/luajc/package-use.html b/luaj-2.0.3/docs/api/org/luaj/vm2/luajc/package-use.html deleted file mode 100644 index ef67ada15..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/luajc/package-use.html +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - -Uses of Package org.luaj.vm2.luajc (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Package
org.luaj.vm2.luajc

-
- - - - - - - - - -
-Packages that use org.luaj.vm2.luajc
org.luaj.vm2.luajc  
-  -

- - - - - - - - -
-Classes in org.luaj.vm2.luajc used by org.luaj.vm2.luajc
LuaJC - -
-          Implementation of LoadState.LuaCompiler which does direct - lua-to-java-bytecode compiling.
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/package-frame.html b/luaj-2.0.3/docs/api/org/luaj/vm2/package-frame.html deleted file mode 100644 index d86427e99..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/package-frame.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - -org.luaj.vm2 (Luaj API) - - - - - - - - - - - -org.luaj.vm2 - - - - -
-Interfaces  - -
-LoadState.LuaCompiler
- - - - - - -
-Classes  - -
-Buffer -
-LoadState -
-LocVars -
-Lua -
-LuaBoolean -
-LuaClosure -
-LuaDouble -
-LuaFunction -
-LuaInteger -
-LuaNil -
-LuaNumber -
-LuaString -
-LuaTable -
-LuaThread -
-LuaThread.CallStack -
-LuaUserdata -
-LuaValue -
-Print -
-Prototype -
-TailcallVarargs -
-UpValue -
-Varargs -
-WeakTable
- - - - - - -
-Exceptions  - -
-LuaError
- - - - - - -
-Errors  - -
-OrphanedThread
- - - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/package-summary.html b/luaj-2.0.3/docs/api/org/luaj/vm2/package-summary.html deleted file mode 100644 index e8bffe8e0..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/package-summary.html +++ /dev/null @@ -1,291 +0,0 @@ - - - - - - -org.luaj.vm2 (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-

-Package org.luaj.vm2 -

- - - - - - - - - -
-Interface Summary
LoadState.LuaCompilerInterface for the compiler, if it is installed.
-  - -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class Summary
BufferString buffer for use in string library methods, optimized for production - of StrValue instances.
LoadStateClass to manage loading of Prototype instances.
LocVarsData class to hold debug information relatign to local variables for a Prototype
LuaConstants for lua limits and opcodes.
LuaBooleanExtension of LuaValue which can hold a Java boolean as its value.
LuaClosureExtension of LuaFunction which executes lua bytecode.
LuaDoubleExtension of LuaNumber which can hold a Java double as its value.
LuaFunctionBase class for functions implemented in Java.
LuaIntegerExtension of LuaNumber which can hold a Java int as its value.
LuaNilClass to encapsulate behavior of the singleton instance nil
LuaNumberBase class for representing numbers as lua values directly.
LuaStringSubclass of LuaValue for representing lua strings.
LuaTableSubclass of LuaValue for representing lua tables.
LuaThreadSubclass of LuaValue that implements - a lua coroutine thread using Java Threads.
LuaThread.CallStack 
LuaUserdata 
LuaValueBase class for all concrete lua type values.
PrintDebug helper class to pretty-print lua bytecodes.
PrototypePrototype representing compiled lua code.
TailcallVarargsSubclass of Varargs that represents a lua tail call - in a Java library function execution environment.
UpValueUpvalue used with Closure formulation
VarargsClass to encapsulate varargs values, either as part of a variable argument list, or multiple return values.
WeakTableSubclass of LuaTable that provides weak key and weak value semantics.
-  - -

- - - - - - - - - -
-Exception Summary
LuaErrorRuntimeException that is thrown and caught in response to a lua error.
-  - -

- - - - - - - - - -
-Error Summary
OrphanedThreadError sublcass that indicates a lua thread that is no - longer referenced has been detected.
-  - -

-

-
-
- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/package-tree.html b/luaj-2.0.3/docs/api/org/luaj/vm2/package-tree.html deleted file mode 100644 index 866976768..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/package-tree.html +++ /dev/null @@ -1,179 +0,0 @@ - - - - - - -org.luaj.vm2 Class Hierarchy (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Hierarchy For Package org.luaj.vm2 -

-
-
-
Package Hierarchies:
All Packages
-
-

-Class Hierarchy -

- -

-Interface Hierarchy -

- -
- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/org/luaj/vm2/package-use.html b/luaj-2.0.3/docs/api/org/luaj/vm2/package-use.html deleted file mode 100644 index 8e4890ac6..000000000 --- a/luaj-2.0.3/docs/api/org/luaj/vm2/package-use.html +++ /dev/null @@ -1,490 +0,0 @@ - - - - - - -Uses of Package org.luaj.vm2 (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Uses of Package
org.luaj.vm2

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Packages that use org.luaj.vm2
org.luaj.vm2  
org.luaj.vm2.compiler  
org.luaj.vm2.lib  
org.luaj.vm2.lib.jme  
org.luaj.vm2.lib.jse  
org.luaj.vm2.luajc  
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Classes in org.luaj.vm2 used by org.luaj.vm2
Buffer - -
-          String buffer for use in string library methods, optimized for production - of StrValue instances.
LoadState.LuaCompiler - -
-          Interface for the compiler, if it is installed.
LocVars - -
-          Data class to hold debug information relatign to local variables for a Prototype
Lua - -
-          Constants for lua limits and opcodes.
LuaBoolean - -
-          Extension of LuaValue which can hold a Java boolean as its value.
LuaClosure - -
-          Extension of LuaFunction which executes lua bytecode.
LuaDouble - -
-          Extension of LuaNumber which can hold a Java double as its value.
LuaFunction - -
-          Base class for functions implemented in Java.
LuaInteger - -
-          Extension of LuaNumber which can hold a Java int as its value.
LuaNumber - -
-          Base class for representing numbers as lua values directly.
LuaString - -
-          Subclass of LuaValue for representing lua strings.
LuaTable - -
-          Subclass of LuaValue for representing lua tables.
LuaThread - -
-          Subclass of LuaValue that implements - a lua coroutine thread using Java Threads.
LuaThread.CallStack - -
-           
LuaUserdata - -
-           
LuaValue - -
-          Base class for all concrete lua type values.
Prototype - -
-          Prototype representing compiled lua code.
UpValue - -
-          Upvalue used with Closure formulation
Varargs - -
-          Class to encapsulate varargs values, either as part of a variable argument list, or multiple return values.
-  -

- - - - - - - - - - - - - - - - - - - - - - - -
-Classes in org.luaj.vm2 used by org.luaj.vm2.compiler
LoadState.LuaCompiler - -
-          Interface for the compiler, if it is installed.
Lua - -
-          Constants for lua limits and opcodes.
LuaFunction - -
-          Base class for functions implemented in Java.
LuaString - -
-          Subclass of LuaValue for representing lua strings.
LuaValue - -
-          Base class for all concrete lua type values.
Prototype - -
-          Prototype representing compiled lua code.
-  -

- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Classes in org.luaj.vm2 used by org.luaj.vm2.lib
LuaFunction - -
-          Base class for functions implemented in Java.
LuaString - -
-          Subclass of LuaValue for representing lua strings.
LuaTable - -
-          Subclass of LuaValue for representing lua tables.
LuaThread - -
-          Subclass of LuaValue that implements - a lua coroutine thread using Java Threads.
LuaValue - -
-          Base class for all concrete lua type values.
Prototype - -
-          Prototype representing compiled lua code.
Varargs - -
-          Class to encapsulate varargs values, either as part of a variable argument list, or multiple return values.
-  -

- - - - - - - - - - - - - - - - - -
-Classes in org.luaj.vm2 used by org.luaj.vm2.lib.jme
LuaFunction - -
-          Base class for functions implemented in Java.
LuaTable - -
-          Subclass of LuaValue for representing lua tables.
LuaValue - -
-          Base class for all concrete lua type values.
Varargs - -
-          Class to encapsulate varargs values, either as part of a variable argument list, or multiple return values.
-  -

- - - - - - - - - - - - - - - - - -
-Classes in org.luaj.vm2 used by org.luaj.vm2.lib.jse
LuaFunction - -
-          Base class for functions implemented in Java.
LuaTable - -
-          Subclass of LuaValue for representing lua tables.
LuaValue - -
-          Base class for all concrete lua type values.
Varargs - -
-          Class to encapsulate varargs values, either as part of a variable argument list, or multiple return values.
-  -

- - - - - - - - - - - - - - -
-Classes in org.luaj.vm2 used by org.luaj.vm2.luajc
LoadState.LuaCompiler - -
-          Interface for the compiler, if it is installed.
LuaFunction - -
-          Base class for functions implemented in Java.
LuaValue - -
-          Base class for all concrete lua type values.
-  -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/overview-frame.html b/luaj-2.0.3/docs/api/overview-frame.html deleted file mode 100644 index f6d436a2b..000000000 --- a/luaj-2.0.3/docs/api/overview-frame.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - -Overview List (Luaj API) - - - - - - - - - - - - - - - -
-
- - - - - -
All Classes -

- -Packages -
-org.luaj.vm2 -
-org.luaj.vm2.compiler -
-org.luaj.vm2.lib -
-org.luaj.vm2.lib.jme -
-org.luaj.vm2.lib.jse -
-org.luaj.vm2.luajc -
-

- -

-  - - diff --git a/luaj-2.0.3/docs/api/overview-summary.html b/luaj-2.0.3/docs/api/overview-summary.html deleted file mode 100644 index 467df1d20..000000000 --- a/luaj-2.0.3/docs/api/overview-summary.html +++ /dev/null @@ -1,176 +0,0 @@ - - - - - - -Overview (Luaj API) - - - - - - - - - - - - -


- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-

Luaj API

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Other Packages
org.luaj.vm2 
org.luaj.vm2.compiler 
org.luaj.vm2.lib 
org.luaj.vm2.lib.jme 
org.luaj.vm2.lib.jse 
org.luaj.vm2.luajc 
- -


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/overview-tree.html b/luaj-2.0.3/docs/api/overview-tree.html deleted file mode 100644 index defde82f7..000000000 --- a/luaj-2.0.3/docs/api/overview-tree.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - -Class Hierarchy (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Hierarchy For All Packages

-
-
-
Package Hierarchies:
org.luaj.vm2, org.luaj.vm2.compiler, org.luaj.vm2.lib, org.luaj.vm2.lib.jme, org.luaj.vm2.lib.jse, org.luaj.vm2.luajc
-
-

-Class Hierarchy -

- -

-Interface Hierarchy -

- -
- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/package-list b/luaj-2.0.3/docs/api/package-list deleted file mode 100644 index 51014d44d..000000000 --- a/luaj-2.0.3/docs/api/package-list +++ /dev/null @@ -1,6 +0,0 @@ -org.luaj.vm2 -org.luaj.vm2.compiler -org.luaj.vm2.lib -org.luaj.vm2.lib.jme -org.luaj.vm2.lib.jse -org.luaj.vm2.luajc diff --git a/luaj-2.0.3/docs/api/resources/inherit.gif b/luaj-2.0.3/docs/api/resources/inherit.gif deleted file mode 100644 index c814867a1..000000000 Binary files a/luaj-2.0.3/docs/api/resources/inherit.gif and /dev/null differ diff --git a/luaj-2.0.3/docs/api/serialized-form.html b/luaj-2.0.3/docs/api/serialized-form.html deleted file mode 100644 index 6f291d6e9..000000000 --- a/luaj-2.0.3/docs/api/serialized-form.html +++ /dev/null @@ -1,202 +0,0 @@ - - - - - - -Serialized Form (Luaj API) - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- -
- - - -
-
-

-Serialized Form

-
-
- - - - - -
-Package org.luaj.vm2
- -

- - - - - -
-Class org.luaj.vm2.LuaError extends java.lang.RuntimeException implements Serializable
- -

-serialVersionUID: 1L - -

- - - - - -
-Serialized Fields
- -

-traceback

-
-java.lang.String traceback
-
-
-
-
-
-

-cause

-
-java.lang.Throwable cause
-
-
-
-
- -

- - - - - -
-Class org.luaj.vm2.OrphanedThread extends java.lang.Error implements Serializable
- -

- -

-


- - - - - - - - - - - - - - - -
- -
- - - -
-Copyright © 2007-2008 Luaj.org. All Rights Reserved. - - diff --git a/luaj-2.0.3/docs/api/stylesheet.css b/luaj-2.0.3/docs/api/stylesheet.css deleted file mode 100644 index 6ea9e5161..000000000 --- a/luaj-2.0.3/docs/api/stylesheet.css +++ /dev/null @@ -1,29 +0,0 @@ -/* Javadoc style sheet */ - -/* Define colors, fonts and other style attributes here to override the defaults */ - -/* Page background color */ -body { background-color: #FFFFFF; color:#000000 } - -/* Headings */ -h1 { font-size: 145% } - -/* Table colors */ -.TableHeadingColor { background: #CCCCFF; color:#000000 } /* Dark mauve */ -.TableSubHeadingColor { background: #EEEEFF; color:#000000 } /* Light mauve */ -.TableRowColor { background: #FFFFFF; color:#000000 } /* White */ - -/* Font used in left-hand frame lists */ -.FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 } -.FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } -.FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } - -/* Navigation bar fonts and colors */ -.NavBarCell1 { background-color:#EEEEFF; color:#000000} /* Light mauve */ -.NavBarCell1Rev { background-color:#00008B; color:#FFFFFF} /* Dark Blue */ -.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;color:#000000;} -.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;color:#FFFFFF;} - -.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} -.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} - diff --git a/luaj-2.0.3/examples/jme/SampleMIDlet.java b/luaj-2.0.3/examples/jme/SampleMIDlet.java deleted file mode 100644 index 19fd47342..000000000 --- a/luaj-2.0.3/examples/jme/SampleMIDlet.java +++ /dev/null @@ -1,34 +0,0 @@ - - -import javax.microedition.midlet.MIDlet; -import javax.microedition.midlet.MIDletStateChangeException; - -import org.luaj.vm2.*; -import org.luaj.vm2.lib.*; -import org.luaj.vm2.lib.jme.JmePlatform; -import org.luaj.vm2.compiler.LuaC; - - -public class SampleMIDlet extends MIDlet { - - // the script will be loaded as a resource - private static final String DEFAULT_SCRIPT = "hello.lua"; - - protected void startApp() throws MIDletStateChangeException { - // get the script as an app property - String script = this.getAppProperty("script"); - if ( script == null ) - script = DEFAULT_SCRIPT; - - // create an environment to run in - LuaValue _G = JmePlatform.standardGlobals(); - _G.get("require").call( LuaValue.valueOf(script) ); - } - - protected void destroyApp(boolean arg0) throws MIDletStateChangeException { - } - - protected void pauseApp() { - } - -} diff --git a/luaj-2.0.3/examples/jse/SampleJseMain.java b/luaj-2.0.3/examples/jse/SampleJseMain.java deleted file mode 100644 index 956100816..000000000 --- a/luaj-2.0.3/examples/jse/SampleJseMain.java +++ /dev/null @@ -1,18 +0,0 @@ - - -import org.luaj.vm2.LuaValue; -import org.luaj.vm2.lib.jse.JsePlatform; - -public class SampleJseMain { - - - public static void main(String[] args) throws Exception { - String script = "examples/lua/hello.lua"; - - // create an environment to run in - LuaValue _G = JsePlatform.standardGlobals(); - _G.get("dofile").call( LuaValue.valueOf(script) ); - } - - -} diff --git a/luaj-2.0.3/examples/jse/SampleParser.java b/luaj-2.0.3/examples/jse/SampleParser.java deleted file mode 100644 index 48b773e08..000000000 --- a/luaj-2.0.3/examples/jse/SampleParser.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Sample luaj program that uses the LuaParser class for parsing, and intercepts the - * generated ParseExceptions and fills in the file, line and column information where - * the exception occurred. - */ -import java.io.*; - -import org.luaj.vm2.ast.*; -import org.luaj.vm2.ast.Exp.AnonFuncDef; -import org.luaj.vm2.ast.Stat.FuncDef; -import org.luaj.vm2.ast.Stat.LocalFuncDef; -import org.luaj.vm2.parser.*; - - -public class SampleParser { - - static public void main(String[] args) { - if (args.length == 0) { - System.out.println("usage: SampleParser luafile"); - return; - } - try { - final String file = args[0]; - - // Create a LuaParser. This will fill in line and column number - // information for most exceptions. - LuaParser parser = new LuaParser(new FileInputStream(file)); - - // Perform the parsing. - Chunk chunk = parser.Chunk(); - - // Print out names found in this source file. - chunk.accept( new Visitor() { - public void visit(Exp.NameExp exp) { - System.out.println("Name in use: "+exp.name.name); - } - } ); - - } catch ( ParseException e ) { - System.out.println("parse failed: " + e.getMessage() + "\n" - + "Token Image: '" + e.currentToken.image + "'\n" - + "Location: " + e.currentToken.beginLine + ":" + e.currentToken.beginColumn - + "-" + e.currentToken.endLine + "," + e.currentToken.endColumn); - } catch ( IOException e ) { - System.out.println( "IOException occurred: "+e ); - e.printStackTrace(); - } - } -} \ No newline at end of file diff --git a/luaj-2.0.3/examples/jse/ScriptEngineSample.java b/luaj-2.0.3/examples/jse/ScriptEngineSample.java deleted file mode 100644 index e1518d64d..000000000 --- a/luaj-2.0.3/examples/jse/ScriptEngineSample.java +++ /dev/null @@ -1,128 +0,0 @@ - - -import javax.script.Bindings; -import javax.script.Compilable; -import javax.script.CompiledScript; -import javax.script.ScriptEngine; -import javax.script.ScriptEngineFactory; -import javax.script.ScriptEngineManager; -import javax.script.ScriptException; -import javax.script.SimpleBindings; - -import org.luaj.vm2.LuaValue; - -public class ScriptEngineSample { - - public static void main(String [] args) { - ScriptEngineManager sem = new ScriptEngineManager(); - ScriptEngine e = sem.getEngineByExtension(".lua"); - ScriptEngineFactory f = e.getFactory(); - - // uncomment to enable the lua-to-java bytecode compiler - // (require bcel library in class path) - // org.luaj.vm2.luajc.LuaJC.install(); - - System.out.println( "Engine name: " +f.getEngineName() ); - System.out.println( "Engine Version: " +f.getEngineVersion() ); - System.out.println( "LanguageName: " +f.getLanguageName() ); - System.out.println( "Language Version: " +f.getLanguageVersion() ); - String statement = f.getOutputStatement("\"hello, world\""); - System.out.println(statement); - try { - e.eval(statement); - - e.put("x", 25); - e.eval("y = math.sqrt(x)"); - System.out.println( "y="+e.get("y") ); - - e.put("x", 2); - e.eval("y = math.sqrt(x)"); - System.out.println( "y="+e.get("y") ); - - CompiledScript cs = ((Compilable)e).compile("y = math.sqrt(x); return y"); - Bindings b = e.createBindings(); - b.put("x", 3); - System.out.println( "eval: "+cs.eval(b) ); - System.out.println( "y="+b.get("y") ); - - SimpleBindings sb = new SimpleBindings(); - sb.put("x", 144); - System.out.println( "eval: "+cs.eval(sb) ); - System.out.println( "y="+sb.get("y") ); - - try { - e.eval("\n\nbogus example\n\n"); - } catch ( ScriptException se ) { - System.out.println("script threw ScriptException as expected, message is '"+se.getMessage()+"'"); - } - - testEngineBindings(e); - testClientBindings(e); - testUserClasses(e); - - } catch (ScriptException ex) { - ex.printStackTrace(); - } - } - - public static class SomeUserClass { - public String toString() { - return "user-class-instance-"+this.hashCode(); - } - } - - public static void testEngineBindings(ScriptEngine e) throws ScriptException { - testBindings(e, e.createBindings()); - } - public static void testClientBindings(ScriptEngine e) throws ScriptException { - testBindings(e, new SimpleBindings()); - } - public static void testBindings(ScriptEngine e, Bindings b) throws ScriptException { - CompiledScript cs = ((Compilable)e).compile( - "print( 'somejavaint', type(somejavaint), somejavaint )\n" + - "print( 'somejavadouble', type(somejavadouble), somejavadouble )\n" + - "print( 'somejavastring', type(somejavastring), somejavastring )\n" + - "print( 'somejavaobject', type(somejavaobject), somejavaobject )\n" + - "print( 'somejavaarray', type(somejavaarray), somejavaarray, somejavaarray[1] )\n" + - "someluaint = 444\n" + - "someluadouble = 555.666\n" + - "someluastring = 'def'\n" + - "someluauserdata = somejavaobject\n" + - "someluatable = { 999, 111 }\n" + - "someluafunction = function(x) print( 'hello, world', x ) return 678 end\n" + - "" ); - b.put("somejavaint", 111); - b.put("somejavadouble", 222.333); - b.put("somejavastring", "abc"); - b.put("somejavaobject", new SomeUserClass()); - b.put("somejavaarray", new int[] { 777, 888 } ); - System.out.println( "eval: "+cs.eval(b) ); - Object someluaint = b.get("someluaint"); - Object someluadouble = b.get("someluaint"); - Object someluastring = b.get("someluastring"); - Object someluauserdata = b.get("someluauserdata"); - Object someluatable = b.get("someluatable"); - Object someluafunction = b.get("someluafunction"); - System.out.println( "someluaint: "+someluaint.getClass()+" "+someluaint ); - System.out.println( "someluadouble: "+someluadouble.getClass()+" "+someluadouble ); - System.out.println( "someluastring: "+someluastring.getClass()+" "+someluastring ); - System.out.println( "someluauserdata: "+someluauserdata.getClass()+" "+someluauserdata ); - System.out.println( "someluatable: "+someluatable.getClass()+" "+someluatable ); - System.out.println( "someluafunction: "+someluafunction.getClass()+" "+someluafunction ); - System.out.println( "someluafunction(345): "+((LuaValue) someluafunction).call(LuaValue.valueOf(345)) ); - } - - public static void testUserClasses(ScriptEngine e) throws ScriptException { - CompiledScript cs = ((Compilable)e).compile( - "test = test or luajava.newInstance(\"java.lang.String\", \"test\")\n" + - "print( 'test', type(test), test, tostring(test) )\n" + - "return tostring(test)"); - Bindings b = e.createBindings(); - Object resultstring = cs.eval(b); - b.put("test", new SomeUserClass()); - Object resultuserclass = cs.eval(b); - System.out.println( "eval(string): "+resultstring.getClass()+" "+resultstring ); - System.out.println( "eval(userclass): "+resultuserclass.getClass()+" "+resultuserclass ); - } - -} diff --git a/luaj-2.0.3/examples/jse/hyperbolic.java b/luaj-2.0.3/examples/jse/hyperbolic.java deleted file mode 100644 index bbce40f52..000000000 --- a/luaj-2.0.3/examples/jse/hyperbolic.java +++ /dev/null @@ -1,63 +0,0 @@ -import org.luaj.vm2.LuaValue; -import org.luaj.vm2.lib.OneArgFunction; - -/** - * Sample library that can be called via luaj's require() implementation. - * - * This library, when loaded, creates a lua package called "hyperbolic" - * which has two functions, "sinh()" and "cosh()". - * - * Because the class is in the default Java package, it can be called using - * lua code such as: - * -
 {@code 
- * require 'hyperbolic'
- * print('sinh',  hyperbolic.sinh)
- * print('sinh(1.0)',  hyperbolic.sinh(1.0))
- * }
- * - * When require() loads the code, two things happen: 1) the public constructor - * is called to construct a library instance, and 2) the instance is invoked - * as a java call with no arguments. This invocation should be used to initialize - * the library, and add any values to globals that are desired. - */ -public class hyperbolic extends OneArgFunction { - - /** Public constructor. To be loaded via require(), the library class - * must have a public constructor. - */ - public hyperbolic() {} - - /** The implementation of the ZeroArgFunction interface. - * This will be called once when the library is loaded via require(). - * @param arg LuaString containing the name used in the call to require(). - * @return Value that will be returned in the require() call. In this case, - * it is the library itself. - */ - public LuaValue call(LuaValue libname) { - LuaValue library = tableOf(); - library.set( "sinh", new sinh() ); - library.set( "cosh", new cosh() ); - env.set( "hyperbolic", library ); - return library; - } - - /* Each library function is coded as a specific LibFunction based on the - * arguments it expects and returns. By using OneArgFunction, rather than - * LibFunction directly, the number of arguments supplied will be coerced - * to match what the implementation expects. */ - - /** Mathematical sinh function provided as a OneArgFunction. */ - static class sinh extends OneArgFunction { - public LuaValue call(LuaValue x) { - return LuaValue.valueOf(Math.sinh(x.checkdouble())); - } - } - - /** Mathematical cosh function provided as a OneArgFunction. */ - static class cosh extends OneArgFunction { - public LuaValue call(LuaValue x) { - return LuaValue.valueOf(Math.cosh(x.checkdouble())); - } - } -} \ No newline at end of file diff --git a/luaj-2.0.3/examples/lua/hello.lua b/luaj-2.0.3/examples/lua/hello.lua deleted file mode 100644 index 5f66bcece..000000000 --- a/luaj-2.0.3/examples/lua/hello.lua +++ /dev/null @@ -1 +0,0 @@ -print( 'hello, world' ) \ No newline at end of file diff --git a/luaj-2.0.3/examples/lua/hyperbolicapp.lua b/luaj-2.0.3/examples/lua/hyperbolicapp.lua deleted file mode 100644 index ea10389af..000000000 --- a/luaj-2.0.3/examples/lua/hyperbolicapp.lua +++ /dev/null @@ -1,19 +0,0 @@ --- Sample luaj code to try loading and executing the 'hyperbolic' sample library --- --- The sample library source is in examples/jse/hyperbolic.java. --- For this sample to work, that source must be compiled, and the class must --- be on the class path. --- --- First load the library via require(). This will call the public constructor --- for the class named 'hyperbolic' if it exists, and then initialize the --- library by invoking LuaValue.call('hyperbolic') on that instance -require 'hyperbolic' - --- Test that the table is in the globals, and the functions exist. -print('hyperbolic', hyperbolic) -print('hyperbolic.sinh', hyperbolic.sinh) -print('hyperbolic.cosh', hyperbolic.cosh) - --- Try exercising the functions. -print('sinh(0.5)', hyperbolic.sinh(0.5)) -print('cosh(0.5)', hyperbolic.cosh(0.5)) diff --git a/luaj-2.0.3/examples/lua/logo.gif b/luaj-2.0.3/examples/lua/logo.gif deleted file mode 100644 index 193e69208..000000000 Binary files a/luaj-2.0.3/examples/lua/logo.gif and /dev/null differ diff --git a/luaj-2.0.3/examples/lua/swingapp.lua b/luaj-2.0.3/examples/lua/swingapp.lua deleted file mode 100644 index 2e1b6f0f0..000000000 --- a/luaj-2.0.3/examples/lua/swingapp.lua +++ /dev/null @@ -1,132 +0,0 @@ --- Sample luaj program that presents an animated Swing window. --- --- This basic application handles key, and mouse input, has a basic animation loop, --- and renders double-buffered graphics including the logo image in a swing frame. --- - --- bind to classes we need -local borderLayout = luajava.bindClass("java.awt.BorderLayout") -local jframe = luajava.bindClass("javax.swing.JFrame") -local bufferedImage = luajava.bindClass("java.awt.image.BufferedImage") -local swingUtilities = luajava.bindClass("javax.swing.SwingUtilities") -local thread = luajava.bindClass("java.lang.Thread") - --- set up frame, get content pane -local frame = luajava.newInstance("javax.swing.JFrame", "Sample Luaj Application"); -local content = frame:getContentPane() - --- add a buffered image as content -local image = luajava.newInstance("java.awt.image.BufferedImage", 640, 480, bufferedImage.TYPE_INT_RGB) -local icon = luajava.newInstance("javax.swing.ImageIcon", image) -local label = luajava.newInstance("javax.swing.JLabel", icon) - --- add the main pane to the main content -content:add(label, borderLayout.CENTER) -frame:setDefaultCloseOperation(jframe.EXIT_ON_CLOSE) -frame:pack() - --- simple animation framework -local tick,animate,render -local tnext = 0 -tick = luajava.createProxy("java.lang.Runnable", { - run = function() - swingUtilities:invokeLater(tick) - if os.time()< tnext then return thread:sleep(1) end - tnext = math.max(os.time(),tnext+1000/60) - pcall(animate) - pcall(render) - label:repaint(0,0,0,640,480) - end -}) - --- the animation step moves the line endpoints -local x1,y1,x2,y2,xi,yi = 160,240,480,240,0,0 -local vx1,vy1,vx2,vy2,vxi,vyi = -5,-6,7,8,3,1 -local advance = function(x,vx,max,rnd) - x = x + vx - if x < 0 then - return 0, math.random(2,10) - elseif x > max then - return max, math.random(-10,-2) - end - return x, vx -end -animate = function() - x1,y1,x2,y2 = x1+1,y1+1,x2-1,y2-1 - x1,vx1 = advance(x1,vx1,640) - y1,vy1 = advance(y1,vy1,480) - x2,vx2 = advance(x2,vx2,640) - y2,vy2 = advance(y2,vy2,480) - xi,vxi = advance(xi,vxi,540) - yi,vyi = advance(yi,vyi,380) -end - --- try loading the logo image from a couple locations -local imageio = luajava.bindClass("javax.imageio.ImageIO") -local file = luajava.bindClass("java.io.File") -local loadimage = function(path) - local s,i = pcall(imageio.read, imageio, luajava.new(file, path)) - return s and i -end -local logo = loadimage("logo.gif") or loadimage("examples/lua/logo.gif") - --- the render step draws the scene -local g = image:getGraphics() -local bg = luajava.newInstance("java.awt.Color", 0x22112244, true); -local fg = luajava.newInstance("java.awt.Color", 0xffaa33); -render = function() - g:setColor(bg) - g:fillRect(0,0,640,480) - if logo then g:drawImage(logo,xi,yi) end - g:setColor(fg) - g:drawLine(x1,y1,x2,y2) -end - --- add mouse listeners for specific mouse events -label:addMouseListener(luajava.createProxy("java.awt.event.MouseListener", { - mousePressed = function(e) - --print('mousePressed', e:getX(), e:getY(), e) - x1,y1 = e:getX(),e:getY() - end, - -- mouseClicked = function(e) end, - -- mouseEntered = function(e) end, - -- mouseExited = function(e) end, - -- mouseReleased = function(e) end, -})) -label:addMouseMotionListener(luajava.createProxy("java.awt.event.MouseMotionListener", { - mouseDragged = function(e) - --print('mouseDragged', e:getX(), e:getY(), e) - x2,y2 = e:getX(),e:getY() - end, - -- mouseMoved= function(e) end, -})) - --- add key listeners -frame:addKeyListener(luajava.createProxy("java.awt.event.KeyListener", { - keyPressed = function(e) - local id, code, char, text = e:getID(), e:getKeyCode(), e:getKeyChar(), e:getKeyText(e:getKeyCode()) - print('key id, code, char, text, pcall(string.char,char)', id, code, char, text, pcall(string.char,char)) - end, - -- keyReleased = function(e) end, - -- keyTyped = function(e) end, -})) - --- use the window listener to kick off animation -frame:addWindowListener(luajava.createProxy("java.awt.event.WindowListener", { - windowOpened = function(e) - swingUtilities:invokeLater(tick) - end, - -- windowActivated = function(e) end, - -- windowClosed = function(e) end, - -- windowClosing = function(e) end, - -- windowDeactivated = function(e) end, - -- windowDeiconified = function(e) end, - -- windowIconified = function(e) end, -})) - --- utility function to load an image from a file, for reference -local loadimage = function(filename) -end - --- Set window visible last to start app. -frame:setVisible(true) diff --git a/luaj-2.0.3/test/java/org/luaj/luajc/TestLuaJ.java b/luaj-2.0.3/test/java/org/luaj/luajc/TestLuaJ.java deleted file mode 100644 index 04edb2a90..000000000 --- a/luaj-2.0.3/test/java/org/luaj/luajc/TestLuaJ.java +++ /dev/null @@ -1,71 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 Luaj.org. All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - ******************************************************************************/ -package org.luaj.luajc; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; - -import org.luaj.vm2.LuaClosure; -import org.luaj.vm2.LuaTable; -import org.luaj.vm2.LuaValue; -import org.luaj.vm2.Print; -import org.luaj.vm2.Prototype; -import org.luaj.vm2.compiler.LuaC; -import org.luaj.vm2.lib.jse.JsePlatform; - -/** Test the plain old bytecode interpreter */ -public class TestLuaJ { - // create the script - public static String name = "script"; - public static String script = - "function r(q,...)\n"+ - " local a=arg\n"+ - " return a and a[2]\n"+ - "end\n" + - "function s(q,...)\n"+ - " local a=arg\n"+ - " local b=...\n"+ - " return a and a[2],b\n"+ - "end\n" + - "print( r(111,222,333),s(111,222,333) )"; - - public static void main(String[] args) throws Exception { - System.out.println(script); - - // create an environment to run in - LuaTable _G = JsePlatform.standardGlobals(); - - // compile into a chunk, or load as a class - InputStream is = new ByteArrayInputStream( script.getBytes() ); - LuaValue chunk = LuaC.instance.load(is, "script",_G); - chunk.call(); - } - - private static void print(Prototype p) { - System.out.println("--- "+p.is_vararg); - Print.printCode(p); - if (p.p!=null) - for ( int i=0,n=p.p.length; i0 && args[0].equals("nocompile")) ) { - InputStream is = new ByteArrayInputStream( script.getBytes() ); - chunk = LuaJC.getInstance().load(is, "script", _G); - } else { - chunk = (LuaValue) Class.forName("script").newInstance(); - } - chunk.setfenv(_G); - - // call with arguments - LuaValue[] vargs = new LuaValue[args.length]; - for ( int i=0; ic), (b>0)\n" ); - } - - public void testNumericForUpvalues() { - runFragment( LuaValue.valueOf(8), - "for i = 3,4 do\n"+ - " i = i + 5\n"+ - " local a = function()\n"+ - " return i\n"+ - " end\n" + - " return a()\n"+ - "end\n"); - } - - public void testNumericForUpvalues2() { - runFragment( LuaValue.valueOf("222 222"), - "local t = {}\n"+ - "local template = [[123 456]]\n"+ - "for i = 1,2 do\n"+ - " t[i] = template:gsub('%d', function(s)\n"+ - " return i\n"+ - " end)\n"+ - "end\n" + - "return t[2]\n"); - } - - public void testReturnUpvalue() { - runFragment( LuaValue.varargsOf(new LuaValue[] { LuaValue.ONE, LuaValue.valueOf(5), }), - "local a = 1\n"+ - "local b\n"+ - "function c()\n"+ - " b=5\n" + - " return a\n"+ - "end\n"+ - "return c(),b\n" ); - } - - public void testUninitializedAroundBranch() { - runFragment( LuaValue.valueOf(333), - "local state\n"+ - "if _G then\n"+ - " state = 333\n"+ - "end\n"+ - "return state\n" ); - } - - public void testLoadedNilUpvalue() { - runFragment( LuaValue.NIL, - "local a = print()\n"+ - "local b = c and { d = e }\n"+ - "local f\n"+ - "local function g()\n"+ - " return f\n"+ - "end\n" + - "return g()\n" ); - } - - public void testUpvalueInFirstSlot() { - runFragment( LuaValue.valueOf("foo"), - "local p = {'foo'}\n"+ - "bar = function()\n"+ - " return p \n"+ - "end\n"+ - "for i,key in ipairs(p) do\n"+ - " print()\n"+ - "end\n" + - "return bar()[1]"); - } - - public void testReadOnlyAndReadWriteUpvalues() { - runFragment( LuaValue.varargsOf( new LuaValue[] { LuaValue.valueOf(333), LuaValue.valueOf(222) } ), - "local a = 111\n" + - "local b = 222\n" + - "local c = function()\n"+ - " a = a + b\n" + - " return a,b\n"+ - "end\n" + - "return c()\n" ); - } - - public void testNestedUpvalues() { - runFragment( LuaValue.varargsOf( new LuaValue[] { LuaValue.valueOf(5), LuaValue.valueOf(8), LuaValue.valueOf(9) } ), - "local x = 3\n"+ - "local y = 5\n"+ - "local function f()\n"+ - " return y\n"+ - "end\n"+ - "local function g(x1, y1)\n"+ - " x = x1\n"+ - " y = y1\n" + - " return x,y\n"+ - "end\n"+ - "return f(), g(8,9)\n"+ - "\n" ); - } - - public void testLoadBool() { - runFragment( LuaValue.NONE, - "print( type(foo)=='string' )\n"+ - "local a,b\n"+ - "if print() then\n"+ - " b = function()\n"+ - " return a\n"+ - " end\n"+ - "end\n" ); - } - - public void testBasicForLoop() { - runFragment( LuaValue.valueOf(2), - "local data\n"+ - "for i = 1, 2 do\n"+ - " data = i\n"+ - "end\n"+ - "local bar = function()\n"+ - " return data\n"+ - "end\n" + - "return bar()\n" ); - } - - public void testGenericForMultipleValues() { - runFragment( LuaValue.varargsOf(LuaValue.valueOf(3),LuaValue.valueOf(2),LuaValue.valueOf(1)), - "local iter = function() return 1,2,3,4 end\n" + - "local foo = function() return iter,5 end\n" + - "for a,b,c in foo() do\n" + - " return c,b,a\n" + - "end\n" ); - } - - public void testPhiUpvalue() { - runFragment( LuaValue.valueOf(6), - "local a = foo or 0\n"+ - "local function b(c)\n"+ - " if c > a then a = c end\n" + - " return a\n"+ - "end\n" + - "b(6)\n" + - "return a\n" ); - } - - public void testAssignReferUpvalues() { - runFragment( LuaValue.valueOf(123), - "local entity = 234\n" + - "local function c()\n" + - " return entity\n" + - "end\n" + - "entity = (a == b) and 123\n" + - "if entity then\n" + - " return entity\n" + - "end\n" ); - } - - public void testSimpleRepeatUntil() { - runFragment( LuaValue.valueOf(5), - "local a\n"+ - "local w\n"+ - "repeat\n"+ - " a = w\n"+ - "until not a\n" + - "return 5\n" ); - } - - public void testLoopVarUpvalues() { - runFragment( LuaValue.valueOf("b"), - "local env = {}\n" + - "for a,b in pairs(_G) do\n" + - " c = function()\n" + - " return b\n" + - " end\n" + - "end\n" + - "local e = env\n" + - "local f = {a='b'}\n" + - "for k,v in pairs(f) do\n" + - " return env[k] or v\n" + - "end\n"); - } - - public void testPhiVarUpvalue() { - runFragment( LuaValue.valueOf(2), - "local a = 1\n"+ - "local function b()\n"+ - " a = a + 1\n"+ - " return function() end\n"+ - "end\n"+ - "for i in b() do\n"+ - " a = 3\n"+ - "end\n" + - "return a\n"); - } - - public void testUpvaluesInElseClauses() { - runFragment( LuaValue.valueOf(111), - "if a then\n" + - " foo(bar)\n" + - "elseif _G then\n" + - " local x = 111\n" + - " if d then\n" + - " foo(bar)\n" + - " else\n" + - " local y = function()\n" + - " return x\n" + - " end\n" + - " return y()\n" + - " end\n" + - "end\n"); - } - } -} diff --git a/luaj-2.0.3/test/junit/org/luaj/vm2/LuaOperationsTest.java b/luaj-2.0.3/test/junit/org/luaj/vm2/LuaOperationsTest.java deleted file mode 100644 index 7945fdc38..000000000 --- a/luaj-2.0.3/test/junit/org/luaj/vm2/LuaOperationsTest.java +++ /dev/null @@ -1,261 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 Luaj.org. All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - ******************************************************************************/ -package org.luaj.vm2; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.lang.reflect.InvocationTargetException; - -import junit.framework.TestCase; - -import org.luaj.vm2.TypeTest.MyData; -import org.luaj.vm2.compiler.LuaC; -import org.luaj.vm2.lib.ZeroArgFunction; - -public class LuaOperationsTest extends TestCase { - - private final int sampleint = 77; - private final long samplelong = 123400000000L; - private final double sampledouble = 55.25; - private final String samplestringstring = "abcdef"; - private final String samplestringint = String.valueOf(sampleint); - private final String samplestringlong = String.valueOf(samplelong); - private final String samplestringdouble = String.valueOf(sampledouble); - private final Object sampleobject = new Object(); - private final MyData sampledata = new MyData(); - - private final LuaValue somenil = LuaValue.NIL; - private final LuaValue sometrue = LuaValue.TRUE; - private final LuaValue somefalse = LuaValue.FALSE; - private final LuaValue zero = LuaValue.ZERO; - private final LuaValue intint = LuaValue.valueOf(sampleint); - private final LuaValue longdouble = LuaValue.valueOf(samplelong); - private final LuaValue doubledouble = LuaValue.valueOf(sampledouble); - private final LuaValue stringstring = LuaValue.valueOf(samplestringstring); - private final LuaValue stringint = LuaValue.valueOf(samplestringint); - private final LuaValue stringlong = LuaValue.valueOf(samplestringlong); - private final LuaValue stringdouble = LuaValue.valueOf(samplestringdouble); - private final LuaTable table = LuaValue.listOf( new LuaValue[] { LuaValue.valueOf("aaa"), LuaValue.valueOf("bbb") } ); - private final LuaValue somefunc = new ZeroArgFunction(table) { public LuaValue call() { return NONE;}}; - private final LuaThread thread = new LuaThread(somefunc,table); - private final Prototype proto = new Prototype(); - private final LuaClosure someclosure = new LuaClosure(proto,table); - private final LuaUserdata userdataobj = LuaValue.userdataOf(sampleobject); - private final LuaUserdata userdatacls = LuaValue.userdataOf(sampledata); - - private void throwsLuaError(String methodName, Object obj) { - try { - LuaValue.class.getMethod(methodName).invoke(obj); - fail("failed to throw LuaError as required"); - } catch (InvocationTargetException e) { - if ( ! (e.getTargetException() instanceof LuaError) ) - fail("not a LuaError: "+e.getTargetException()); - return; // pass - } catch ( Exception e ) { - fail( "bad exception: "+e ); - } - } - - private void throwsLuaError(String methodName, Object obj, Object arg) { - try { - LuaValue.class.getMethod(methodName,LuaValue.class).invoke(obj,arg); - fail("failed to throw LuaError as required"); - } catch (InvocationTargetException e) { - if ( ! (e.getTargetException() instanceof LuaError) ) - fail("not a LuaError: "+e.getTargetException()); - return; // pass - } catch ( Exception e ) { - fail( "bad exception: "+e ); - } - } - - public void testLen() { - throwsLuaError( "len", somenil ); - throwsLuaError( "len", sometrue ); - throwsLuaError( "len", somefalse ); - throwsLuaError( "len", zero ); - throwsLuaError( "len", intint ); - throwsLuaError( "len", longdouble ); - throwsLuaError( "len", doubledouble ); - assertEquals( LuaInteger.valueOf(samplestringstring.length()), stringstring.len() ); - assertEquals( LuaInteger.valueOf(samplestringint.length()), stringint.len() ); - assertEquals( LuaInteger.valueOf(samplestringlong.length()), stringlong.len() ); - assertEquals( LuaInteger.valueOf(samplestringdouble.length()), stringdouble.len() ); - assertEquals( LuaInteger.valueOf(2), table.len() ); - throwsLuaError( "len", somefunc ); - throwsLuaError( "len", thread ); - throwsLuaError( "len", someclosure ); - throwsLuaError( "len", userdataobj ); - throwsLuaError( "len", userdatacls ); - } - - public void testLength() { - throwsLuaError( "length", somenil ); - throwsLuaError( "length", sometrue ); - throwsLuaError( "length", somefalse ); - throwsLuaError( "length", zero ); - throwsLuaError( "length", intint ); - throwsLuaError( "length", longdouble ); - throwsLuaError( "length", doubledouble ); - assertEquals( samplestringstring.length(), stringstring.length() ); - assertEquals( samplestringint.length(), stringint.length() ); - assertEquals( samplestringlong.length(), stringlong.length() ); - assertEquals( samplestringdouble.length(), stringdouble.length() ); - assertEquals( 2, table.length() ); - throwsLuaError( "length", somefunc ); - throwsLuaError( "length", thread ); - throwsLuaError( "length", someclosure ); - throwsLuaError( "length", userdataobj ); - throwsLuaError( "length", userdatacls ); - } - - public void testGetfenv() { - throwsLuaError( "getfenv", somenil ); - throwsLuaError( "getfenv", sometrue ); - throwsLuaError( "getfenv", somefalse ); - throwsLuaError( "getfenv", zero ); - throwsLuaError( "getfenv", intint ); - throwsLuaError( "getfenv", longdouble ); - throwsLuaError( "getfenv", doubledouble ); - throwsLuaError( "getfenv", stringstring ); - throwsLuaError( "getfenv", stringint ); - throwsLuaError( "getfenv", stringlong ); - throwsLuaError( "getfenv", stringdouble ); - throwsLuaError( "getfenv", table ); - assertTrue( table == thread.getfenv() ); - assertTrue( table == someclosure.getfenv() ); - assertTrue( table == somefunc.getfenv() ); - throwsLuaError( "getfenv", userdataobj ); - throwsLuaError( "getfenv", userdatacls ); - } - - public void testSetfenv() { - LuaTable table2 = LuaValue.listOf( new LuaValue[] { - LuaValue.valueOf("ccc"), - LuaValue.valueOf("ddd") } ); - throwsLuaError( "setfenv", somenil, table2 ); - throwsLuaError( "setfenv", sometrue, table2 ); - throwsLuaError( "setfenv", somefalse, table2 ); - throwsLuaError( "setfenv", zero, table2 ); - throwsLuaError( "setfenv", intint, table2 ); - throwsLuaError( "setfenv", longdouble, table2 ); - throwsLuaError( "setfenv", doubledouble, table2 ); - throwsLuaError( "setfenv", stringstring, table2 ); - throwsLuaError( "setfenv", stringint, table2 ); - throwsLuaError( "setfenv", stringlong, table2 ); - throwsLuaError( "setfenv", stringdouble, table2 ); - throwsLuaError( "setfenv", table, table2 ); - thread.setfenv(table2); - assertTrue( table2 == thread.getfenv() ); - assertTrue( table == someclosure.getfenv() ); - assertTrue( table == somefunc.getfenv() ); - someclosure.setfenv(table2); - assertTrue( table2 == someclosure.getfenv() ); - assertTrue( table == somefunc.getfenv() ); - somefunc.setfenv(table2); - assertTrue( table2 == somefunc.getfenv() ); - throwsLuaError( "setfenv", userdataobj, table2 ); - throwsLuaError( "setfenv", userdatacls, table2 ); - } - - public Prototype createPrototype( String script, String name ) { - try { - LuaTable _G = org.luaj.vm2.lib.jse.JsePlatform.standardGlobals(); - InputStream is = new ByteArrayInputStream(script.getBytes("UTF-8")); - return LuaC.instance.compile(is, name); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - fail(e.toString()); - return null; - } - } - - public void testFunctionClosureThreadEnv() { - - // set up suitable environments for execution - LuaValue aaa = LuaValue.valueOf("aaa"); - LuaValue eee = LuaValue.valueOf("eee"); - LuaTable _G = org.luaj.vm2.lib.jse.JsePlatform.standardGlobals(); - LuaTable newenv = LuaValue.tableOf( new LuaValue[] { - LuaValue.valueOf("a"), LuaValue.valueOf("aaa"), - LuaValue.valueOf("b"), LuaValue.valueOf("bbb"), } ); - LuaTable mt = LuaValue.tableOf( new LuaValue[] { LuaValue.INDEX, _G } ); - newenv.setmetatable(mt); - _G.set("a", aaa); - newenv.set("a", eee); - - // function tests - { - LuaFunction f = new ZeroArgFunction(_G) { public LuaValue call() { return env.get("a");}}; - assertEquals( aaa, f.call() ); - f.setfenv(newenv); - assertEquals( newenv, f.getfenv() ); - assertEquals( eee, f.call() ); - } - - // closure tests - { - Prototype p = createPrototype( "return a\n", "closuretester" ); - LuaClosure c = new LuaClosure(p, _G); - assertEquals( aaa, c.call() ); - c.setfenv(newenv); - assertEquals( newenv, c.getfenv() ); - assertEquals( eee, c.call() ); - } - - // thread tests, functions created in threads inherit the thread's environment initially - // those closures created not in any other function get the thread's enviroment - Prototype p2 = createPrototype( "return loadstring('return a')", "threadtester" ); - { - LuaThread t = new LuaThread(new LuaClosure(p2,_G), _G); - Varargs v = t.resume(LuaValue.NONE); - assertEquals(LuaValue.TRUE, v.arg(1) ); - LuaValue f = v.arg(2); - assertEquals( LuaValue.TFUNCTION, f.type() ); - assertEquals( aaa, f.call() ); - assertEquals( _G, f.getfenv() ); - } - { - // change the thread environment after creation! - LuaThread t = new LuaThread(new LuaClosure(p2,_G), _G); - t.setfenv(newenv); - Varargs v = t.resume(LuaValue.NONE); - assertEquals(LuaValue.TRUE, v.arg(1) ); - LuaValue f = v.arg(2); - assertEquals( LuaValue.TFUNCTION, f.type() ); - assertEquals( eee, f.call() ); - assertEquals( newenv, f.getfenv() ); - } - { - // let the closure have a different environment from the thread - Prototype p3 = createPrototype( "return function() return a end", "envtester" ); - LuaThread t = new LuaThread(new LuaClosure(p3,newenv), _G); - Varargs v = t.resume(LuaValue.NONE); - assertEquals(LuaValue.TRUE, v.arg(1) ); - LuaValue f = v.arg(2); - assertEquals( LuaValue.TFUNCTION, f.type() ); - assertEquals( eee, f.call() ); - assertEquals( newenv, f.getfenv() ); - } - } -} diff --git a/luaj-2.0.3/test/junit/org/luaj/vm2/MathLibTest.java b/luaj-2.0.3/test/junit/org/luaj/vm2/MathLibTest.java deleted file mode 100644 index 47e342380..000000000 --- a/luaj-2.0.3/test/junit/org/luaj/vm2/MathLibTest.java +++ /dev/null @@ -1,251 +0,0 @@ -package org.luaj.vm2; - -import junit.framework.TestCase; - -import org.luaj.vm2.lib.MathLib; -import org.luaj.vm2.lib.jse.JseMathLib; -import org.luaj.vm2.lib.jse.JsePlatform; - -public class MathLibTest extends TestCase { - - private LuaValue j2se; - private LuaValue j2me; - private boolean supportedOnJ2me; - - public MathLibTest() { - LuaValue g = JsePlatform.standardGlobals(); - j2se = g.get("math"); - g.load( new MathLib() ); - j2me = g.get("math"); - } - - protected void setUp() throws Exception { - supportedOnJ2me = true; - } - - public void testMathDPow() { - assertEquals( 1, j2mepow(2, 0), 0 ); - assertEquals( 2, j2mepow(2, 1), 0 ); - assertEquals( 8, j2mepow(2, 3), 0 ); - assertEquals( -8, j2mepow(-2, 3), 0 ); - assertEquals( 1/8., j2mepow(2, -3), 0 ); - assertEquals( -1/8., j2mepow(-2, -3), 0 ); - assertEquals( 16, j2mepow(256, .5), 0 ); - assertEquals( 4, j2mepow(256, .25), 0 ); - assertEquals( 64, j2mepow(256, .75), 0 ); - assertEquals( 1./16, j2mepow(256, - .5), 0 ); - assertEquals( 1./ 4, j2mepow(256, -.25), 0 ); - assertEquals( 1./64, j2mepow(256, -.75), 0 ); - assertEquals( Double.NaN, j2mepow(-256, .5), 0 ); - assertEquals( 1, j2mepow(.5, 0), 0 ); - assertEquals( .5, j2mepow(.5, 1), 0 ); - assertEquals(.125, j2mepow(.5, 3), 0 ); - assertEquals( 2, j2mepow(.5, -1), 0 ); - assertEquals( 8, j2mepow(.5, -3), 0 ); - assertEquals(1, j2mepow(0.0625, 0), 0 ); - assertEquals(0.00048828125, j2mepow(0.0625, 2.75), 0 ); - } - - private double j2mepow(double x, double y) { - return j2me.get("pow").call(LuaValue.valueOf(x),LuaValue.valueOf(y)).todouble(); - } - - public void testAbs() { - tryMathOp( "abs", 23.45 ); - tryMathOp( "abs", -23.45 ); - } - - public void testCos() { - tryTrigOps( "cos" ); - } - - public void testCosh() { - supportedOnJ2me = false; - tryTrigOps( "cosh" ); - } - - public void testDeg() { - tryTrigOps( "deg" ); - } - - public void testExp() { - //supportedOnJ2me = false; - tryMathOp( "exp", 0 ); - tryMathOp( "exp", 0.1 ); - tryMathOp( "exp", .9 ); - tryMathOp( "exp", 1. ); - tryMathOp( "exp", 9 ); - tryMathOp( "exp", -.1 ); - tryMathOp( "exp", -.9 ); - tryMathOp( "exp", -1. ); - tryMathOp( "exp", -9 ); - } - - public void testLog() { - supportedOnJ2me = false; - tryMathOp( "log", 0.1 ); - tryMathOp( "log", .9 ); - tryMathOp( "log", 1. ); - tryMathOp( "log", 9 ); - tryMathOp( "log", -.1 ); - tryMathOp( "log", -.9 ); - tryMathOp( "log", -1. ); - tryMathOp( "log", -9 ); - } - - public void testLog10() { - supportedOnJ2me = false; - tryMathOp( "log10", 0.1 ); - tryMathOp( "log10", .9 ); - tryMathOp( "log10", 1. ); - tryMathOp( "log10", 9 ); - tryMathOp( "log10", 10 ); - tryMathOp( "log10", 100 ); - tryMathOp( "log10", -.1 ); - tryMathOp( "log10", -.9 ); - tryMathOp( "log10", -1. ); - tryMathOp( "log10", -9 ); - tryMathOp( "log10", -10 ); - tryMathOp( "log10", -100 ); - } - - public void testRad() { - tryMathOp( "rad", 0 ); - tryMathOp( "rad", 0.1 ); - tryMathOp( "rad", .9 ); - tryMathOp( "rad", 1. ); - tryMathOp( "rad", 9 ); - tryMathOp( "rad", 10 ); - tryMathOp( "rad", 100 ); - tryMathOp( "rad", -.1 ); - tryMathOp( "rad", -.9 ); - tryMathOp( "rad", -1. ); - tryMathOp( "rad", -9 ); - tryMathOp( "rad", -10 ); - tryMathOp( "rad", -100 ); - } - - public void testSin() { - tryTrigOps( "sin" ); - } - - public void testSinh() { - supportedOnJ2me = false; - tryTrigOps( "sinh" ); - } - - public void testSqrt() { - tryMathOp( "sqrt", 0 ); - tryMathOp( "sqrt", 0.1 ); - tryMathOp( "sqrt", .9 ); - tryMathOp( "sqrt", 1. ); - tryMathOp( "sqrt", 9 ); - tryMathOp( "sqrt", 10 ); - tryMathOp( "sqrt", 100 ); - } - public void testTan() { - tryTrigOps( "tan" ); - } - - public void testTanh() { - supportedOnJ2me = false; - tryTrigOps( "tanh" ); - } - - public void testAtan2() { - supportedOnJ2me = false; - tryDoubleOps( "atan2", false ); - } - - public void testFmod() { - tryDoubleOps( "fmod", false ); - } - - public void testPow() { - tryDoubleOps( "pow", true ); - } - - private void tryDoubleOps( String op, boolean positiveOnly ) { - // y>0, x>0 - tryMathOp( op, 0.1, 4.0 ); - tryMathOp( op, .9, 4.0 ); - tryMathOp( op, 1., 4.0 ); - tryMathOp( op, 9, 4.0 ); - tryMathOp( op, 10, 4.0 ); - tryMathOp( op, 100, 4.0 ); - - // y>0, x<0 - tryMathOp( op, 0.1, -4.0 ); - tryMathOp( op, .9, -4.0 ); - tryMathOp( op, 1., -4.0 ); - tryMathOp( op, 9, -4.0 ); - tryMathOp( op, 10, -4.0 ); - tryMathOp( op, 100, -4.0 ); - - if ( ! positiveOnly ) { - // y<0, x>0 - tryMathOp( op, -0.1, 4.0 ); - tryMathOp( op, -.9, 4.0 ); - tryMathOp( op, -1., 4.0 ); - tryMathOp( op, -9, 4.0 ); - tryMathOp( op, -10, 4.0 ); - tryMathOp( op, -100, 4.0 ); - - // y<0, x<0 - tryMathOp( op, -0.1, -4.0 ); - tryMathOp( op, -.9, -4.0 ); - tryMathOp( op, -1., -4.0 ); - tryMathOp( op, -9, -4.0 ); - tryMathOp( op, -10, -4.0 ); - tryMathOp( op, -100, -4.0 ); - } - - // degenerate cases - tryMathOp( op, 0, 1 ); - tryMathOp( op, 1, 0 ); - tryMathOp( op, -1, 0 ); - tryMathOp( op, 0, -1 ); - tryMathOp( op, 0, 0 ); - } - - private void tryTrigOps(String op) { - tryMathOp( op, 0 ); - tryMathOp( op, Math.PI/8 ); - tryMathOp( op, Math.PI*7/8 ); - tryMathOp( op, Math.PI*8/8 ); - tryMathOp( op, Math.PI*9/8 ); - tryMathOp( op, -Math.PI/8 ); - tryMathOp( op, -Math.PI*7/8 ); - tryMathOp( op, -Math.PI*8/8 ); - tryMathOp( op, -Math.PI*9/8 ); - } - - private void tryMathOp(String op, double x) { - try { - double expected = j2se.get(op).call( LuaValue.valueOf(x)).todouble(); - double actual = j2me.get(op).call( LuaValue.valueOf(x)).todouble(); - if ( supportedOnJ2me ) - assertEquals( expected, actual, 1.e-4 ); - else - fail("j2me should throw exception for math."+op+" but returned "+actual); - } catch ( LuaError lee ) { - if ( supportedOnJ2me ) - throw lee; - } - } - - - private void tryMathOp(String op, double a, double b) { - try { - double expected = j2se.get(op).call( LuaValue.valueOf(a), LuaValue.valueOf(b)).todouble(); - double actual = j2me.get(op).call( LuaValue.valueOf(a), LuaValue.valueOf(b)).todouble(); - if ( supportedOnJ2me ) - assertEquals( expected, actual, 1.e-5 ); - else - fail("j2me should throw exception for math."+op+" but returned "+actual); - } catch ( LuaError lee ) { - if ( supportedOnJ2me ) - throw lee; - } - } -} diff --git a/luaj-2.0.3/test/junit/org/luaj/vm2/MetatableTest.java b/luaj-2.0.3/test/junit/org/luaj/vm2/MetatableTest.java deleted file mode 100644 index 42526011e..000000000 --- a/luaj-2.0.3/test/junit/org/luaj/vm2/MetatableTest.java +++ /dev/null @@ -1,366 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 Luaj.org. All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - ******************************************************************************/ -package org.luaj.vm2; - -import junit.framework.TestCase; - -import org.luaj.vm2.TypeTest.MyData; -import org.luaj.vm2.lib.StringLib; -import org.luaj.vm2.lib.ThreeArgFunction; -import org.luaj.vm2.lib.TwoArgFunction; -import org.luaj.vm2.lib.ZeroArgFunction; - -public class MetatableTest extends TestCase { - - private final String samplestring = "abcdef"; - private final Object sampleobject = new Object(); - private final MyData sampledata = new MyData(); - - private final LuaValue string = LuaValue.valueOf(samplestring); - private final LuaTable table = LuaValue.tableOf(); - private final LuaFunction function = new ZeroArgFunction() { public LuaValue call() { return NONE;}}; - private final LuaThread thread = new LuaThread(function,table); - private final LuaClosure closure = new LuaClosure(); - private final LuaUserdata userdata = LuaValue.userdataOf(sampleobject); - private final LuaUserdata userdatamt = LuaValue.userdataOf(sampledata,table); - - protected void setUp() throws Exception { - // needed for metatable ops to work on strings - new StringLib(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - LuaBoolean.s_metatable = null; - LuaFunction.s_metatable = null; - LuaNil.s_metatable = null; - LuaNumber.s_metatable = null; -// LuaString.s_metatable = null; - LuaThread.s_metatable = null; - } - - public void testGetMetatable() { - assertEquals( null, LuaValue.NIL.getmetatable() ); - assertEquals( null, LuaValue.TRUE.getmetatable() ); - assertEquals( null, LuaValue.ONE.getmetatable() ); -// assertEquals( null, string.getmetatable() ); - assertEquals( null, table.getmetatable() ); - assertEquals( null, function.getmetatable() ); - assertEquals( null, thread.getmetatable() ); - assertEquals( null, closure.getmetatable() ); - assertEquals( null, userdata.getmetatable() ); - assertEquals( table, userdatamt.getmetatable() ); - } - - public void testSetMetatable() { - LuaValue mt = LuaValue.tableOf(); - assertEquals( null, table.getmetatable() ); - assertEquals( null, userdata.getmetatable() ); - assertEquals( table, userdatamt.getmetatable() ); - assertEquals( table, table.setmetatable(mt) ); - assertEquals( userdata, userdata.setmetatable(mt) ); - assertEquals( userdatamt, userdatamt.setmetatable(mt) ); - assertEquals( mt, table.getmetatable() ); - assertEquals( mt, userdata.getmetatable() ); - assertEquals( mt, userdatamt.getmetatable() ); - - // these all get metatable behind-the-scenes - assertEquals( null, LuaValue.NIL.getmetatable() ); - assertEquals( null, LuaValue.TRUE.getmetatable() ); - assertEquals( null, LuaValue.ONE.getmetatable() ); -// assertEquals( null, string.getmetatable() ); - assertEquals( null, function.getmetatable() ); - assertEquals( null, thread.getmetatable() ); - assertEquals( null, closure.getmetatable() ); - LuaNil.s_metatable = mt; - assertEquals( mt, LuaValue.NIL.getmetatable() ); - assertEquals( null, LuaValue.TRUE.getmetatable() ); - assertEquals( null, LuaValue.ONE.getmetatable() ); -// assertEquals( null, string.getmetatable() ); - assertEquals( null, function.getmetatable() ); - assertEquals( null, thread.getmetatable() ); - assertEquals( null, closure.getmetatable() ); - LuaBoolean.s_metatable = mt; - assertEquals( mt, LuaValue.TRUE.getmetatable() ); - assertEquals( null, LuaValue.ONE.getmetatable() ); -// assertEquals( null, string.getmetatable() ); - assertEquals( null, function.getmetatable() ); - assertEquals( null, thread.getmetatable() ); - assertEquals( null, closure.getmetatable() ); - LuaNumber.s_metatable = mt; - assertEquals( mt, LuaValue.ONE.getmetatable() ); - assertEquals( mt, LuaValue.valueOf(1.25).getmetatable() ); -// assertEquals( null, string.getmetatable() ); - assertEquals( null, function.getmetatable() ); - assertEquals( null, thread.getmetatable() ); - assertEquals( null, closure.getmetatable() ); -// LuaString.s_metatable = mt; -// assertEquals( mt, string.getmetatable() ); - assertEquals( null, function.getmetatable() ); - assertEquals( null, thread.getmetatable() ); - assertEquals( null, closure.getmetatable() ); - LuaFunction.s_metatable = mt; - assertEquals( mt, function.getmetatable() ); - assertEquals( null, thread.getmetatable() ); - LuaThread.s_metatable = mt; - assertEquals( mt, thread.getmetatable() ); - } - - public void testMetatableIndex() { - assertEquals( table, table.setmetatable(null) ); - assertEquals( userdata, userdata.setmetatable(null) ); - assertEquals( userdatamt, userdatamt.setmetatable(null) ); - assertEquals( LuaValue.NIL, table.get(1) ); - assertEquals( LuaValue.NIL, userdata.get(1) ); - assertEquals( LuaValue.NIL, userdatamt.get(1) ); - - // empty metatable - LuaValue mt = LuaValue.tableOf(); - assertEquals( table, table.setmetatable(mt) ); - assertEquals( userdata, userdata.setmetatable(mt) ); - LuaBoolean.s_metatable = mt; - LuaFunction.s_metatable = mt; - LuaNil.s_metatable = mt; - LuaNumber.s_metatable = mt; -// LuaString.s_metatable = mt; - LuaThread.s_metatable = mt; - assertEquals( mt, table.getmetatable() ); - assertEquals( mt, userdata.getmetatable() ); - assertEquals( mt, LuaValue.NIL.getmetatable() ); - assertEquals( mt, LuaValue.TRUE.getmetatable() ); - assertEquals( mt, LuaValue.ONE.getmetatable() ); -// assertEquals( StringLib.instance, string.getmetatable() ); - assertEquals( mt, function.getmetatable() ); - assertEquals( mt, thread.getmetatable() ); - - // plain metatable - LuaValue abc = LuaValue.valueOf("abc"); - mt.set( LuaValue.INDEX, LuaValue.listOf(new LuaValue[] { abc } ) ); - assertEquals( abc, table.get(1) ); - assertEquals( abc, userdata.get(1) ); - assertEquals( abc, LuaValue.NIL.get(1) ); - assertEquals( abc, LuaValue.TRUE.get(1) ); - assertEquals( abc, LuaValue.ONE.get(1) ); -// assertEquals( abc, string.get(1) ); - assertEquals( abc, function.get(1) ); - assertEquals( abc, thread.get(1) ); - - // plain metatable - mt.set( LuaValue.INDEX, new TwoArgFunction() { - public LuaValue call(LuaValue arg1, LuaValue arg2) { - return LuaValue.valueOf( arg1.typename()+"["+arg2.tojstring()+"]=xyz" ); - } - - }); - assertEquals( "table[1]=xyz", table.get(1).tojstring() ); - assertEquals( "userdata[1]=xyz", userdata.get(1).tojstring() ); - assertEquals( "nil[1]=xyz", LuaValue.NIL.get(1).tojstring() ); - assertEquals( "boolean[1]=xyz", LuaValue.TRUE.get(1).tojstring() ); - assertEquals( "number[1]=xyz", LuaValue.ONE.get(1).tojstring() ); - // assertEquals( "string[1]=xyz", string.get(1).tojstring() ); - assertEquals( "function[1]=xyz", function.get(1).tojstring() ); - assertEquals( "thread[1]=xyz", thread.get(1).tojstring() ); - } - - - public void testMetatableNewIndex() { - // empty metatable - LuaValue mt = LuaValue.tableOf(); - assertEquals( table, table.setmetatable(mt) ); - assertEquals( userdata, userdata.setmetatable(mt) ); - LuaBoolean.s_metatable = mt; - LuaFunction.s_metatable = mt; - LuaNil.s_metatable = mt; - LuaNumber.s_metatable = mt; -// LuaString.s_metatable = mt; - LuaThread.s_metatable = mt; - - // plain metatable - final LuaValue fallback = LuaValue.tableOf(); - LuaValue abc = LuaValue.valueOf("abc"); - mt.set( LuaValue.NEWINDEX, fallback ); - table.set(2,abc); - userdata.set(3,abc); - LuaValue.NIL.set(4,abc); - LuaValue.TRUE.set(5,abc); - LuaValue.ONE.set(6,abc); -// string.set(7,abc); - function.set(8,abc); - thread.set(9,abc); - assertEquals( abc, fallback.get(2) ); - assertEquals( abc, fallback.get(3) ); - assertEquals( abc, fallback.get(4) ); - assertEquals( abc, fallback.get(5) ); - assertEquals( abc, fallback.get(6) ); -// assertEquals( abc, StringLib.instance.get(7) ); - assertEquals( abc, fallback.get(8) ); - assertEquals( abc, fallback.get(9) ); - - // metatable with function call - mt.set( LuaValue.NEWINDEX, new ThreeArgFunction() { - public LuaValue call(LuaValue arg1, LuaValue arg2, LuaValue arg3) { - fallback.rawset(arg2, LuaValue.valueOf( "via-func-"+arg3 )); - return NONE; - } - - }); - table.set(12,abc); - userdata.set(13,abc); - LuaValue.NIL.set(14,abc); - LuaValue.TRUE.set(15,abc); - LuaValue.ONE.set(16,abc); -// string.set(17,abc); - function.set(18,abc); - thread.set(19,abc); - LuaValue via = LuaValue.valueOf( "via-func-abc" ); - assertEquals( via, fallback.get(12) ); - assertEquals( via, fallback.get(13) ); - assertEquals( via, fallback.get(14) ); - assertEquals( via, fallback.get(15) ); - assertEquals( via, fallback.get(16) ); -// assertEquals( via, StringLib.instance.get(17) ); - assertEquals( via, fallback.get(18) ); - assertEquals( via, fallback.get(19) ); - } - - - private void checkTable( LuaValue t, - LuaValue aa, LuaValue bb, LuaValue cc, LuaValue dd, LuaValue ee, LuaValue ff, LuaValue gg, - LuaValue ra, LuaValue rb, LuaValue rc, LuaValue rd, LuaValue re, LuaValue rf, LuaValue rg ) { - assertEquals( aa, t.get("aa") ); - assertEquals( bb, t.get("bb") ); - assertEquals( cc, t.get("cc") ); - assertEquals( dd, t.get("dd") ); - assertEquals( ee, t.get("ee") ); - assertEquals( ff, t.get("ff") ); - assertEquals( gg, t.get("gg") ); - assertEquals( ra, t.rawget("aa") ); - assertEquals( rb, t.rawget("bb") ); - assertEquals( rc, t.rawget("cc") ); - assertEquals( rd, t.rawget("dd") ); - assertEquals( re, t.rawget("ee") ); - assertEquals( rf, t.rawget("ff") ); - assertEquals( rg, t.rawget("gg") ); - } - - private LuaValue makeTable( String key1, String val1, String key2, String val2 ) { - return LuaValue.tableOf( new LuaValue[] { - LuaValue.valueOf(key1), LuaValue.valueOf(val1), - LuaValue.valueOf(key2), LuaValue.valueOf(val2), - } ); - } - - public void testRawsetMetatableSet() { - // set up tables - LuaValue m = makeTable( "aa", "aaa", "bb", "bbb" ); - m.set(LuaValue.INDEX, m); - m.set(LuaValue.NEWINDEX, m); - LuaValue s = makeTable( "cc", "ccc", "dd", "ddd" ); - LuaValue t = makeTable( "cc", "ccc", "dd", "ddd" ); - t.setmetatable(m); - LuaValue aaa = LuaValue.valueOf("aaa"); - LuaValue bbb = LuaValue.valueOf("bbb"); - LuaValue ccc = LuaValue.valueOf("ccc"); - LuaValue ddd = LuaValue.valueOf("ddd"); - LuaValue ppp = LuaValue.valueOf("ppp"); - LuaValue qqq = LuaValue.valueOf("qqq"); - LuaValue rrr = LuaValue.valueOf("rrr"); - LuaValue sss = LuaValue.valueOf("sss"); - LuaValue ttt = LuaValue.valueOf("ttt"); - LuaValue www = LuaValue.valueOf("www"); - LuaValue xxx = LuaValue.valueOf("xxx"); - LuaValue yyy = LuaValue.valueOf("yyy"); - LuaValue zzz = LuaValue.valueOf("zzz"); - LuaValue nil = LuaValue.NIL; - - // check initial values - // values via "bet()" values via "rawget()" - checkTable( s, nil,nil,ccc,ddd,nil,nil,nil, nil,nil,ccc,ddd,nil,nil,nil ); - checkTable( t, aaa,bbb,ccc,ddd,nil,nil,nil, nil,nil,ccc,ddd,nil,nil,nil ); - checkTable( m, aaa,bbb,nil,nil,nil,nil,nil, aaa,bbb,nil,nil,nil,nil,nil ); - - // rawset() - s.rawset("aa", www); - checkTable( s, www,nil,ccc,ddd,nil,nil,nil, www,nil,ccc,ddd,nil,nil,nil ); - checkTable( t, aaa,bbb,ccc,ddd,nil,nil,nil, nil,nil,ccc,ddd,nil,nil,nil ); - checkTable( m, aaa,bbb,nil,nil,nil,nil,nil, aaa,bbb,nil,nil,nil,nil,nil ); - s.rawset("cc", xxx); - checkTable( s, www,nil,xxx,ddd,nil,nil,nil, www,nil,xxx,ddd,nil,nil,nil ); - checkTable( t, aaa,bbb,ccc,ddd,nil,nil,nil, nil,nil,ccc,ddd,nil,nil,nil ); - checkTable( m, aaa,bbb,nil,nil,nil,nil,nil, aaa,bbb,nil,nil,nil,nil,nil ); - t.rawset("bb", yyy); - checkTable( s, www,nil,xxx,ddd,nil,nil,nil, www,nil,xxx,ddd,nil,nil,nil ); - checkTable( t, aaa,yyy,ccc,ddd,nil,nil,nil, nil,yyy,ccc,ddd,nil,nil,nil ); - checkTable( m, aaa,bbb,nil,nil,nil,nil,nil, aaa,bbb,nil,nil,nil,nil,nil ); - t.rawset("dd", zzz); - checkTable( s, www,nil,xxx,ddd,nil,nil,nil, www,nil,xxx,ddd,nil,nil,nil ); - checkTable( t, aaa,yyy,ccc,zzz,nil,nil,nil, nil,yyy,ccc,zzz,nil,nil,nil ); - checkTable( m, aaa,bbb,nil,nil,nil,nil,nil, aaa,bbb,nil,nil,nil,nil,nil ); - - // set() invoking metatables - s.set("ee", ppp); - checkTable( s, www,nil,xxx,ddd,ppp,nil,nil, www,nil,xxx,ddd,ppp,nil,nil ); - checkTable( t, aaa,yyy,ccc,zzz,nil,nil,nil, nil,yyy,ccc,zzz,nil,nil,nil ); - checkTable( m, aaa,bbb,nil,nil,nil,nil,nil, aaa,bbb,nil,nil,nil,nil,nil ); - s.set("cc", qqq); - checkTable( s, www,nil,qqq,ddd,ppp,nil,nil, www,nil,qqq,ddd,ppp,nil,nil ); - checkTable( t, aaa,yyy,ccc,zzz,nil,nil,nil, nil,yyy,ccc,zzz,nil,nil,nil ); - checkTable( m, aaa,bbb,nil,nil,nil,nil,nil, aaa,bbb,nil,nil,nil,nil,nil ); - t.set("ff", rrr); - checkTable( s, www,nil,qqq,ddd,ppp,nil,nil, www,nil,qqq,ddd,ppp,nil,nil ); - checkTable( t, aaa,yyy,ccc,zzz,nil,rrr,nil, nil,yyy,ccc,zzz,nil,nil,nil ); - checkTable( m, aaa,bbb,nil,nil,nil,rrr,nil, aaa,bbb,nil,nil,nil,rrr,nil ); - t.set("dd", sss); - checkTable( s, www,nil,qqq,ddd,ppp,nil,nil, www,nil,qqq,ddd,ppp,nil,nil ); - checkTable( t, aaa,yyy,ccc,sss,nil,rrr,nil, nil,yyy,ccc,sss,nil,nil,nil ); - checkTable( m, aaa,bbb,nil,nil,nil,rrr,nil, aaa,bbb,nil,nil,nil,rrr,nil ); - m.set("gg", ttt); - checkTable( s, www,nil,qqq,ddd,ppp,nil,nil, www,nil,qqq,ddd,ppp,nil,nil ); - checkTable( t, aaa,yyy,ccc,sss,nil,rrr,ttt, nil,yyy,ccc,sss,nil,nil,nil ); - checkTable( m, aaa,bbb,nil,nil,nil,rrr,ttt, aaa,bbb,nil,nil,nil,rrr,ttt ); - - // make s fall back to t - s.setmetatable(LuaValue.tableOf(new LuaValue[] {LuaValue.INDEX,t,LuaValue.NEWINDEX,t})); - checkTable( s, www,yyy,qqq,ddd,ppp,rrr,ttt, www,nil,qqq,ddd,ppp,nil,nil ); - checkTable( t, aaa,yyy,ccc,sss,nil,rrr,ttt, nil,yyy,ccc,sss,nil,nil,nil ); - checkTable( m, aaa,bbb,nil,nil,nil,rrr,ttt, aaa,bbb,nil,nil,nil,rrr,ttt ); - s.set("aa", www); - checkTable( s, www,yyy,qqq,ddd,ppp,rrr,ttt, www,nil,qqq,ddd,ppp,nil,nil ); - checkTable( t, aaa,yyy,ccc,sss,nil,rrr,ttt, nil,yyy,ccc,sss,nil,nil,nil ); - checkTable( m, aaa,bbb,nil,nil,nil,rrr,ttt, aaa,bbb,nil,nil,nil,rrr,ttt ); - s.set("bb", zzz); - checkTable( s, www,zzz,qqq,ddd,ppp,rrr,ttt, www,nil,qqq,ddd,ppp,nil,nil ); - checkTable( t, aaa,zzz,ccc,sss,nil,rrr,ttt, nil,zzz,ccc,sss,nil,nil,nil ); - checkTable( m, aaa,bbb,nil,nil,nil,rrr,ttt, aaa,bbb,nil,nil,nil,rrr,ttt ); - s.set("ee", xxx); - checkTable( s, www,zzz,qqq,ddd,xxx,rrr,ttt, www,nil,qqq,ddd,xxx,nil,nil ); - checkTable( t, aaa,zzz,ccc,sss,nil,rrr,ttt, nil,zzz,ccc,sss,nil,nil,nil ); - checkTable( m, aaa,bbb,nil,nil,nil,rrr,ttt, aaa,bbb,nil,nil,nil,rrr,ttt ); - s.set("ff", yyy); - checkTable( s, www,zzz,qqq,ddd,xxx,yyy,ttt, www,nil,qqq,ddd,xxx,nil,nil ); - checkTable( t, aaa,zzz,ccc,sss,nil,yyy,ttt, nil,zzz,ccc,sss,nil,nil,nil ); - checkTable( m, aaa,bbb,nil,nil,nil,yyy,ttt, aaa,bbb,nil,nil,nil,yyy,ttt ); - - - } - -} diff --git a/luaj-2.0.3/test/junit/org/luaj/vm2/OrphanedThreadTest.java b/luaj-2.0.3/test/junit/org/luaj/vm2/OrphanedThreadTest.java deleted file mode 100644 index 2c801abb8..000000000 --- a/luaj-2.0.3/test/junit/org/luaj/vm2/OrphanedThreadTest.java +++ /dev/null @@ -1,184 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012 Luaj.org. All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - ******************************************************************************/ -package org.luaj.vm2; - -import java.io.ByteArrayInputStream; -import java.lang.ref.WeakReference; - -import junit.framework.TestCase; - -import org.luaj.vm2.LoadState; -import org.luaj.vm2.LuaValue; -import org.luaj.vm2.Varargs; -import org.luaj.vm2.compiler.LuaC; -import org.luaj.vm2.lib.OneArgFunction; -import org.luaj.vm2.lib.jse.JsePlatform; - - -public class OrphanedThreadTest extends TestCase { - - LuaThread luathread; - WeakReference luathr_ref; - LuaValue function; - WeakReference func_ref; - LuaValue env; - - protected void setUp() throws Exception { - LuaThread.thread_orphan_check_interval = 5; - env = JsePlatform.standardGlobals(); - } - - protected void tearDown() { - LuaThread.thread_orphan_check_interval = 30000; - } - - public void testCollectOrphanedNormalThread() throws Exception { - function = new NormalFunction(); - doTest(LuaValue.TRUE, LuaValue.ZERO); - } - - public void testCollectOrphanedEarlyCompletionThread() throws Exception { - function = new EarlyCompletionFunction(); - doTest(LuaValue.TRUE, LuaValue.ZERO); - } - - public void testCollectOrphanedAbnormalThread() throws Exception { - function = new AbnormalFunction(); - doTest(LuaValue.FALSE, LuaValue.valueOf("abnormal condition")); - } - - public void testCollectOrphanedClosureThread() throws Exception { - String script = - "print('in closure, arg is '..(...))\n" + - "arg = coroutine.yield(1)\n" + - "print('in closure.2, arg is '..arg)\n" + - "arg = coroutine.yield(0)\n" + - "print('leakage in closure.3, arg is '..arg)\n" + - "return 'done'\n"; - LuaC.install(); - function = LoadState.load(new ByteArrayInputStream(script.getBytes()), "script", env); - doTest(LuaValue.TRUE, LuaValue.ZERO); - } - - public void testCollectOrphanedPcallClosureThread() throws Exception { - String script = - "f = function(x)\n" + - " print('in pcall-closure, arg is '..(x))\n" + - " arg = coroutine.yield(1)\n" + - " print('in pcall-closure.2, arg is '..arg)\n" + - " arg = coroutine.yield(0)\n" + - " print('leakage in pcall-closure.3, arg is '..arg)\n" + - " return 'done'\n" + - "end\n" + - "print( 'pcall-closre.result:', pcall( f, ... ) )\n"; - LuaC.install(); - function = LoadState.load(new ByteArrayInputStream(script.getBytes()), "script", env); - doTest(LuaValue.TRUE, LuaValue.ZERO); - } - - public void testCollectOrphanedLoadCloasureThread() throws Exception { - String script = - "t = { \"print \", \"'hello, \", \"world'\", }\n" + - "i = 0\n" + - "arg = ...\n" + - "f = function()\n" + - " i = i + 1\n" + - " print('in load-closure, arg is', arg, 'next is', t[i])\n" + - " arg = coroutine.yield(1)\n" + - " return t[i]\n" + - "end\n" + - "load(f)()\n"; - LuaC.install(); - function = LoadState.load(new ByteArrayInputStream(script.getBytes()), "script", env); - doTest(LuaValue.TRUE, LuaValue.ONE); - } - - private void doTest(LuaValue status2, LuaValue value2) throws Exception { - luathread = new LuaThread(function, env); - luathr_ref = new WeakReference(luathread); - func_ref = new WeakReference(function); - assertNotNull(luathr_ref.get()); - - // resume two times - Varargs a = luathread.resume(LuaValue.valueOf("foo")); - assertEquals(LuaValue.ONE, a.arg(2)); - assertEquals(LuaValue.TRUE, a.arg1()); - a = luathread.resume(LuaValue.valueOf("bar")); - assertEquals(value2, a.arg(2)); - assertEquals(status2, a.arg1()); - - // drop strong references - luathread = null; - function = null; - - // gc - for (int i=0; i<100 && (luathr_ref.get() != null || func_ref.get() != null); i++) { - Runtime.getRuntime().gc(); - Thread.sleep(5); - } - - // check reference - assertNull(luathr_ref.get()); - assertNull(func_ref.get()); - } - - - static class NormalFunction extends OneArgFunction { - public LuaValue call(LuaValue arg) { - System.out.println("in normal.1, arg is "+arg); - arg = LuaThread.yield(ONE).arg1(); - System.out.println("in normal.2, arg is "+arg); - arg = LuaThread.yield(ZERO).arg1(); - System.out.println("in normal.3, arg is "+arg); - return NONE; - } - } - - static class EarlyCompletionFunction extends OneArgFunction { - public LuaValue call(LuaValue arg) { - System.out.println("in early.1, arg is "+arg); - arg = LuaThread.yield(ONE).arg1(); - System.out.println("in early.2, arg is "+arg); - return ZERO; - } - } - - static class AbnormalFunction extends OneArgFunction { - public LuaValue call(LuaValue arg) { - System.out.println("in abnormal.1, arg is "+arg); - arg = LuaThread.yield(ONE).arg1(); - System.out.println("in abnormal.2, arg is "+arg); - error("abnormal condition"); - return ZERO; - } - } - - static class ClosureFunction extends OneArgFunction { - public LuaValue call(LuaValue arg) { - System.out.println("in abnormal.1, arg is "+arg); - arg = LuaThread.yield(ONE).arg1(); - System.out.println("in abnormal.2, arg is "+arg); - error("abnormal condition"); - return ZERO; - } - } -} diff --git a/luaj-2.0.3/test/junit/org/luaj/vm2/RequireClassTest.java b/luaj-2.0.3/test/junit/org/luaj/vm2/RequireClassTest.java deleted file mode 100644 index 3f0743546..000000000 --- a/luaj-2.0.3/test/junit/org/luaj/vm2/RequireClassTest.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.luaj.vm2; - -import junit.framework.TestCase; - -import org.luaj.vm2.lib.jse.JsePlatform; -import org.luaj.vm2.require.RequireSampleClassCastExcep; -import org.luaj.vm2.require.RequireSampleLoadLuaError; -import org.luaj.vm2.require.RequireSampleLoadRuntimeExcep; - -public class RequireClassTest extends TestCase { - - private LuaTable globals; - private LuaValue require; - - public void setUp() { - globals = JsePlatform.standardGlobals(); - require = globals.get("require"); - } - - public void testRequireClassSuccess() { - LuaValue result = require.call( LuaValue.valueOf("org.luaj.vm2.require.RequireSampleSuccess") ); - assertEquals( "require-sample-success", result.tojstring() ); - result = require.call( LuaValue.valueOf("org.luaj.vm2.require.RequireSampleSuccess") ); - assertEquals( "require-sample-success", result.tojstring() ); - } - - public void testRequireClassLoadLuaError() { - try { - LuaValue result = require.call( LuaValue.valueOf(RequireSampleLoadLuaError.class.getName()) ); - fail( "incorrectly loaded class that threw lua error"); - } catch ( LuaError le ) { - assertEquals( - "sample-load-lua-error", - le.getMessage() ); - } - try { - LuaValue result = require.call( LuaValue.valueOf(RequireSampleLoadLuaError.class.getName()) ); - fail( "incorrectly loaded class that threw lua error"); - } catch ( LuaError le ) { - assertEquals( - "loop or previous error loading module '"+RequireSampleLoadLuaError.class.getName()+"'", - le.getMessage() ); - } - } - - public void testRequireClassLoadRuntimeException() { - try { - LuaValue result = require.call( LuaValue.valueOf(RequireSampleLoadRuntimeExcep.class.getName()) ); - fail( "incorrectly loaded class that threw runtime exception"); - } catch ( RuntimeException le ) { - assertEquals( - "sample-load-runtime-exception", - le.getMessage() ); - } - try { - LuaValue result = require.call( LuaValue.valueOf(RequireSampleLoadRuntimeExcep.class.getName()) ); - fail( "incorrectly loaded class that threw runtime exception"); - } catch ( LuaError le ) { - assertEquals( - "loop or previous error loading module '"+RequireSampleLoadRuntimeExcep.class.getName()+"'", - le.getMessage() ); - } - } - - - public void testRequireClassClassCastException() { - try { - LuaValue result = require.call( LuaValue.valueOf(RequireSampleClassCastExcep.class.getName()) ); - fail( "incorrectly loaded class that threw class cast exception"); - } catch ( LuaError le ) { - String msg = le.getMessage(); - if ( msg.indexOf("not found") < 0 ) - fail( "expected 'not found' message but got "+msg ); - } - try { - LuaValue result = require.call( LuaValue.valueOf(RequireSampleClassCastExcep.class.getName()) ); - fail( "incorrectly loaded class that threw class cast exception"); - } catch ( LuaError le ) { - String msg = le.getMessage(); - if ( msg.indexOf("not found") < 0 ) - fail( "expected 'not found' message but got "+msg ); - } - } -} diff --git a/luaj-2.0.3/test/junit/org/luaj/vm2/ScriptDrivenTest.java b/luaj-2.0.3/test/junit/org/luaj/vm2/ScriptDrivenTest.java deleted file mode 100644 index c50f79cb4..000000000 --- a/luaj-2.0.3/test/junit/org/luaj/vm2/ScriptDrivenTest.java +++ /dev/null @@ -1,258 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009-2013 Luaj.org. All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - ******************************************************************************/ -package org.luaj.vm2; - -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.PrintStream; -import java.net.MalformedURLException; -import java.net.URL; - -import junit.framework.TestCase; - -import org.luaj.vm2.lib.BaseLib; -import org.luaj.vm2.lib.ResourceFinder; -import org.luaj.vm2.lib.jse.JseProcess; -import org.luaj.vm2.luajc.LuaJC; - -abstract -public class ScriptDrivenTest extends TestCase implements ResourceFinder { - public static final boolean nocompile = "true".equals(System.getProperty("nocompile")); - - public enum PlatformType { - JME, JSE, LUAJIT, LUA2JAVA, - } - - private final PlatformType platform; - private final String subdir; - protected LuaTable globals; - - static final String zipdir = "test/lua/"; - static final String zipfile = "luaj2.0-tests.zip"; - - protected ScriptDrivenTest( PlatformType platform, String subdir ) { - this.platform = platform; - this.subdir = subdir; - initGlobals(); - } - - private void initGlobals() { - switch ( platform ) { - default: - case JSE: - case LUAJIT: - case LUA2JAVA: - globals = org.luaj.vm2.lib.jse.JsePlatform.debugGlobals(); - break; - case JME: - globals = org.luaj.vm2.lib.jme.JmePlatform.debugGlobals(); - break; - } - } - - - protected void setUp() throws Exception { - super.setUp(); - initGlobals(); - BaseLib.FINDER = this; - } - - // ResourceFinder implementation. - public InputStream findResource(String filename) { - InputStream is = findInPlainFile(filename); - if (is != null) return is; - is = findInPlainFileAsResource("",filename); - if (is != null) return is; - is = findInPlainFileAsResource("/",filename); - if (is != null) return is; - is = findInZipFileAsPlainFile(filename); - if (is != null) return is; - is = findInZipFileAsResource("",filename); - if (is != null) return is; - is = findInZipFileAsResource("/",filename); - return is; - } - - private InputStream findInPlainFileAsResource(String prefix, String filename) { - return getClass().getResourceAsStream(prefix + subdir + filename); - } - - private InputStream findInPlainFile(String filename) { - try { - File f = new File(zipdir+subdir+filename); - if (f.exists()) - return new FileInputStream(f); - } catch ( IOException ioe ) { - ioe.printStackTrace(); - } - return null; - } - - private InputStream findInZipFileAsPlainFile(String filename) { - URL zip; - File file = new File(zipdir+zipfile); - try { - if ( file.exists() ) { - zip = file.toURI().toURL(); - String path = "jar:"+zip.toExternalForm()+ "!/"+subdir+filename; - URL url = new URL(path); - return url.openStream(); - } - } catch (MalformedURLException e) { - e.printStackTrace(); - } catch (FileNotFoundException e) { - // Ignore and return null. - } catch (IOException ioe) { - ioe.printStackTrace(); - } - return null; - } - - - private InputStream findInZipFileAsResource(String prefix, String filename) { - URL zip = null; - zip = getClass().getResource(zipfile); - if ( zip != null ) - try { - String path = "jar:"+zip.toExternalForm()+ "!/"+subdir+filename; - URL url = new URL(path); - return url.openStream(); - } catch (IOException ioe) { - ioe.printStackTrace(); - } - return null; - } - - // */ - protected void runTest(String testName) { - try { - // override print() - final ByteArrayOutputStream output = new ByteArrayOutputStream(); - final PrintStream oldps = BaseLib.instance.STDOUT; - final PrintStream ps = new PrintStream( output ); - BaseLib.instance.STDOUT = ps; - - // run the script - try { - LuaValue chunk = loadScript(testName, globals); - chunk.call(LuaValue.valueOf(platform.toString())); - - ps.flush(); - String actualOutput = new String(output.toByteArray()); - String expectedOutput = getExpectedOutput(testName); - actualOutput = actualOutput.replaceAll("\r\n", "\n"); - expectedOutput = expectedOutput.replaceAll("\r\n", "\n"); - - assertEquals(expectedOutput, actualOutput); - } finally { - BaseLib.instance.STDOUT = oldps; - ps.close(); - } - } catch ( IOException ioe ) { - throw new RuntimeException(ioe.toString()); - } catch ( InterruptedException ie ) { - throw new RuntimeException(ie.toString()); - } - } - - protected LuaValue loadScript(String name, LuaTable _G) throws IOException { - InputStream script = this.findResource(name+".lua"); - if ( script == null ) - fail("Could not load script for test case: " + name); - try { - switch ( this.platform ) { - case LUAJIT: - if ( nocompile ) { - LuaValue c = (LuaValue) Class.forName(name).newInstance(); - return c; - } else { - return LuaJC.getInstance().load( script, name, _G); - } - default: - return LoadState.load(script, "@"+name+".lua", _G); - } - } catch ( Exception e ) { - e.printStackTrace(); - throw new IOException( e.toString() ); - } finally { - script.close(); - } - } - - private String getExpectedOutput(final String name) throws IOException, - InterruptedException { - InputStream output = this.findResource(name+".out"); - if (output != null) - try { - return readString(output); - } finally { - output.close(); - } - String expectedOutput = executeLuaProcess(name); - if (expectedOutput == null) - throw new IOException("Failed to get comparison output or run process for "+name); - return expectedOutput; - } - - private String executeLuaProcess(String name) throws IOException, InterruptedException { - InputStream script = findResource(name+".lua"); - if ( script == null ) - throw new IOException("Failed to find source file "+script); - try { - String luaCommand = System.getProperty("LUA_COMMAND"); - if ( luaCommand == null ) - luaCommand = "lua"; - String[] args = new String[] { luaCommand, "-", platform.toString() }; - return collectProcessOutput(args, script); - } finally { - script.close(); - } - } - - public static String collectProcessOutput(String[] cmd, final InputStream input) - throws IOException, InterruptedException { - Runtime r = Runtime.getRuntime(); - final ByteArrayOutputStream baos = new ByteArrayOutputStream(); - new JseProcess(cmd, input, baos, System.err).waitFor(); - return new String(baos.toByteArray()); - } - - private String readString(InputStream is) throws IOException { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - copy(is, baos); - return new String(baos.toByteArray()); - } - - private static void copy(InputStream is, OutputStream os) throws IOException { - byte[] buf = new byte[1024]; - int r; - while ((r = is.read(buf)) >= 0) { - os.write(buf, 0, r); - } - } - -} diff --git a/luaj-2.0.3/test/junit/org/luaj/vm2/StringTest.java b/luaj-2.0.3/test/junit/org/luaj/vm2/StringTest.java deleted file mode 100644 index b2b2f6128..000000000 --- a/luaj-2.0.3/test/junit/org/luaj/vm2/StringTest.java +++ /dev/null @@ -1,117 +0,0 @@ -package org.luaj.vm2; - -import java.io.IOException; -import java.io.InputStream; -import java.io.UnsupportedEncodingException; - -import junit.framework.TestCase; - -import org.luaj.vm2.lib.jse.JsePlatform; - -public class StringTest extends TestCase { - - protected void setUp() throws Exception { - JsePlatform.standardGlobals(); - } - - public void testToInputStream() throws IOException { - LuaString str = LuaString.valueOf("Hello"); - - InputStream is = str.toInputStream(); - - assertEquals( 'H', is.read() ); - assertEquals( 'e', is.read() ); - assertEquals( 2, is.skip( 2 ) ); - assertEquals( 'o', is.read() ); - assertEquals( -1, is.read() ); - - assertTrue( is.markSupported() ); - - is.reset(); - - assertEquals( 'H', is.read() ); - is.mark( 4 ); - - assertEquals( 'e', is.read() ); - is.reset(); - assertEquals( 'e', is.read() ); - - LuaString substr = str.substring( 1, 4 ); - assertEquals( 3, substr.length() ); - - is.close(); - is = substr.toInputStream(); - - assertEquals( 'e', is.read() ); - assertEquals( 'l', is.read() ); - assertEquals( 'l', is.read() ); - assertEquals( -1, is.read() ); - - is = substr.toInputStream(); - is.reset(); - - assertEquals( 'e', is.read() ); - } - - - private static final String userFriendly( String s ) { - StringBuffer sb = new StringBuffer(); - for ( int i=0, n=s.length(); i= 0x80 ) { - sb.append( "\\u"+Integer.toHexString(0x10000+c).substring(1) ); - } else { - sb.append( (char) c ); - } - } - return sb.toString(); - } - - public void testUtf820482051() throws UnsupportedEncodingException { - int i = 2048; - char[] c = { (char) (i+0), (char) (i+1), (char) (i+2), (char) (i+3) }; - String before = new String(c)+" "+i+"-"+(i+4); - LuaString ls = LuaString.valueOf(before); - String after = ls.tojstring(); - assertEquals( userFriendly( before ), userFriendly( after ) ); - - } - - public void testUtf8() { - for ( int i=4; i<0xffff; i+=4 ) { - char[] c = { (char) (i+0), (char) (i+1), (char) (i+2), (char) (i+3) }; - String before = new String(c)+" "+i+"-"+(i+4); - LuaString ls = LuaString.valueOf(before); - String after = ls.tojstring(); - assertEquals( userFriendly( before ), userFriendly( after ) ); - } - char[] c = { (char) (1), (char) (2), (char) (3) }; - String before = new String(c)+" 1-3"; - LuaString ls = LuaString.valueOf(before); - String after = ls.tojstring(); - assertEquals( userFriendly( before ), userFriendly( after ) ); - - } - - public void testSpotCheckUtf8() throws UnsupportedEncodingException { - byte[] bytes = {(byte)194,(byte)160,(byte)194,(byte)161,(byte)194,(byte)162,(byte)194,(byte)163,(byte)194,(byte)164}; - String expected = new String(bytes, "UTF8"); - String actual = LuaString.valueOf(bytes).tojstring(); - char[] d = actual.toCharArray(); - assertEquals(160, d[0]); - assertEquals(161, d[1]); - assertEquals(162, d[2]); - assertEquals(163, d[3]); - assertEquals(164, d[4]); - - } - - public void testNullTerminated() { - char[] c = { 'a', 'b', 'c', '\0', 'd', 'e', 'f' }; - String before = new String(c); - LuaString ls = LuaString.valueOf(before); - String after = ls.tojstring(); - assertEquals( userFriendly( "abc\0def" ), userFriendly( after ) ); - - } -} diff --git a/luaj-2.0.3/test/junit/org/luaj/vm2/TableArrayTest.java b/luaj-2.0.3/test/junit/org/luaj/vm2/TableArrayTest.java deleted file mode 100644 index 3ce96ea4e..000000000 --- a/luaj-2.0.3/test/junit/org/luaj/vm2/TableArrayTest.java +++ /dev/null @@ -1,355 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 Luaj.org. All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - ******************************************************************************/ -package org.luaj.vm2; - -import java.util.Vector; - -import org.luaj.vm2.LuaDouble; -import org.luaj.vm2.LuaInteger; -import org.luaj.vm2.LuaString; -import org.luaj.vm2.LuaTable; -import org.luaj.vm2.LuaValue; - -import junit.framework.TestCase; - -/** - * Tests for tables used as lists. - */ -public class TableArrayTest extends TestCase { - - protected LuaTable new_Table() { - return new LuaTable(); - } - - protected LuaTable new_Table(int n,int m) { - return new LuaTable(n,m); - } - - public void testInOrderIntegerKeyInsertion() { - LuaTable t = new_Table(); - - for ( int i = 1; i <= 32; ++i ) { - t.set( i, LuaString.valueOf( "Test Value! "+i ) ); - } - - // Ensure all keys are still there. - for ( int i = 1; i <= 32; ++i ) { - assertEquals( "Test Value! " + i, t.get( i ).tojstring() ); - } - - // Ensure capacities make sense - assertEquals( 0, t.getHashLength() ); - - assertTrue( t.getArrayLength() >= 32 ); - assertTrue( t.getArrayLength() <= 64 ); - - } - - public void testResize() { - LuaTable t = new_Table(); - - // NOTE: This order of insertion is important. - t.set(3, LuaInteger.valueOf(3)); - t.set(1, LuaInteger.valueOf(1)); - t.set(5, LuaInteger.valueOf(5)); - t.set(4, LuaInteger.valueOf(4)); - t.set(6, LuaInteger.valueOf(6)); - t.set(2, LuaInteger.valueOf(2)); - - for ( int i = 1; i < 6; ++i ) { - assertEquals(LuaInteger.valueOf(i), t.get(i)); - } - - assertTrue( t.getArrayLength() >= 0 && t.getArrayLength() <= 2 ); - assertTrue( t.getHashLength() >= 4 ); - } - - public void testOutOfOrderIntegerKeyInsertion() { - LuaTable t = new_Table(); - - for ( int i = 32; i > 0; --i ) { - t.set( i, LuaString.valueOf( "Test Value! "+i ) ); - } - - // Ensure all keys are still there. - for ( int i = 1; i <= 32; ++i ) { - assertEquals( "Test Value! "+i, t.get( i ).tojstring() ); - } - - // Ensure capacities make sense - assertTrue( t.getArrayLength() >= 0 ); - assertTrue( t.getArrayLength() <= 6 ); - - assertTrue( t.getHashLength() >= 16 ); - assertTrue( t.getHashLength() <= 64 ); - - } - - public void testStringAndIntegerKeys() { - LuaTable t = new_Table(); - - for ( int i = 0; i < 10; ++i ) { - LuaString str = LuaString.valueOf( String.valueOf( i ) ); - t.set( i, str ); - t.set( str, LuaInteger.valueOf( i ) ); - } - - assertTrue( t.getArrayLength() >= 9 ); // 1, 2, ..., 9 - assertTrue( t.getArrayLength() <= 18 ); - assertTrue( t.getHashLength() >= 11 ); // 0, "0", "1", ..., "9" - assertTrue( t.getHashLength() <= 33 ); - - LuaValue[] keys = t.keys(); - - int intKeys = 0; - int stringKeys = 0; - - assertEquals( 20, keys.length ); - for ( int i = 0; i < keys.length; ++i ) { - LuaValue k = keys[i]; - - if ( k instanceof LuaInteger ) { - final int ik = k.toint(); - assertTrue( ik >= 0 && ik < 10 ); - final int mask = 1 << ik; - assertTrue( ( intKeys & mask ) == 0 ); - intKeys |= mask; - } else if ( k instanceof LuaString ) { - final int ik = Integer.parseInt( k.tojstring() ); - assertEquals( String.valueOf( ik ), k.tojstring() ); - assertTrue( ik >= 0 && ik < 10 ); - final int mask = 1 << ik; - assertTrue( "Key \""+ik+"\" found more than once", ( stringKeys & mask ) == 0 ); - stringKeys |= mask; - } else { - fail( "Unexpected type of key found" ); - } - } - - assertEquals( 0x03FF, intKeys ); - assertEquals( 0x03FF, stringKeys ); - } - - public void testBadInitialCapacity() { - LuaTable t = new_Table(0, 1); - - t.set( "test", LuaString.valueOf("foo") ); - t.set( "explode", LuaString.valueOf("explode") ); - assertEquals( 2, t.keyCount() ); - } - - public void testRemove0() { - LuaTable t = new_Table(2, 0); - - t.set( 1, LuaString.valueOf("foo") ); - t.set( 2, LuaString.valueOf("bah") ); - assertNotSame(LuaValue.NIL, t.get(1)); - assertNotSame(LuaValue.NIL, t.get(2)); - assertEquals(LuaValue.NIL, t.get(3)); - - t.set( 1, LuaValue.NIL ); - t.set( 2, LuaValue.NIL ); - t.set( 3, LuaValue.NIL ); - assertEquals(LuaValue.NIL, t.get(1)); - assertEquals(LuaValue.NIL, t.get(2)); - assertEquals(LuaValue.NIL, t.get(3)); - } - - public void testRemove1() { - LuaTable t = new_Table(0, 1); - assertEquals( 0, t.keyCount() ); - - t.set( "test", LuaString.valueOf("foo") ); - assertEquals( 1, t.keyCount() ); - t.set( "explode", LuaValue.NIL ); - assertEquals( 1, t.keyCount() ); - t.set( 42, LuaValue.NIL ); - assertEquals( 1, t.keyCount() ); - t.set( new_Table(), LuaValue.NIL ); - assertEquals( 1, t.keyCount() ); - t.set( "test", LuaValue.NIL ); - assertEquals( 0, t.keyCount() ); - - t.set( 10, LuaInteger.valueOf( 5 ) ); - t.set( 10, LuaValue.NIL ); - assertEquals( 0, t.keyCount() ); - } - - public void testRemove2() { - LuaTable t = new_Table(0, 1); - - t.set( "test", LuaString.valueOf("foo") ); - t.set( "string", LuaInteger.valueOf( 10 ) ); - assertEquals( 2, t.keyCount() ); - - t.set( "string", LuaValue.NIL ); - t.set( "three", LuaDouble.valueOf( 3.14 ) ); - assertEquals( 2, t.keyCount() ); - - t.set( "test", LuaValue.NIL ); - assertEquals( 1, t.keyCount() ); - - t.set( 10, LuaInteger.valueOf( 5 ) ); - assertEquals( 2, t.keyCount() ); - - t.set( 10, LuaValue.NIL ); - assertEquals( 1, t.keyCount() ); - - t.set( "three", LuaValue.NIL ); - assertEquals( 0, t.keyCount() ); - } - - public void testInOrderlen() { - LuaTable t = new_Table(); - - for ( int i = 1; i <= 32; ++i ) { - LuaValue v = LuaString.valueOf( "Test Value! "+i ); - t.set( i, v ); - assertEquals( i, t.length() ); - assertEquals( i, t.maxn() ); - } - } - - public void testOutOfOrderlen() { - LuaTable t = new_Table(); - - for ( int j=8; j<32; j+=8 ) { - for ( int i = j; i > 0; --i ) { - t.set( i, LuaString.valueOf( "Test Value! "+i ) ); - } - assertEquals( j, t.length() ); - assertEquals( j, t.maxn() ); - } - } - - public void testStringKeyslen() { - LuaTable t = new_Table(); - - for ( int i = 1; i <= 32; ++i ) { - t.set( "str-"+i, LuaString.valueOf( "String Key Test Value! "+i ) ); - assertEquals( 0, t.length() ); - assertEquals( 0, t.maxn() ); - } - } - - public void testMixedKeyslen() { - LuaTable t = new_Table(); - - for ( int i = 1; i <= 32; ++i ) { - t.set( "str-"+i, LuaString.valueOf( "String Key Test Value! "+i ) ); - t.set( i, LuaString.valueOf( "Int Key Test Value! "+i ) ); - assertEquals( i, t.length() ); - assertEquals( i, t.maxn() ); - } - } - - private static final void compareLists(LuaTable t,Vector v) { - int n = v.size(); - assertEquals(v.size(),t.length()); - for ( int j=0; j l = new ArrayList(); - LuaValue k = LuaValue.NIL; - while ( true ) { - Varargs n = t.next(k); - if ( (k = n.arg1()).isnil() ) - break; - l.add( k ); - } - return l.toArray(new LuaValue[t.length()]); - } - - - public void testInOrderIntegerKeyInsertion() { - LuaTable t = new_Table(); - - for ( int i = 1; i <= 32; ++i ) { - t.set( i, LuaValue.valueOf( "Test Value! "+i ) ); - } - - // Ensure all keys are still there. - for ( int i = 1; i <= 32; ++i ) { - assertEquals( "Test Value! " + i, t.get( i ).tojstring() ); - } - - // Ensure capacities make sense - assertEquals( 0, t.getHashLength() ); - - assertTrue( t.getArrayLength() >= 32 ); - assertTrue( t.getArrayLength() <= 64 ); - - } - - public void testRekeyCount() { - LuaTable t = new_Table(); - - // NOTE: This order of insertion is important. - t.set(3, LuaInteger.valueOf(3)); - t.set(1, LuaInteger.valueOf(1)); - t.set(5, LuaInteger.valueOf(5)); - t.set(4, LuaInteger.valueOf(4)); - t.set(6, LuaInteger.valueOf(6)); - t.set(2, LuaInteger.valueOf(2)); - - for ( int i = 1; i < 6; ++i ) { - assertEquals(LuaInteger.valueOf(i), t.get(i)); - } - - assertTrue( t.getArrayLength() >= 0 && t.getArrayLength() <= 2 ); - assertTrue( t.getHashLength() >= 4 ); - } - - public void testOutOfOrderIntegerKeyInsertion() { - LuaTable t = new_Table(); - - for ( int i = 32; i > 0; --i ) { - t.set( i, LuaValue.valueOf( "Test Value! "+i ) ); - } - - // Ensure all keys are still there. - for ( int i = 1; i <= 32; ++i ) { - assertEquals( "Test Value! "+i, t.get( i ).tojstring() ); - } - - // Ensure capacities make sense - assertTrue( t.getArrayLength() >= 0 ); - assertTrue( t.getArrayLength() <= 6 ); - - assertTrue( t.getHashLength() >= 16 ); - assertTrue( t.getHashLength() <= 64 ); - - } - - public void testStringAndIntegerKeys() { - LuaTable t = new_Table(); - - for ( int i = 0; i < 10; ++i ) { - LuaString str = LuaValue.valueOf( String.valueOf( i ) ); - t.set( i, str ); - t.set( str, LuaInteger.valueOf( i ) ); - } - - assertTrue( t.getArrayLength() >= 9 ); // 1, 2, ..., 9 - assertTrue( t.getArrayLength() <= 18 ); - assertTrue( t.getHashLength() >= 11 ); // 0, "0", "1", ..., "9" - assertTrue( t.getHashLength() <= 33 ); - - LuaValue[] keys = keys(t); - - int intKeys = 0; - int stringKeys = 0; - - assertEquals( 20, keys.length ); - for ( int i = 0; i < keys.length; ++i ) { - LuaValue k = keys[i]; - - if ( k instanceof LuaInteger ) { - final int ik = k.toint(); - assertTrue( ik >= 0 && ik < 10 ); - final int mask = 1 << ik; - assertTrue( ( intKeys & mask ) == 0 ); - intKeys |= mask; - } else if ( k instanceof LuaString ) { - final int ik = Integer.parseInt( k.strvalue().tojstring() ); - assertEquals( String.valueOf( ik ), k.strvalue().tojstring() ); - assertTrue( ik >= 0 && ik < 10 ); - final int mask = 1 << ik; - assertTrue( "Key \""+ik+"\" found more than once", ( stringKeys & mask ) == 0 ); - stringKeys |= mask; - } else { - fail( "Unexpected type of key found" ); - } - } - - assertEquals( 0x03FF, intKeys ); - assertEquals( 0x03FF, stringKeys ); - } - - public void testBadInitialCapacity() { - LuaTable t = new_Table(0, 1); - - t.set( "test", LuaValue.valueOf("foo") ); - t.set( "explode", LuaValue.valueOf("explode") ); - assertEquals( 2, keyCount(t) ); - } - - public void testRemove0() { - LuaTable t = new_Table(2, 0); - - t.set( 1, LuaValue.valueOf("foo") ); - t.set( 2, LuaValue.valueOf("bah") ); - assertNotSame(LuaValue.NIL, t.get(1)); - assertNotSame(LuaValue.NIL, t.get(2)); - assertEquals(LuaValue.NIL, t.get(3)); - - t.set( 1, LuaValue.NIL ); - t.set( 2, LuaValue.NIL ); - t.set( 3, LuaValue.NIL ); - assertEquals(LuaValue.NIL, t.get(1)); - assertEquals(LuaValue.NIL, t.get(2)); - assertEquals(LuaValue.NIL, t.get(3)); - } - - public void testRemove1() { - LuaTable t = new_Table(0, 1); - - t.set( "test", LuaValue.valueOf("foo") ); - t.set( "explode", LuaValue.NIL ); - t.set( 42, LuaValue.NIL ); - t.set( new_Table(), LuaValue.NIL ); - t.set( "test", LuaValue.NIL ); - assertEquals( 0, keyCount(t) ); - - t.set( 10, LuaInteger.valueOf( 5 ) ); - t.set( 10, LuaValue.NIL ); - assertEquals( 0, keyCount(t) ); - } - - public void testRemove2() { - LuaTable t = new_Table(0, 1); - - t.set( "test", LuaValue.valueOf("foo") ); - t.set( "string", LuaInteger.valueOf( 10 ) ); - assertEquals( 2, keyCount(t) ); - - t.set( "string", LuaValue.NIL ); - t.set( "three", LuaValue.valueOf( 3.14 ) ); - assertEquals( 2, keyCount(t) ); - - t.set( "test", LuaValue.NIL ); - assertEquals( 1, keyCount(t) ); - - t.set( 10, LuaInteger.valueOf( 5 ) ); - assertEquals( 2, keyCount(t) ); - - t.set( 10, LuaValue.NIL ); - assertEquals( 1, keyCount(t) ); - - t.set( "three", LuaValue.NIL ); - assertEquals( 0, keyCount(t) ); - } - - public void testInOrderLuaLength() { - LuaTable t = new_Table(); - - for ( int i = 1; i <= 32; ++i ) { - t.set( i, LuaValue.valueOf( "Test Value! "+i ) ); - assertEquals( i, t.length() ); - assertEquals( i, t.maxn() ); - } - } - - public void testOutOfOrderLuaLength() { - LuaTable t = new_Table(); - - for ( int j=8; j<32; j+=8 ) { - for ( int i = j; i > 0; --i ) { - t.set( i, LuaValue.valueOf( "Test Value! "+i ) ); - } - assertEquals( j, t.length() ); - assertEquals( j, t.maxn() ); - } - } - - public void testStringKeysLuaLength() { - LuaTable t = new_Table(); - - for ( int i = 1; i <= 32; ++i ) { - t.set( "str-"+i, LuaValue.valueOf( "String Key Test Value! "+i ) ); - assertEquals( 0, t.length() ); - assertEquals( 0, t.maxn() ); - } - } - - public void testMixedKeysLuaLength() { - LuaTable t = new_Table(); - - for ( int i = 1; i <= 32; ++i ) { - t.set( "str-"+i, LuaValue.valueOf( "String Key Test Value! "+i ) ); - t.set( i, LuaValue.valueOf( "Int Key Test Value! "+i ) ); - assertEquals( i, t.length() ); - assertEquals( i, t.maxn() ); - } - } - - private static final void compareLists(LuaTable t,Vector v) { - int n = v.size(); - assertEquals(v.size(),t.length()); - for ( int j=0; j4., ia.gt(ib).toboolean()); - assertEquals(.25>.5, da.gt(db).toboolean()); - assertEquals(3.>4., ia.gt_b(ib)); - assertEquals(.25>.5, da.gt_b(db)); - - // unlike kinds - assertEquals(3.>.25, ia.gt(da).toboolean()); - assertEquals(.25>3., da.gt(ia).toboolean()); - assertEquals(3.>.25, ia.gt_b(da)); - assertEquals(.25>3., da.gt_b(ia)); - } - - public void testGtEq() { - LuaValue ia=LuaValue.valueOf(3), ib=LuaValue.valueOf(4); - LuaValue da=LuaValue.valueOf(.25), db=LuaValue.valueOf(.5); - - // like kinds - assertEquals(3.>=4., ia.gteq(ib).toboolean()); - assertEquals(.25>=.5, da.gteq(db).toboolean()); - assertEquals(3.>=4., ia.gteq_b(ib)); - assertEquals(.25>=.5, da.gteq_b(db)); - - // unlike kinds - assertEquals(3.>=.25, ia.gteq(da).toboolean()); - assertEquals(.25>=3., da.gteq(ia).toboolean()); - assertEquals(3.>=.25, ia.gteq_b(da)); - assertEquals(.25>=3., da.gteq_b(ia)); - } - - public void testNotEq() { - LuaValue ia=LuaValue.valueOf(3), ib=LuaValue.valueOf(4); - LuaValue da=LuaValue.valueOf(.25), db=LuaValue.valueOf(.5); - LuaValue sa=LuaValue.valueOf("1.5"), sb=LuaValue.valueOf("2.0"); - - // like kinds - assertEquals(3.!=4., ia.neq(ib).toboolean()); - assertEquals(.25!=.5, da.neq(db).toboolean()); - assertEquals(1.5!=2., sa.neq(sb).toboolean()); - assertEquals(3.!=4., ia.neq_b(ib)); - assertEquals(.25!=.5, da.neq_b(db)); - assertEquals(1.5!=2., sa.neq_b(sb)); - - // unlike kinds - assertEquals(3.!=.25, ia.neq(da).toboolean()); - assertEquals(.25!=3., da.neq(ia).toboolean()); - assertEquals(3.!=1.5, ia.neq(sa).toboolean()); - assertEquals(1.5!=3., sa.neq(ia).toboolean()); - assertEquals(.25!=1.5, da.neq(sa).toboolean()); - assertEquals(1.5!=.25, sa.neq(da).toboolean()); - assertEquals(3.!=.25, ia.neq_b(da)); - assertEquals(.25!=3., da.neq_b(ia)); - assertEquals(3.!=1.5, ia.neq_b(sa)); - assertEquals(1.5!=3., sa.neq_b(ia)); - assertEquals(.25!=1.5, da.neq_b(sa)); - assertEquals(1.5!=.25, sa.neq_b(da)); - } - - - public void testCompareErrors() { - LuaValue ia=LuaValue.valueOf(111), ib=LuaValue.valueOf(44); - LuaValue da=LuaValue.valueOf(55.25), db=LuaValue.valueOf(3.5); - LuaValue sa=LuaValue.valueOf("22.125"), sb=LuaValue.valueOf("7.25"); - - String[] ops = { "lt", "lteq", }; - LuaValue[] vals = { LuaValue.NIL, LuaValue.TRUE, LuaValue.tableOf() }; - LuaValue[] numerics = { LuaValue.valueOf(111), LuaValue.valueOf(55.25), LuaValue.valueOf("22.125") }; - for ( int i=0; i 4); - - // check that table can be used to get elements - assertEquals(tableValue, t.get("table")); - assertEquals(stringValue, t.get("string")); - assertEquals(obj, t.get("userdata").checkuserdata()); - - // nothing should be collected, since we have strong references here - collectGarbage(); - - // check that elements are still there - assertEquals(tableValue, t.get("table")); - assertEquals(stringValue, t.get("string")); - assertEquals(obj, t.get("userdata").checkuserdata()); - - // drop our strong references - obj = null; - tableValue = null; - stringValue = null; - - // Garbage collection should cause weak entries to be dropped. - collectGarbage(); - - // check that they are dropped - assertEquals(LuaValue.NIL, t.get("table")); - assertEquals(LuaValue.NIL, t.get("userdata")); - assertFalse("strings should not be in weak references", t.get("string").isnil()); - } - } - - public static class WeakKeyTableTest extends WeakTableTest { - protected LuaTable new_Table() { return new WeakTable(true, false); } - protected LuaTable new_Table(int n,int m) { return new WeakTable(true, false); } - - public void testWeakKeysTable() { - LuaTable t = new WeakTable(true, false); - - LuaValue key = LuaValue.userdataOf(new MyData(111)); - LuaValue val = LuaValue.userdataOf(new MyData(222)); - - // set up the table - t.set( key, val ); - assertEquals( val, t.get(key) ); - System.gc(); - assertEquals( val, t.get(key) ); - - // drop key and value references, replace them with new ones - WeakReference origkey = new WeakReference(key); - WeakReference origval = new WeakReference(val); - key = LuaValue.userdataOf(new MyData(111)); - val = LuaValue.userdataOf(new MyData(222)); - - // new key and value should be interchangeable (feature of this test class) - assertEquals( key, origkey.get() ); - assertEquals( val, origval.get() ); - assertEquals( val, t.get(key) ); - assertEquals( val, t.get((LuaValue) origkey.get()) ); - assertEquals( origval.get(), t.get(key) ); - - // value should not be reachable after gc - collectGarbage(); - assertEquals( null, origkey.get() ); - assertEquals( LuaValue.NIL, t.get(key) ); - collectGarbage(); - assertEquals( null, origval.get() ); - } - - public void testNext() { - LuaTable t = new WeakTable(true, true); - - LuaValue key = LuaValue.userdataOf(new MyData(111)); - LuaValue val = LuaValue.userdataOf(new MyData(222)); - LuaValue key2 = LuaValue.userdataOf(new MyData(333)); - LuaValue val2 = LuaValue.userdataOf(new MyData(444)); - LuaValue key3 = LuaValue.userdataOf(new MyData(555)); - LuaValue val3 = LuaValue.userdataOf(new MyData(666)); - - // set up the table - t.set( key, val ); - t.set( key2, val2 ); - t.set( key3, val3 ); - - // forget one of the keys - key2 = null; - val2 = null; - collectGarbage(); - - // table should have 2 entries - int size = 0; - for ( LuaValue k = t.next(LuaValue.NIL).arg1(); !k.isnil(); - k = t.next(k).arg1() ) { - size++; - } - assertEquals(2, size); - } - } - - public static class WeakKeyValueTableTest extends WeakTableTest { - protected LuaTable new_Table() { return new WeakTable(true, true); } - protected LuaTable new_Table(int n,int m) { return new WeakTable(true, true); } - - public void testWeakKeysValuesTable() { - LuaTable t = new WeakTable(true, true); - - LuaValue key = LuaValue.userdataOf(new MyData(111)); - LuaValue val = LuaValue.userdataOf(new MyData(222)); - LuaValue key2 = LuaValue.userdataOf(new MyData(333)); - LuaValue val2 = LuaValue.userdataOf(new MyData(444)); - LuaValue key3 = LuaValue.userdataOf(new MyData(555)); - LuaValue val3 = LuaValue.userdataOf(new MyData(666)); - - // set up the table - t.set( key, val ); - t.set( key2, val2 ); - t.set( key3, val3 ); - assertEquals( val, t.get(key) ); - assertEquals( val2, t.get(key2) ); - assertEquals( val3, t.get(key3) ); - System.gc(); - assertEquals( val, t.get(key) ); - assertEquals( val2, t.get(key2) ); - assertEquals( val3, t.get(key3) ); - - // drop key and value references, replace them with new ones - WeakReference origkey = new WeakReference(key); - WeakReference origval = new WeakReference(val); - WeakReference origkey2 = new WeakReference(key2); - WeakReference origval2 = new WeakReference(val2); - WeakReference origkey3 = new WeakReference(key3); - WeakReference origval3 = new WeakReference(val3); - key = LuaValue.userdataOf(new MyData(111)); - val = LuaValue.userdataOf(new MyData(222)); - key2 = LuaValue.userdataOf(new MyData(333)); - // don't drop val2, or key3 - val3 = LuaValue.userdataOf(new MyData(666)); - - // no values should be reachable after gc - collectGarbage(); - assertEquals( null, origkey.get() ); - assertEquals( null, origval.get() ); - assertEquals( null, origkey2.get() ); - assertEquals( null, origval3.get() ); - assertEquals( LuaValue.NIL, t.get(key) ); - assertEquals( LuaValue.NIL, t.get(key2) ); - assertEquals( LuaValue.NIL, t.get(key3) ); - - // all originals should be gone after gc, then access - val2 = null; - key3 = null; - collectGarbage(); - assertEquals( null, origval2.get() ); - assertEquals( null, origkey3.get() ); - } - - public void testReplace() { - LuaTable t = new WeakTable(true, true); - - LuaValue key = LuaValue.userdataOf(new MyData(111)); - LuaValue val = LuaValue.userdataOf(new MyData(222)); - LuaValue key2 = LuaValue.userdataOf(new MyData(333)); - LuaValue val2 = LuaValue.userdataOf(new MyData(444)); - LuaValue key3 = LuaValue.userdataOf(new MyData(555)); - LuaValue val3 = LuaValue.userdataOf(new MyData(666)); - - // set up the table - t.set( key, val ); - t.set( key2, val2 ); - t.set( key3, val3 ); - - LuaValue val4 = LuaValue.userdataOf(new MyData(777)); - t.set( key2, val4 ); - - // table should have 3 entries - int size = 0; - for ( LuaValue k = t.next(LuaValue.NIL).arg1(); - !k.isnil() && size < 1000; - k = t.next(k).arg1() ) { - size++; - } - assertEquals(3, size); - } - } -} diff --git a/luaj-2.0.3/test/junit/org/luaj/vm2/compiler/AbstractUnitTests.java b/luaj-2.0.3/test/junit/org/luaj/vm2/compiler/AbstractUnitTests.java deleted file mode 100644 index 9695506ae..000000000 --- a/luaj-2.0.3/test/junit/org/luaj/vm2/compiler/AbstractUnitTests.java +++ /dev/null @@ -1,123 +0,0 @@ -package org.luaj.vm2.compiler; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.PrintStream; -import java.net.MalformedURLException; -import java.net.URL; - -import junit.framework.TestCase; - -import org.luaj.vm2.LoadState; -import org.luaj.vm2.LuaTable; -import org.luaj.vm2.Print; -import org.luaj.vm2.Prototype; -import org.luaj.vm2.lib.jse.JsePlatform; - -abstract public class AbstractUnitTests extends TestCase { - - private final String dir; - private final String jar; - private LuaTable _G; - - public AbstractUnitTests(String zipdir, String zipfile, String dir) { - URL zip = null; - zip = getClass().getResource(zipfile); - if ( zip == null ) { - File file = new File(zipdir+"/"+zipfile); - try { - if ( file.exists() ) - zip = file.toURI().toURL(); - } catch (MalformedURLException e) { - e.printStackTrace(); - } - } - if ( zip == null ) - throw new RuntimeException("not found: "+zipfile); - this.jar = "jar:" + zip.toExternalForm()+ "!/"; - this.dir = dir; - } - - protected void setUp() throws Exception { - super.setUp(); - _G = JsePlatform.standardGlobals(); - } - - protected String pathOfFile(String file) { - return jar + dir + "/" + file; - } - - protected InputStream inputStreamOfPath(String path) throws IOException { - URL url = new URL(path); - return url.openStream(); - } - - protected InputStream inputStreamOfFile(String file) throws IOException { - return inputStreamOfPath(pathOfFile(file)); - } - - protected void doTest(String file) { - try { - // load source from jar - String path = pathOfFile(file); - byte[] lua = bytesFromJar(path); - - // compile in memory - InputStream is = new ByteArrayInputStream(lua); - Prototype p = LuaC.instance.compile(is, "@" + file); - String actual = protoToString(p); - - // load expected value from jar - byte[] luac = bytesFromJar(path.substring(0, path.length()-4)+".lc"); - Prototype e = loadFromBytes(luac, file); - String expected = protoToString(e); - - // compare results - assertEquals(expected, actual); - - // dump into memory - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - DumpState.dump(p, baos, false); - byte[] dumped = baos.toByteArray(); - - // re-undump - Prototype p2 = loadFromBytes(dumped, file); - String actual2 = protoToString(p2); - - // compare again - assertEquals(actual, actual2); - - } catch (IOException e) { - fail(e.toString()); - } - } - - protected byte[] bytesFromJar(String path) throws IOException { - InputStream is = inputStreamOfPath(path); - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - byte[] buffer = new byte[2048]; - int n; - while ((n = is.read(buffer)) >= 0) - baos.write(buffer, 0, n); - is.close(); - return baos.toByteArray(); - } - - protected Prototype loadFromBytes(byte[] bytes, String script) - throws IOException { - InputStream is = new ByteArrayInputStream(bytes); - return LoadState.loadBinaryChunk(is.read(), is, script); - } - - protected String protoToString(Prototype p) { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - PrintStream ps = new PrintStream(baos); - Print.ps = ps; - new Print().printFunction(p, true); - return baos.toString(); - } - -} diff --git a/luaj-2.0.3/test/junit/org/luaj/vm2/compiler/CompilerUnitTests.java b/luaj-2.0.3/test/junit/org/luaj/vm2/compiler/CompilerUnitTests.java deleted file mode 100644 index 2def5e54a..000000000 --- a/luaj-2.0.3/test/junit/org/luaj/vm2/compiler/CompilerUnitTests.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.luaj.vm2.compiler; - - - -public class CompilerUnitTests extends AbstractUnitTests { - - public CompilerUnitTests() { - super("test/lua", "luaj2.0-tests.zip", "lua5.1-tests"); - } - - public void testAll() { doTest("all.lua"); } - public void testApi() { doTest("api.lua"); } - public void testAttrib() { doTest("attrib.lua"); } - public void testBig() { doTest("big.lua"); } - public void testCalls() { doTest("calls.lua"); } - public void testChecktable() { doTest("checktable.lua"); } - public void testClosure() { doTest("closure.lua"); } - public void testCode() { doTest("code.lua"); } - public void testConstruct() { doTest("constructs.lua"); } - public void testDb() { doTest("db.lua"); } - public void testErrors() { doTest("errors.lua"); } - public void testEvents() { doTest("events.lua"); } - public void testFiles() { doTest("files.lua"); } - public void testGc() { doTest("gc.lua"); } - public void testLiterals() { doTest("literals.lua"); } - public void testLocals() { doTest("locals.lua"); } - public void testMain() { doTest("main.lua"); } - public void testMath() { doTest("math.lua"); } - public void testNextvar() { doTest("nextvar.lua"); } - public void testPm() { doTest("pm.lua"); } - public void testSort() { doTest("sort.lua"); } - public void testStrings() { doTest("strings.lua"); } - public void testVararg() { doTest("vararg.lua"); } - public void testVerybig() { doTest("verybig.lua"); } -} diff --git a/luaj-2.0.3/test/junit/org/luaj/vm2/compiler/DumpLoadEndianIntTest.java b/luaj-2.0.3/test/junit/org/luaj/vm2/compiler/DumpLoadEndianIntTest.java deleted file mode 100644 index 119d0ea51..000000000 --- a/luaj-2.0.3/test/junit/org/luaj/vm2/compiler/DumpLoadEndianIntTest.java +++ /dev/null @@ -1,135 +0,0 @@ -package org.luaj.vm2.compiler; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; - -import junit.framework.TestCase; - -import org.luaj.vm2.LoadState; -import org.luaj.vm2.LuaClosure; -import org.luaj.vm2.LuaFunction; -import org.luaj.vm2.LuaTable; -import org.luaj.vm2.LuaValue; -import org.luaj.vm2.Prototype; -import org.luaj.vm2.lib.jse.JsePlatform; - - -public class DumpLoadEndianIntTest extends TestCase { - private static final String SAVECHUNKS = "SAVECHUNKS"; - - private static final boolean SHOULDPASS = true; - private static final boolean SHOULDFAIL = false; - private static final String mixedscript = "return tostring(1234)..'-#!-'..tostring(23.75)"; - private static final String intscript = "return tostring(1234)..'-#!-'..tostring(23)"; - private static final String withdoubles = "1234-#!-23.75"; - private static final String withints = "1234-#!-23"; - - private LuaTable _G; - - protected void setUp() throws Exception { - super.setUp(); - _G = JsePlatform.standardGlobals(); - DumpState.ALLOW_INTEGER_CASTING = false; - } - - public void testBigDoubleCompile() { - doTest( false, DumpState.NUMBER_FORMAT_FLOATS_OR_DOUBLES, false, mixedscript, withdoubles, withdoubles, SHOULDPASS ); - doTest( false, DumpState.NUMBER_FORMAT_FLOATS_OR_DOUBLES, true, mixedscript, withdoubles, withdoubles, SHOULDPASS ); - } - - public void testLittleDoubleCompile() { - doTest( true, DumpState.NUMBER_FORMAT_FLOATS_OR_DOUBLES, false, mixedscript, withdoubles, withdoubles, SHOULDPASS ); - doTest( true, DumpState.NUMBER_FORMAT_FLOATS_OR_DOUBLES, true, mixedscript, withdoubles, withdoubles, SHOULDPASS ); - } - - public void testBigIntCompile() { - DumpState.ALLOW_INTEGER_CASTING = true; - doTest( false, DumpState.NUMBER_FORMAT_INTS_ONLY, false, mixedscript, withdoubles, withints, SHOULDPASS ); - doTest( false, DumpState.NUMBER_FORMAT_INTS_ONLY, true, mixedscript, withdoubles, withints, SHOULDPASS ); - DumpState.ALLOW_INTEGER_CASTING = false; - doTest( false, DumpState.NUMBER_FORMAT_INTS_ONLY, false, mixedscript, withdoubles, withints, SHOULDFAIL ); - doTest( false, DumpState.NUMBER_FORMAT_INTS_ONLY, true, mixedscript, withdoubles, withints, SHOULDFAIL ); - doTest( false, DumpState.NUMBER_FORMAT_INTS_ONLY, false, intscript, withints, withints, SHOULDPASS ); - doTest( false, DumpState.NUMBER_FORMAT_INTS_ONLY, true, intscript, withints, withints, SHOULDPASS ); - } - - public void testLittleIntCompile() { - DumpState.ALLOW_INTEGER_CASTING = true; - doTest( true, DumpState.NUMBER_FORMAT_INTS_ONLY, false, mixedscript, withdoubles, withints, SHOULDPASS ); - doTest( true, DumpState.NUMBER_FORMAT_INTS_ONLY, true, mixedscript, withdoubles, withints, SHOULDPASS ); - DumpState.ALLOW_INTEGER_CASTING = false; - doTest( true, DumpState.NUMBER_FORMAT_INTS_ONLY, false, mixedscript, withdoubles, withints, SHOULDFAIL ); - doTest( true, DumpState.NUMBER_FORMAT_INTS_ONLY, true, mixedscript, withdoubles, withints, SHOULDFAIL ); - doTest( true, DumpState.NUMBER_FORMAT_INTS_ONLY, false, intscript, withints, withints, SHOULDPASS ); - doTest( true, DumpState.NUMBER_FORMAT_INTS_ONLY, true, intscript, withints, withints, SHOULDPASS ); - } - - public void testBigNumpatchCompile() { - doTest( false, DumpState.NUMBER_FORMAT_NUM_PATCH_INT32, false, mixedscript, withdoubles, withdoubles, SHOULDPASS ); - doTest( false, DumpState.NUMBER_FORMAT_NUM_PATCH_INT32, true, mixedscript, withdoubles, withdoubles, SHOULDPASS ); - } - - public void testLittleNumpatchCompile() { - doTest( true, DumpState.NUMBER_FORMAT_NUM_PATCH_INT32, false, mixedscript, withdoubles, withdoubles, SHOULDPASS ); - doTest( true, DumpState.NUMBER_FORMAT_NUM_PATCH_INT32, true, mixedscript, withdoubles, withdoubles, SHOULDPASS ); - } - - public void doTest( boolean littleEndian, int numberFormat, boolean stripDebug, - String script, String expectedPriorDump, String expectedPostDump, boolean shouldPass ) { - try { - - // compile into prototype - InputStream is = new ByteArrayInputStream(script.getBytes()); - Prototype p = LuaC.instance.compile(is, "script"); - - // double check script result before dumping - LuaFunction f = new LuaClosure(p, _G); - LuaValue r = f.call(); - String actual = r.tojstring(); - assertEquals( expectedPriorDump, actual ); - - // dump into bytes - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - try { - DumpState.dump(p, baos, stripDebug, numberFormat, littleEndian); - if ( ! shouldPass ) - fail( "dump should not have succeeded" ); - } catch ( Exception e ) { - if ( shouldPass ) - fail( "dump threw "+e ); - else - return; - } - byte[] dumped = baos.toByteArray(); - - // load again using compiler - is = new ByteArrayInputStream(dumped); - f = LoadState.load(is, "dumped", _G); - r = f.call(); - actual = r.tojstring(); - assertEquals( expectedPostDump, actual ); - - // write test chunk - if ( System.getProperty(SAVECHUNKS) != null && script.equals(mixedscript) ) { - new File("build").mkdirs(); - String filename = "build/test-" - +(littleEndian? "little-": "big-") - +(numberFormat==DumpState.NUMBER_FORMAT_FLOATS_OR_DOUBLES? "double-": - numberFormat==DumpState.NUMBER_FORMAT_INTS_ONLY? "int-": - numberFormat==DumpState.NUMBER_FORMAT_NUM_PATCH_INT32? "numpatch4-": "???-") - +(stripDebug? "nodebug-": "debug-") - +"bin.lua"; - FileOutputStream fos = new FileOutputStream(filename); - fos.write( dumped ); - fos.close(); - } - - } catch (IOException e) { - fail(e.toString()); - } - } -} diff --git a/luaj-2.0.3/test/junit/org/luaj/vm2/compiler/RegressionTests.java b/luaj-2.0.3/test/junit/org/luaj/vm2/compiler/RegressionTests.java deleted file mode 100644 index 735b03028..000000000 --- a/luaj-2.0.3/test/junit/org/luaj/vm2/compiler/RegressionTests.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.luaj.vm2.compiler; - -/** - * Framework to add regression tests as problem areas are found. - * - * To add a new regression test: - * 1) run "unpack.sh" in the project root - * 2) add a new "lua" file in the "regressions" subdirectory - * 3) run "repack.sh" in the project root - * 4) add a line to the source file naming the new test - * - * After adding a test, check in the zip file - * rather than the individual regression test files. - * - * @author jrosebor - */ -public class RegressionTests extends AbstractUnitTests { - - public RegressionTests() { - super( "test/lua", "luaj2.0-tests.zip", "regressions" ); - } - - public void testModulo() { doTest("modulo.lua"); } - public void testConstruct() { doTest("construct.lua"); } - public void testBigAttrs() { doTest("bigattr.lua"); } - public void testControlChars() { doTest("controlchars.lua"); } - public void testComparators() { doTest("comparators.lua"); } - public void testMathRandomseed() { doTest("mathrandomseed.lua"); } - public void testVarargs() { doTest("varargs.lua"); } -} diff --git a/luaj-2.0.3/test/junit/org/luaj/vm2/compiler/SimpleTests.java b/luaj-2.0.3/test/junit/org/luaj/vm2/compiler/SimpleTests.java deleted file mode 100644 index e8b2ae1fa..000000000 --- a/luaj-2.0.3/test/junit/org/luaj/vm2/compiler/SimpleTests.java +++ /dev/null @@ -1,101 +0,0 @@ -package org.luaj.vm2.compiler; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; - -import junit.framework.TestCase; - -import org.luaj.vm2.LuaDouble; -import org.luaj.vm2.LuaFunction; -import org.luaj.vm2.LuaInteger; -import org.luaj.vm2.LuaTable; -import org.luaj.vm2.LuaValue; -import org.luaj.vm2.lib.jse.JsePlatform; - -public class SimpleTests extends TestCase { - - private LuaTable _G; - - protected void setUp() throws Exception { - super.setUp(); - _G = JsePlatform.standardGlobals(); - } - - private void doTest( String script ) { - try { - InputStream is = new ByteArrayInputStream( script.getBytes("UTF8") ); - LuaFunction c = LuaC.instance.load( is, "script", _G ); - c.call(); - } catch ( Exception e ) { - fail("i/o exception: "+e ); - } - } - - public void testTrivial() { - String s = "print( 2 )\n"; - doTest( s ); - } - - public void testAlmostTrivial() { - String s = "print( 2 )\n" + - "print( 3 )\n"; - doTest( s ); - } - - public void testSimple() { - String s = "print( 'hello, world' )\n"+ - "for i = 2,4 do\n" + - " print( 'i', i )\n" + - "end\n"; - doTest( s ); - } - - public void testBreak() { - String s = "a=1\n"+ - "while true do\n"+ - " if a>10 then\n"+ - " break\n"+ - " end\n"+ - " a=a+1\n"+ - " print( a )\n"+ - "end\n"; - doTest( s ); - } - - public void testShebang() { - String s = "#!../lua\n"+ - "print( 2 )\n"; - doTest( s ); - } - - public void testInlineTable() { - String s = "A = {g=10}\n"+ - "print( A )\n"; - doTest( s ); - } - - public void testEqualsAnd() { - String s = "print( 1 == b and b )\n"; - doTest( s ); - } - - private static final int [] samehash = { 0, 1, -1, 2, -2, 4, 8, 16, 32, Integer.MAX_VALUE, Integer.MIN_VALUE }; - private static final double [] diffhash = { .5, 1, 1.5, 1, .5, 1.5, 1.25, 2.5 }; - - public void testDoubleHashCode() { - for ( int i=0; i=0 ); - } - - public void testLuaErrorCause() { - String script = "luajava.bindClass( \""+SomeClass.class.getName()+"\"):someMethod()"; - LuaValue chunk = _G.get("loadstring").call(LuaValue.valueOf(script)); - try { - chunk.invoke(LuaValue.NONE); - fail( "call should not have succeeded" ); - } catch ( LuaError lee ) { - Throwable c = lee.getCause(); - assertEquals( SomeException.class, c.getClass() ); - } - } - - public interface VarArgsInterface { - public String varargsMethod( String a, String ... v ); - public String arrayargsMethod( String a, String[] v ); - } - - public void testVarArgsProxy() { - String script = "return luajava.createProxy( \""+VarArgsInterface.class.getName()+"\", \n"+ - "{\n" + - " varargsMethod = function(a,...)\n" + - " return table.concat({a,...},'-')\n" + - " end,\n" + - " arrayargsMethod = function(a,array)\n" + - " return tostring(a)..(array and \n" + - " ('-'..tostring(array.length)\n" + - " ..'-'..tostring(array[1])\n" + - " ..'-'..tostring(array[2])\n" + - " ) or '-nil')\n" + - " end,\n" + - "} )\n"; - Varargs chunk = _G.get("loadstring").call(LuaValue.valueOf(script)); - if ( ! chunk.arg1().toboolean() ) - fail( chunk.arg(2).toString() ); - LuaValue result = chunk.arg1().call(); - Object u = result.touserdata(); - VarArgsInterface v = (VarArgsInterface) u; - assertEquals( "foo", v.varargsMethod("foo") ); - assertEquals( "foo-bar", v.varargsMethod("foo", "bar") ); - assertEquals( "foo-bar-etc", v.varargsMethod("foo", "bar", "etc") ); - assertEquals( "foo-0-nil-nil", v.arrayargsMethod("foo", new String[0]) ); - assertEquals( "foo-1-bar-nil", v.arrayargsMethod("foo", new String[] {"bar"}) ); - assertEquals( "foo-2-bar-etc", v.arrayargsMethod("foo", new String[] {"bar","etc"}) ); - assertEquals( "foo-3-bar-etc", v.arrayargsMethod("foo", new String[] {"bar","etc","etc"}) ); - assertEquals( "foo-nil", v.arrayargsMethod("foo", null) ); - } - - public void testBigNum() { - String script = - "bigNumA = luajava.newInstance('java.math.BigDecimal','12345678901234567890');\n" + - "bigNumB = luajava.newInstance('java.math.BigDecimal','12345678901234567890');\n" + - "bigNumC = bigNumA:multiply(bigNumB);\n" + - //"print(bigNumA:toString())\n" + - //"print(bigNumB:toString())\n" + - //"print(bigNumC:toString())\n" + - "return bigNumA:toString(), bigNumB:toString(), bigNumC:toString()"; - Varargs chunk = _G.get("loadstring").call(LuaValue.valueOf(script)); - if ( ! chunk.arg1().toboolean() ) - fail( chunk.arg(2).toString() ); - Varargs results = chunk.arg1().invoke(); - int nresults = results.narg(); - String sa = results.tojstring(1); - String sb = results.tojstring(2); - String sc = results.tojstring(3); - assertEquals( 3, nresults ); - assertEquals( "12345678901234567890", sa ); - assertEquals( "12345678901234567890", sb ); - assertEquals( "152415787532388367501905199875019052100", sc ); - } - - public interface IA {} - public interface IB extends IA {} - public interface IC extends IB {} - - public static class A implements IA { - } - public static class B extends A implements IB { - public String set( Object x ) { return "set(Object) "; } - public String set( String x ) { return "set(String) "+x; } - public String set( A x ) { return "set(A) "; } - public String set( B x ) { return "set(B) "; } - public String set( C x ) { return "set(C) "; } - public String set( byte x ) { return "set(byte) "+x; } - public String set( char x ) { return "set(char) "+(int)x; } - public String set( short x ) { return "set(short) "+x; } - public String set( int x ) { return "set(int) "+x; } - public String set( long x ) { return "set(long) "+x; } - public String set( float x ) { return "set(float) "+x; } - public String set( double x ) { return "set(double) "+x; } - - public String setr( double x ) { return "setr(double) "+x; } - public String setr( float x ) { return "setr(float) "+x; } - public String setr( long x ) { return "setr(long) "+x; } - public String setr( int x ) { return "setr(int) "+x; } - public String setr( short x ) { return "setr(short) "+x; } - public String setr( char x ) { return "setr(char) "+(int)x; } - public String setr( byte x ) { return "setr(byte) "+x; } - public String setr( C x ) { return "setr(C) "; } - public String setr( B x ) { return "setr(B) "; } - public String setr( A x ) { return "setr(A) "; } - public String setr( String x ) { return "setr(String) "+x; } - public String setr( Object x ) { return "setr(Object) "; } - - public Object getObject() { return new Object(); } - public String getString() { return "abc"; } - public byte[] getbytearray() { return new byte[] { 1, 2, 3 }; } - public A getA() { return new A(); } - public B getB() { return new B(); } - public C getC() { return new C(); } - public byte getbyte() { return 1; } - public char getchar() { return 65000; } - public short getshort() { return -32000; } - public int getint() { return 100000; } - public long getlong() { return 50000000000L; } - public float getfloat() { return 6.5f; } - public double getdouble() { return Math.PI; } - } - public static class C extends B implements IC { - } - public static class D extends C implements IA { - } - - public void testOverloadedJavaMethodObject() { doOverloadedMethodTest( "Object", "" ); } - public void testOverloadedJavaMethodString() { doOverloadedMethodTest( "String", "abc" ); } - public void testOverloadedJavaMethodA() { doOverloadedMethodTest( "A", "" ); } - public void testOverloadedJavaMethodB() { doOverloadedMethodTest( "B", "" ); } - public void testOverloadedJavaMethodC() { doOverloadedMethodTest( "C", "" ); } - public void testOverloadedJavaMethodByte() { doOverloadedMethodTest( "byte", "1" ); } - public void testOverloadedJavaMethodChar() { doOverloadedMethodTest( "char", "65000" ); } - public void testOverloadedJavaMethodShort() { doOverloadedMethodTest( "short", "-32000" ); } - public void testOverloadedJavaMethodInt() { doOverloadedMethodTest( "int", "100000" ); } - public void testOverloadedJavaMethodLong() { doOverloadedMethodTest( "long", "50000000000" ); } - public void testOverloadedJavaMethodFloat() { doOverloadedMethodTest( "float", "6.5" ); } - public void testOverloadedJavaMethodDouble() { doOverloadedMethodTest( "double", "3.141592653589793" ); } - - private void doOverloadedMethodTest( String typename, String value ) { - String script = - "local a = luajava.newInstance('"+B.class.getName()+"');\n" + - "local b = a:set(a:get"+typename+"())\n" + - "local c = a:setr(a:get"+typename+"())\n" + - "return b,c"; - Varargs chunk = _G.get("loadstring").call(LuaValue.valueOf(script)); - if ( ! chunk.arg1().toboolean() ) - fail( chunk.arg(2).toString() ); - Varargs results = chunk.arg1().invoke(); - int nresults = results.narg(); - assertEquals( 2, nresults ); - LuaValue b = results.arg(1); - LuaValue c = results.arg(2); - String sb = b.tojstring(); - String sc = c.tojstring(); - assertEquals( "set("+typename+") "+value, sb ); - assertEquals( "setr("+typename+") "+value, sc ); - } - - public void testClassInheritanceLevels() { - assertEquals( 0, CoerceLuaToJava.inheritanceLevels(Object.class, Object.class) ); - assertEquals( 1, CoerceLuaToJava.inheritanceLevels(Object.class, String.class) ); - assertEquals( 1, CoerceLuaToJava.inheritanceLevels(Object.class, A.class) ); - assertEquals( 2, CoerceLuaToJava.inheritanceLevels(Object.class, B.class) ); - assertEquals( 3, CoerceLuaToJava.inheritanceLevels(Object.class, C.class) ); - - assertEquals( CoerceLuaToJava.SCORE_UNCOERCIBLE, CoerceLuaToJava.inheritanceLevels(A.class, Object.class) ); - assertEquals( CoerceLuaToJava.SCORE_UNCOERCIBLE, CoerceLuaToJava.inheritanceLevels(A.class, String.class) ); - assertEquals( 0, CoerceLuaToJava.inheritanceLevels(A.class, A.class) ); - assertEquals( 1, CoerceLuaToJava.inheritanceLevels(A.class, B.class) ); - assertEquals( 2, CoerceLuaToJava.inheritanceLevels(A.class, C.class) ); - - assertEquals( CoerceLuaToJava.SCORE_UNCOERCIBLE, CoerceLuaToJava.inheritanceLevels(B.class, Object.class) ); - assertEquals( CoerceLuaToJava.SCORE_UNCOERCIBLE, CoerceLuaToJava.inheritanceLevels(B.class, String.class) ); - assertEquals( CoerceLuaToJava.SCORE_UNCOERCIBLE, CoerceLuaToJava.inheritanceLevels(B.class, A.class) ); - assertEquals( 0, CoerceLuaToJava.inheritanceLevels(B.class, B.class) ); - assertEquals( 1, CoerceLuaToJava.inheritanceLevels(B.class, C.class) ); - - assertEquals( CoerceLuaToJava.SCORE_UNCOERCIBLE, CoerceLuaToJava.inheritanceLevels(C.class, Object.class) ); - assertEquals( CoerceLuaToJava.SCORE_UNCOERCIBLE, CoerceLuaToJava.inheritanceLevels(C.class, String.class) ); - assertEquals( CoerceLuaToJava.SCORE_UNCOERCIBLE, CoerceLuaToJava.inheritanceLevels(C.class, A.class) ); - assertEquals( CoerceLuaToJava.SCORE_UNCOERCIBLE, CoerceLuaToJava.inheritanceLevels(C.class, B.class) ); - assertEquals( 0, CoerceLuaToJava.inheritanceLevels(C.class, C.class) ); - } - - public void testInterfaceInheritanceLevels() { - assertEquals( 1, CoerceLuaToJava.inheritanceLevels(IA.class, A.class) ); - assertEquals( 1, CoerceLuaToJava.inheritanceLevels(IB.class, B.class) ); - assertEquals( 2, CoerceLuaToJava.inheritanceLevels(IA.class, B.class) ); - assertEquals( 1, CoerceLuaToJava.inheritanceLevels(IC.class, C.class) ); - assertEquals( 2, CoerceLuaToJava.inheritanceLevels(IB.class, C.class) ); - assertEquals( 3, CoerceLuaToJava.inheritanceLevels(IA.class, C.class) ); - assertEquals( 1, CoerceLuaToJava.inheritanceLevels(IA.class, D.class) ); - assertEquals( 2, CoerceLuaToJava.inheritanceLevels(IC.class, D.class) ); - assertEquals( 3, CoerceLuaToJava.inheritanceLevels(IB.class, D.class) ); - - assertEquals( CoerceLuaToJava.SCORE_UNCOERCIBLE, CoerceLuaToJava.inheritanceLevels(IB.class, A.class) ); - assertEquals( CoerceLuaToJava.SCORE_UNCOERCIBLE, CoerceLuaToJava.inheritanceLevels(IC.class, A.class) ); - assertEquals( CoerceLuaToJava.SCORE_UNCOERCIBLE, CoerceLuaToJava.inheritanceLevels(IC.class, B.class) ); - assertEquals( CoerceLuaToJava.SCORE_UNCOERCIBLE, CoerceLuaToJava.inheritanceLevels(IB.class, IA.class) ); - assertEquals( 1, CoerceLuaToJava.inheritanceLevels(IA.class, IB.class) ); - - } -} - diff --git a/luaj-2.0.3/test/junit/org/luaj/vm2/lib/jse/LuajavaAccessibleMembersTest.java b/luaj-2.0.3/test/junit/org/luaj/vm2/lib/jse/LuajavaAccessibleMembersTest.java deleted file mode 100644 index 1bb2d99cf..000000000 --- a/luaj-2.0.3/test/junit/org/luaj/vm2/lib/jse/LuajavaAccessibleMembersTest.java +++ /dev/null @@ -1,70 +0,0 @@ -package org.luaj.vm2.lib.jse; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.security.Permission; - -import junit.framework.TestCase; - -import org.luaj.vm2.LuaFunction; -import org.luaj.vm2.LuaTable; -import org.luaj.vm2.LuaValue; -import org.luaj.vm2.compiler.LuaC; -import org.luaj.vm2.lib.jse.JsePlatform; - -public class LuajavaAccessibleMembersTest extends TestCase { - - private LuaTable _G; - - protected void setUp() throws Exception { - super.setUp(); - _G = JsePlatform.standardGlobals(); - } - - private String invokeScript(String script) { - try { - InputStream is = new ByteArrayInputStream( script.getBytes("UTF8") ); - LuaFunction c = LuaC.instance.load( is, "script", _G ); - return c.call().tojstring(); - } catch ( Exception e ) { - fail("exception: "+e ); - return "failed"; - } - } - - public void testAccessFromPrivateClassImplementedMethod() { - assertEquals("privateImpl-aaa-interface_method(bar)", invokeScript( - "b = luajava.newInstance('"+TestClass.class.getName()+"');" + - "a = b:create_PrivateImpl('aaa');" + - "return a:interface_method('bar');")); - } - - public void testAccessFromPrivateClassPublicMethod() { - assertEquals("privateImpl-aaa-public_method", invokeScript( - "b = luajava.newInstance('"+TestClass.class.getName()+"');" + - "a = b:create_PrivateImpl('aaa');" + - "return a:public_method();")); - } - - public void testAccessFromPrivateClassGetPublicField() { - assertEquals("aaa", invokeScript( - "b = luajava.newInstance('"+TestClass.class.getName()+"');" + - "a = b:create_PrivateImpl('aaa');" + - "return a.public_field;")); - } - - public void testAccessFromPrivateClassSetPublicField() { - assertEquals("foo", invokeScript( - "b = luajava.newInstance('"+TestClass.class.getName()+"');" + - "a = b:create_PrivateImpl('aaa');" + - "a.public_field = 'foo';" + - "return a.public_field;")); - } - - public void testAccessFromPrivateClassPublicConcstructor() { - assertEquals("privateImpl-constructor", invokeScript( - "b = luajava.newInstance('"+TestClass.class.getName()+"');" + - "c = b:get_PrivateImplClass();" + - "return luajava.new(c);")); - } -} diff --git a/luaj-2.0.3/test/junit/org/luaj/vm2/lib/jse/LuajavaClassMembersTest.java b/luaj-2.0.3/test/junit/org/luaj/vm2/lib/jse/LuajavaClassMembersTest.java deleted file mode 100644 index 0af23eb18..000000000 --- a/luaj-2.0.3/test/junit/org/luaj/vm2/lib/jse/LuajavaClassMembersTest.java +++ /dev/null @@ -1,226 +0,0 @@ -package org.luaj.vm2.lib.jse; - -import junit.framework.TestCase; - -import org.luaj.vm2.LuaError; -import org.luaj.vm2.LuaValue; - -public class LuajavaClassMembersTest extends TestCase { - public static class A { - protected A() {} - } - public static class B extends A { - public byte m_byte_field; - public int m_int_field; - public double m_double_field; - public String m_string_field; - - protected B() {} - public B(int i) { m_int_field = i; } - - public String setString( String x ) { return "setString(String) "+x; } - public String getString() { return "abc"; } - public int getint() { return 100000; } - - public String uniq() { return "uniq()"; } - public String uniqs(String s) { return "uniqs(string:"+s+")"; } - public String uniqi(int i) { return "uniqi(int:"+i+")"; } - public String uniqsi(String s, int i) { return "uniqsi(string:"+s+",int:"+i+")"; } - public String uniqis(int i, String s) { return "uniqis(int:"+i+",string:"+s+")"; } - - public String pick() { return "pick()"; } - public String pick(String s) { return "pick(string:"+s+")"; } - public String pick(int i) { return "pick(int:"+i+")"; } - public String pick(String s, int i) { return "pick(string:"+s+",int:"+i+")"; } - public String pick(int i, String s) { return "pick(int:"+i+",string:"+s+")"; } - - public static String staticpick() { return "static-pick()"; } - public static String staticpick(String s) { return "static-pick(string:"+s+")"; } - public static String staticpick(int i) { return "static-pick(int:"+i+")"; } - public static String staticpick(String s, int i) { return "static-pick(string:"+s+",int:"+i+")"; } - public static String staticpick(int i, String s) { return "static-pick(int:"+i+",string:"+s+")"; } - } - public static class C extends B { - public C() {} - public C(String s) { m_string_field = s; } - public C(int i) { m_int_field = i; } - public C(String s, int i) { m_string_field = s; m_int_field = i; } - public int getint() { return 200000; } - - public String pick(String s) { return "class-c-pick(string:"+s+")"; } - public String pick(int i) { return "class-c-pick(int:"+i+")"; } - } - - static LuaValue ZERO = LuaValue.ZERO; - static LuaValue ONE = LuaValue.ONE; - static LuaValue PI = LuaValue.valueOf(Math.PI); - static LuaValue THREE = LuaValue.valueOf(3); - static LuaValue NUMS = LuaValue.valueOf(123); - static LuaValue ABC = LuaValue.valueOf("abc"); - static LuaValue SOMEA = CoerceJavaToLua.coerce(new A()); - static LuaValue SOMEB = CoerceJavaToLua.coerce(new B()); - static LuaValue SOMEC = CoerceJavaToLua.coerce(new C()); - - public void testSetByteField() { - B b = new B(); - JavaInstance i = new JavaInstance(b); - i.set("m_byte_field", ONE ); assertEquals( 1, b.m_byte_field ); assertEquals( ONE, i.get("m_byte_field") ); - i.set("m_byte_field", PI ); assertEquals( 3, b.m_byte_field ); assertEquals( THREE, i.get("m_byte_field") ); - i.set("m_byte_field", ABC ); assertEquals( 0, b.m_byte_field ); assertEquals( ZERO, i.get("m_byte_field") ); - } - public void testSetDoubleField() { - B b = new B(); - JavaInstance i = new JavaInstance(b); - i.set("m_double_field", ONE ); assertEquals( 1., b.m_double_field ); assertEquals( ONE, i.get("m_double_field") ); - i.set("m_double_field", PI ); assertEquals( Math.PI, b.m_double_field ); assertEquals( PI, i.get("m_double_field") ); - i.set("m_double_field", ABC ); assertEquals( 0., b.m_double_field ); assertEquals( ZERO, i.get("m_double_field") ); - } - public void testNoFactory() { - JavaClass c = JavaClass.forClass(A.class); - try { - c.call(); - fail( "did not throw lua error as expected" ); - } catch ( LuaError e ) { - } - } - public void testUniqueFactoryCoercible() { - JavaClass c = JavaClass.forClass(B.class); - assertEquals( JavaClass.class, c.getClass() ); - LuaValue constr = c.get("new"); - assertEquals( JavaConstructor.class, constr.getClass() ); - LuaValue v = constr.call(NUMS); - Object b = v.touserdata(); - assertEquals( B.class, b.getClass() ); - assertEquals( 123, ((B)b).m_int_field ); - Object b0 = constr.call().touserdata(); - assertEquals( B.class, b0.getClass() ); - assertEquals( 0, ((B)b0).m_int_field ); - } - public void testUniqueFactoryUncoercible() { - JavaClass f = JavaClass.forClass(B.class); - LuaValue constr = f.get("new"); - assertEquals( JavaConstructor.class, constr.getClass() ); - try { - LuaValue v = constr.call(LuaValue.userdataOf(new Object())); - Object b = v.touserdata(); - // fail( "did not throw lua error as expected" ); - assertEquals( 0, ((B)b).m_int_field ); - } catch ( LuaError e ) { - } - } - public void testOverloadedFactoryCoercible() { - JavaClass f = JavaClass.forClass(C.class); - LuaValue constr = f.get("new"); - assertEquals( JavaConstructor.Overload.class, constr.getClass() ); - Object c = constr.call().touserdata(); - Object ci = constr.call(LuaValue.valueOf(123)).touserdata(); - Object cs = constr.call(LuaValue.valueOf("abc")).touserdata(); - Object csi = constr.call( LuaValue.valueOf("def"), LuaValue.valueOf(456) ).touserdata(); - assertEquals( C.class, c.getClass() ); - assertEquals( C.class, ci.getClass() ); - assertEquals( C.class, cs.getClass() ); - assertEquals( C.class, csi.getClass() ); - assertEquals( null, ((C)c).m_string_field ); - assertEquals( 0, ((C)c).m_int_field ); - assertEquals( "abc", ((C)cs).m_string_field ); - assertEquals( 0, ((C)cs).m_int_field ); - assertEquals( null, ((C)ci).m_string_field ); - assertEquals( 123, ((C)ci).m_int_field ); - assertEquals( "def", ((C)csi).m_string_field ); - assertEquals( 456, ((C)csi).m_int_field ); - } - public void testOverloadedFactoryUncoercible() { - JavaClass f = JavaClass.forClass(C.class); - try { - Object c = f.call(LuaValue.userdataOf(new Object())); - // fail( "did not throw lua error as expected" ); - assertEquals( 0, ((C)c).m_int_field ); - assertEquals( null, ((C)c).m_string_field ); - } catch ( LuaError e ) { - } - } - - public void testNoAttribute() { - JavaClass f = JavaClass.forClass(A.class); - LuaValue v = f.get("bogus"); - assertEquals( v, LuaValue.NIL ); - try { - f.set("bogus",ONE); - fail( "did not throw lua error as expected" ); - } catch ( LuaError e ) {} - } - public void testFieldAttributeCoercible() { - JavaInstance i = new JavaInstance(new B()); - i.set("m_int_field", ONE ); assertEquals( 1, i.get("m_int_field").toint() ); - i.set("m_int_field", THREE ); assertEquals( 3, i.get("m_int_field").toint() ); - i = new JavaInstance(new C()); - i.set("m_int_field", ONE ); assertEquals( 1, i.get("m_int_field").toint() ); - i.set("m_int_field", THREE ); assertEquals( 3, i.get("m_int_field").toint() ); - } - public void testUniqueMethodAttributeCoercible() { - B b = new B(); - JavaInstance ib = new JavaInstance(b); - LuaValue b_getString = ib.get("getString"); - LuaValue b_getint = ib.get("getint"); - assertEquals( JavaMethod.class, b_getString.getClass() ); - assertEquals( JavaMethod.class, b_getint.getClass() ); - assertEquals( "abc", b_getString.call(SOMEB).tojstring() ); - assertEquals( 100000, b_getint.call(SOMEB).toint()); - assertEquals( "abc", b_getString.call(SOMEC).tojstring() ); - assertEquals( 200000, b_getint.call(SOMEC).toint()); - } - public void testUniqueMethodAttributeArgsCoercible() { - B b = new B(); - JavaInstance ib = new JavaInstance(b); - LuaValue uniq = ib.get("uniq"); - LuaValue uniqs = ib.get("uniqs"); - LuaValue uniqi = ib.get("uniqi"); - LuaValue uniqsi = ib.get("uniqsi"); - LuaValue uniqis = ib.get("uniqis"); - assertEquals( JavaMethod.class, uniq.getClass() ); - assertEquals( JavaMethod.class, uniqs.getClass() ); - assertEquals( JavaMethod.class, uniqi.getClass() ); - assertEquals( JavaMethod.class, uniqsi.getClass() ); - assertEquals( JavaMethod.class, uniqis.getClass() ); - assertEquals( "uniq()", uniq.call(SOMEB).tojstring() ); - assertEquals( "uniqs(string:abc)", uniqs.call(SOMEB,ABC).tojstring() ); - assertEquals( "uniqi(int:1)", uniqi.call(SOMEB,ONE).tojstring() ); - assertEquals( "uniqsi(string:abc,int:1)", uniqsi.call(SOMEB,ABC,ONE).tojstring() ); - assertEquals( "uniqis(int:1,string:abc)", uniqis.call(SOMEB,ONE,ABC).tojstring() ); - assertEquals( "uniqis(int:1,string:abc)", uniqis.invoke(LuaValue.varargsOf(new LuaValue[] {SOMEB,ONE,ABC,ONE})).arg1().tojstring() ); - } - public void testOverloadedMethodAttributeCoercible() { - B b = new B(); - JavaInstance ib = new JavaInstance(b); - LuaValue p = ib.get("pick"); - assertEquals( "pick()", p.call(SOMEB).tojstring() ); - assertEquals( "pick(string:abc)", p.call(SOMEB,ABC).tojstring() ); - assertEquals( "pick(int:1)", p.call(SOMEB,ONE).tojstring() ); - assertEquals( "pick(string:abc,int:1)", p.call(SOMEB,ABC,ONE).tojstring() ); - assertEquals( "pick(int:1,string:abc)", p.call(SOMEB,ONE,ABC).tojstring() ); - assertEquals( "pick(int:1,string:abc)", p.invoke(LuaValue.varargsOf(new LuaValue[] {SOMEB,ONE,ABC,ONE})).arg1().tojstring() ); - } - public void testUnboundOverloadedMethodAttributeCoercible() { - B b = new B(); - JavaInstance ib = new JavaInstance(b); - LuaValue p = ib.get("pick"); - assertEquals( JavaMethod.Overload.class, p.getClass() ); - assertEquals( "pick()", p.call(SOMEC).tojstring() ); - assertEquals( "class-c-pick(string:abc)", p.call(SOMEC,ABC).tojstring() ); - assertEquals( "class-c-pick(int:1)", p.call(SOMEC,ONE).tojstring() ); - assertEquals( "pick(string:abc,int:1)", p.call(SOMEC,ABC,ONE).tojstring() ); - assertEquals( "pick(int:1,string:abc)", p.call(SOMEC,ONE,ABC).tojstring() ); - assertEquals( "pick(int:1,string:abc)", p.invoke(LuaValue.varargsOf(new LuaValue[] {SOMEC,ONE,ABC,ONE})).arg1().tojstring() ); - } - public void testOverloadedStaticMethodAttributeCoercible() { - B b = new B(); - JavaInstance ib = new JavaInstance(b); - LuaValue p = ib.get("staticpick"); - assertEquals( "static-pick()", p.call(SOMEB).tojstring() ); - assertEquals( "static-pick(string:abc)", p.call(SOMEB,ABC).tojstring() ); - assertEquals( "static-pick(int:1)", p.call(SOMEB,ONE).tojstring() ); - assertEquals( "static-pick(string:abc,int:1)", p.call(SOMEB,ABC,ONE).tojstring() ); - assertEquals( "static-pick(int:1,string:abc)", p.call(SOMEB,ONE,ABC).tojstring() ); - assertEquals( "static-pick(int:1,string:abc)", p.invoke(LuaValue.varargsOf(new LuaValue[] {SOMEB,ONE,ABC,ONE})).arg1().tojstring() ); - } -} diff --git a/luaj-2.0.3/test/junit/org/luaj/vm2/lib/jse/TestClass.java b/luaj-2.0.3/test/junit/org/luaj/vm2/lib/jse/TestClass.java deleted file mode 100644 index 28cb7386c..000000000 --- a/luaj-2.0.3/test/junit/org/luaj/vm2/lib/jse/TestClass.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.luaj.vm2.lib.jse; - -public class TestClass { - private static class PrivateImpl implements TestInterface { - public String public_field; - public PrivateImpl() { - this.public_field = "privateImpl-constructor"; - } - PrivateImpl(String f) { - this.public_field = f; - } - public String public_method() { return "privateImpl-"+public_field+"-public_method"; } - public String interface_method(String x) { return "privateImpl-"+public_field+"-interface_method("+x+")"; } - public String toString() { return public_field; } - } - public TestInterface create_PrivateImpl(String f) { return new PrivateImpl(f); } - public Class get_PrivateImplClass() { return PrivateImpl.class; } -} \ No newline at end of file diff --git a/luaj-2.0.3/test/junit/org/luaj/vm2/lib/jse/TestInterface.java b/luaj-2.0.3/test/junit/org/luaj/vm2/lib/jse/TestInterface.java deleted file mode 100644 index 1b58a0a51..000000000 --- a/luaj-2.0.3/test/junit/org/luaj/vm2/lib/jse/TestInterface.java +++ /dev/null @@ -1,5 +0,0 @@ -package org.luaj.vm2.lib.jse; - -public interface TestInterface { - String interface_method(String x); -} \ No newline at end of file diff --git a/luaj-2.0.3/test/junit/org/luaj/vm2/require/RequireSampleClassCastExcep.java b/luaj-2.0.3/test/junit/org/luaj/vm2/require/RequireSampleClassCastExcep.java deleted file mode 100644 index 88ba21f6f..000000000 --- a/luaj-2.0.3/test/junit/org/luaj/vm2/require/RequireSampleClassCastExcep.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.luaj.vm2.require; - -import org.luaj.vm2.LuaValue; - -/** - * This should fail while trying to load via "require() because it is not a LibFunction" - * - */ -public class RequireSampleClassCastExcep { - - public RequireSampleClassCastExcep() { - } - - public LuaValue call() { - return LuaValue.valueOf("require-sample-class-cast-excep"); - } -} diff --git a/luaj-2.0.3/test/junit/org/luaj/vm2/require/RequireSampleLoadLuaError.java b/luaj-2.0.3/test/junit/org/luaj/vm2/require/RequireSampleLoadLuaError.java deleted file mode 100644 index 0ba5e1480..000000000 --- a/luaj-2.0.3/test/junit/org/luaj/vm2/require/RequireSampleLoadLuaError.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.luaj.vm2.require; - -import org.luaj.vm2.LuaValue; -import org.luaj.vm2.lib.ZeroArgFunction; - -/** - * This should fail while trying to load via - * "require()" because it throws a LuaError - * - */ -public class RequireSampleLoadLuaError extends ZeroArgFunction { - - public RequireSampleLoadLuaError() { - } - - public LuaValue call() { - error("sample-load-lua-error"); - return LuaValue.valueOf("require-sample-load-lua-error"); - } -} diff --git a/luaj-2.0.3/test/junit/org/luaj/vm2/require/RequireSampleLoadRuntimeExcep.java b/luaj-2.0.3/test/junit/org/luaj/vm2/require/RequireSampleLoadRuntimeExcep.java deleted file mode 100644 index 1f416b893..000000000 --- a/luaj-2.0.3/test/junit/org/luaj/vm2/require/RequireSampleLoadRuntimeExcep.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.luaj.vm2.require; - -import org.luaj.vm2.LuaValue; -import org.luaj.vm2.lib.ZeroArgFunction; - -/** -* This should fail while trying to load via "require()" because it throws a RuntimeException - * - */ -public class RequireSampleLoadRuntimeExcep extends ZeroArgFunction { - - public RequireSampleLoadRuntimeExcep() { - } - - public LuaValue call() { - throw new RuntimeException("sample-load-runtime-exception"); - } -} diff --git a/luaj-2.0.3/test/junit/org/luaj/vm2/require/RequireSampleSuccess.java b/luaj-2.0.3/test/junit/org/luaj/vm2/require/RequireSampleSuccess.java deleted file mode 100644 index edd0c549e..000000000 --- a/luaj-2.0.3/test/junit/org/luaj/vm2/require/RequireSampleSuccess.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.luaj.vm2.require; - -import org.luaj.vm2.LuaValue; -import org.luaj.vm2.lib.ZeroArgFunction; - -/** - * This should succeed as a library that can be loaded dynamically via "require()" - */ -public class RequireSampleSuccess extends ZeroArgFunction { - - public RequireSampleSuccess() { - } - - public LuaValue call() { - return LuaValue.valueOf("require-sample-success"); - } -} diff --git a/luaj-2.0.3/test/lua/baselib.lua b/luaj-2.0.3/test/lua/baselib.lua deleted file mode 100644 index dae00527d..000000000 --- a/luaj-2.0.3/test/lua/baselib.lua +++ /dev/null @@ -1,312 +0,0 @@ - --- tostring replacement that assigns ids -local ts,id,nid,types = tostring,{},0,{table='tbl',thread='thr',userdata='uda',['function']='func'} -tostring = function(x) - if not x or not types[type(x)] then return ts(x) end - if not id[x] then nid=nid+1; id[x]=types[type(x)]..'.'..nid end - return id[x] -end - --- wrap pcall to return one result --- error message are tested elsewhere -local pc = pcall -local pcall = function(...) - local s,e = pc(...) - if s then return e end - return false, type(e) -end - --- print -print() -print(11) -print("abc",123,nil,"pqr") -print( nil and 'T' or 'F' ) -print( false and 'T' or 'F' ) -print( 0 and 'T' or 'F' ) - --- assert -print( 'assert(true)', assert(true) ) -print( 'pcall(assert,true)', pcall(assert,true) ) -print( 'pcall(assert,false)', pcall(assert,false) ) -print( 'pcall(assert,nil)', pcall(assert,nil) ) -print( 'pcall(assert,true,"msg")', pcall(assert,true,"msg") ) -print( 'pcall(assert,false,"msg")', pcall(assert,false,"msg") ) -print( 'pcall(assert,nil,"msg")', pcall(assert,nil,"msg") ) -print( 'pcall(assert,false,"msg","msg2")', pcall(assert,false,"msg","msg2") ) - --- collectgarbage (not supported) -print( 'collectgarbage("count")', type(collectgarbage("count"))) -print( 'collectgarbage("collect")', type(collectgarbage("collect"))) -print( 'collectgarbage("count")', type(collectgarbage("count"))) - --- dofile (not supported) --- ipairs -print( 'pcall(ipairs)', pcall(ipairs) ) -print( 'pcall(ipairs,nil)', pcall(ipairs,nil) ) -print( 'pcall(ipairs,"a")', pcall(ipairs,"a") ) -print( 'pcall(ipairs,1)', pcall(ipairs,1) ) -for k,v in ipairs({}) do print('ipairs1',k,v)end -for k,v in ipairs({'one','two'}) do print('ipairs2',k,v)end -for k,v in ipairs({aa='aaa',bb='bbb'}) do print('ipairs3',k,v)end -for k,v in ipairs({aa='aaa',bb='bbb','one','two'}) do print('ipairs4',k,v)end -for k,v in ipairs({[30]='30',[20]='20'}) do print('ipairs5',k,v)end - --- load -t = { "print ", "'table ", "loaded'", "", " print'after empty string'" } -i = 0 -f = function() i = i + 1; return t[i]; end -c,e = load(f) -if c then print('load: ', pcall(c)) else print('load failed:', e) end - --- loadfile --- loadstring -local lst = "print(3+4); return 8" -local chunk, err = loadstring( lst ) -print( 'loadstring("'..lst..'")', chunk, err ) -print( 'loadstring("'..lst..'")()', chunk() ) - --- pairs -print( 'pcall(pairs)', pcall(pairs) ) -print( 'pcall(pairs,nil)', pcall(pairs,nil) ) -print( 'pcall(pairs,"a")', pcall(pairs,"a") ) -print( 'pcall(pairs,1)', pcall(pairs,1) ) -for k,v in pairs({}) do print('pairs1',k,v)end -for k,v in pairs({'one','two'}) do print('pairs2',k,v)end -for k,v in pairs({aa='aaa',bb='bbb'}) do print('pairs3',k,v)end -for k,v in pairs({aa='aaa',bb='bbb','one','two'}) do print('pairs4',k,v)end -for k,v in pairs({[20]='30',[30]='20'}) do print('pairs5',k,v)end - --- _G -print( '_G["abc"] (before)', _G["abc"] ) -abc='def' -print( '_G["abc"] (after)', _G["abc"] ) - --- type -print( 'type(nil)', type(nil) ) -print( 'type("a")', type("a") ) -print( 'type(1)', type(1) ) -print( 'type(1.5)', type(1.5) ) -print( 'type(function() end)', type(function() end) ) -print( 'type({})', type({}) ) -print( 'type(true)', type(true) ) -print( 'type(false)', type(false) ) -print( 'pcall(type,type)', pcall(type,type) ) -print( 'pcall(type)', pcall(type) ) -print( '(function() return pcall(type) end)()', (function() return pcall(type) end)() ) -local function la() return pcall(type) end -print( 'la()', la() ) -function ga() return pcall(type) end -print( 'ga()', ga() ) - --- getfenv, setfenv: tested in setfenv.lua --- getmetatable, setmetatable -ta = { aa1="aaa1", aa2="aaa2" } -tb = { bb1="bbb1", bb2="bbb2" } -print( 'getmetatable(ta)', getmetatable(ta) ) -print( 'getmetatable(tb)', getmetatable(tb) ) -print( 'setmetatable(ta),{cc1="ccc1"}', type( setmetatable(ta,{cc1="ccc1"}) ) ) -print( 'setmetatable(tb),{dd1="ddd1"}', type( setmetatable(tb,{dd1="ddd1"}) ) ) -print( 'getmetatable(ta)["cc1"]', getmetatable(ta)["cc1"] ) -print( 'getmetatable(tb)["dd1"]', getmetatable(tb)["dd1"] ) -print( 'getmetatable(1)', getmetatable(1) ) -print( 'pcall(setmetatable,1)', pcall(setmetatable,1) ) -print( 'pcall(setmetatable,nil)', pcall(setmetatable,nil) ) -print( 'pcall(setmetatable,"ABC")', pcall(setmetatable,"ABC") ) -print( 'pcall(setmetatable,function() end)', pcall(setmetatable,function() end) ) - --- rawget,rawset -local mt = {aa="aaa", bb="bbb"} -mt.__index = mt -mt.__newindex = mt -local s = {cc="ccc", dd="ddd", } -local t = {cc="ccc", dd="ddd"} -setmetatable(t,mt) -print( 'pcall(rawget)', pcall(rawget)) -print( 'pcall(rawget,"a")', pcall(rawget,"a")) -print( 'pcall(rawget,s)', pcall(rawget,s)) -print( 'pcall(rawget,t)', pcall(rawget,t)) - -function printtables() - function printtable(name,t) - print( ' '..name, t["aa"], t["bb"], t["cc"], t["dd"], t["ee"], t["ff"], t["gg"] ) - print( ' '..name, - rawget(t,"aa"), - rawget(t,"bb"), - rawget(t,"cc"), - rawget(t,"dd"), - rawget(t,"ee"), - rawget(t,"ff"), - rawget(t,"gg") ) - end - printtable( 's', s ) - printtable( 't', t ) - printtable( 'mt', mt ) -end -printtables() -print( 'pcall(rawset,s,"aa","www")', rawset(s,"aa","www")) -printtables() -print( 'pcall(rawset,s,"cc","xxx")', rawset(s,"cc","xxx")) -printtables() -print( 'pcall(rawset,t,"aa","yyy")', rawset(t,"aa","yyy")) -printtables() -print( 'pcall(rawset,t,"dd","zzz")', rawset(t,"dd","zzz")) -printtables() - -printtables() -print( 's["ee"]="ppp"' ); s["ee"]="ppp" -printtables() -print( 's["cc"]="qqq"' ); s["cc"]="qqq" -printtables() -print( 't["ff"]="rrr"' ); t["ff"]="rrr" -printtables() -print( 't["dd"]="sss"' ); t["dd"]="sss" -printtables() -print( 'mt["gg"]="ttt"' ); mt["gg"]="ttt" -printtables() - - --- select -print( 'pcall(select)', pcall(select) ) -print( 'select(1,11,22,33,44,55)', select(1,11,22,33,44,55) ) -print( 'select(2,11,22,33,44,55)', select(2,11,22,33,44,55) ) -print( 'select(3,11,22,33,44,55)', select(3,11,22,33,44,55) ) -print( 'select(4,11,22,33,44,55)', select(4,11,22,33,44,55) ) -print( 'pcall(select,5,11,22,33,44,55)', pcall(select,5,11,22,33,44,55) ) -print( 'pcall(select,6,11,22,33,44,55)', pcall(select,6,11,22,33,44,55) ) -print( 'pcall(select,7,11,22,33,44,55)', pcall(select,7,11,22,33,44,55) ) -print( 'pcall(select,0,11,22,33,44,55)', pcall(select,0,11,22,33,44,55) ) -print( 'pcall(select,-1,11,22,33,44,55)', pcall(select,-1,11,22,33,44,55) ) -print( 'pcall(select,-2,11,22,33,44,55)', pcall(select,-2,11,22,33,44,55) ) -print( 'pcall(select,-4,11,22,33,44,55)', pcall(select,-4,11,22,33,44,55) ) -print( 'pcall(select,-5,11,22,33,44,55)', pcall(select,-5,11,22,33,44,55) ) -print( 'pcall(select,-6,11,22,33,44,55)', pcall(select,-6,11,22,33,44,55) ) -print( 'pcall(select,1)', pcall(select,1) ) -print( 'pcall(select,select)', pcall(select,select) ) -print( 'pcall(select,{})', pcall(select,{}) ) -print( 'pcall(select,"2",11,22,33)', pcall(select,"2",11,22,33) ) -print( 'pcall(select,"abc",11,22,33)', pcall(select,"abc",11,22,33) ) - - --- tonumber -print( 'pcall(tonumber)', pcall(tostring) ) -print( 'pcall(tonumber,nil)', pcall(tonumber,nil) ) -print( 'pcall(tonumber,"abc")', pcall(tonumber,"abc") ) -print( 'pcall(tonumber,"123")', pcall(tonumber,"123") ) -print( 'pcall(tonumber,"123",10)', pcall(tonumber,"123", 10) ) -print( 'pcall(tonumber,"123",8)', pcall(tonumber,"123", 8) ) -print( 'pcall(tonumber,"123",6)', pcall(tonumber,"123", 6) ) -print( 'pcall(tonumber,"10101",4)', pcall(tonumber,"10101", 4) ) -print( 'pcall(tonumber,"10101",3)', pcall(tonumber,"10101", 3) ) -print( 'pcall(tonumber,"10101",2)', pcall(tonumber,"10101", 2) ) -print( 'pcall(tonumber,"1a1",16)', pcall(tonumber,"1a1", 16) ) -print( 'pcall(tonumber,"1a1",32)', pcall(tonumber,"1a1", 32) ) -print( 'pcall(tonumber,"1a1",54)', pcall(tonumber,"1a1", 54) ) -print( 'pcall(tonumber,"1a1",1)', pcall(tonumber,"1a1", 1) ) -print( 'pcall(tonumber,"1a1",0)', pcall(tonumber,"1a1", 0) ) -print( 'pcall(tonumber,"1a1",-1)', pcall(tonumber,"1a1", -1) ) -print( 'pcall(tonumber,"1a1","32")', pcall(tonumber,"1a1", "32") ) -print( 'pcall(tonumber,"123","456")', pcall(tonumber,"123","456") ) -print( 'pcall(tonumber,"1a1",10)', pcall(tonumber,"1a1", 10) ) -print( 'pcall(tonumber,"151",4)', pcall(tonumber,"151", 4) ) -print( 'pcall(tonumber,"151",3)', pcall(tonumber,"151", 3) ) -print( 'pcall(tonumber,"151",2)', pcall(tonumber,"151", 2) ) -print( 'pcall(tonumber,"123",8,8)', pcall(tonumber,"123", 8, 8) ) -print( 'pcall(tonumber,123)', pcall(tonumber,123) ) -print( 'pcall(tonumber,true)', pcall(tonumber,true) ) -print( 'pcall(tonumber,false)', pcall(tonumber,false) ) -print( 'pcall(tonumber,tonumber)', pcall(tonumber,tonumber) ) -print( 'pcall(tonumber,function() end)', pcall(tonumber,function() end) ) -print( 'pcall(tonumber,{"one","two",a="aa",b="bb"})', pcall(tonumber,{"one","two",a="aa",b="bb"}) ) -print( 'pcall(tonumber,"123.456")', pcall(tonumber,"123.456") ) -print( 'pcall(tonumber," 123.456")', pcall(tonumber," 123.456") ) -print( 'pcall(tonumber," 234qwer")', pcall(tonumber," 234qwer") ) -print( 'pcall(tonumber,"0x20")', pcall(tonumber,"0x20") ) -print( 'pcall(tonumber," 0x20")', pcall(tonumber," 0x20") ) -print( 'pcall(tonumber,"0x20 ")', pcall(tonumber,"0x20 ") ) -print( 'pcall(tonumber," 0x20 ")', pcall(tonumber," 0x20 ") ) -print( 'pcall(tonumber,"0X20")', pcall(tonumber,"0X20") ) -print( 'pcall(tonumber," 0X20")', pcall(tonumber," 0X20") ) -print( 'pcall(tonumber,"0X20 ")', pcall(tonumber,"0X20 ") ) -print( 'pcall(tonumber," 0X20 ")', pcall(tonumber," 0X20 ") ) -print( 'pcall(tonumber,"0x20",10)', pcall(tonumber,"0x20",10) ) -print( 'pcall(tonumber,"0x20",16)', pcall(tonumber,"0x20",16) ) -print( 'pcall(tonumber,"0x20",8)', pcall(tonumber,"0x20",8) ) - --- tostring -print( 'pcall(tostring)', pcall(tostring) ) -print( 'pcall(tostring,nil)', pcall(tostring,nil) ) -print( 'pcall(tostring,"abc")', pcall(tostring,"abc") ) -print( 'pcall(tostring,"abc","def")', pcall(tostring,"abc","def") ) -print( 'pcall(tostring,123)', pcall(tostring,123) ) -print( 'pcall(tostring,true)', pcall(tostring,true) ) -print( 'pcall(tostring,false)', pcall(tostring,false) ) -print( 'tostring(tostring)', type(tostring(tostring)) ) -print( 'tostring(function() end)', type(tostring(function() end)) ) -print( 'tostring({"one","two",a="aa",b="bb"})', type(tostring({"one","two",a="aa",b="bb"})) ) - --- unpack -print( 'pcall(unpack)', pcall(unpack) ); -print( 'pcall(unpack,nil)', pcall(unpack,nil) ); -print( 'pcall(unpack,"abc")', pcall(unpack,"abc") ); -print( 'pcall(unpack,1)', pcall(unpack,1) ); -print( 'unpack({"aa"})', unpack({"aa"}) ); -print( 'unpack({"aa","bb"})', unpack({"aa","bb"}) ); -print( 'unpack({"aa","bb","cc"})', unpack({"aa","bb","cc"}) ); -local t = {"aa","bb","cc","dd","ee","ff"} -print( 'pcall(unpack,t)', pcall(unpack,t) ); -print( 'pcall(unpack,t,2)', pcall(unpack,t,2) ); -print( 'pcall(unpack,t,2,5)', pcall(unpack,t,2,5) ); -print( 'pcall(unpack,t,2,6)', pcall(unpack,t,2,6) ); -print( 'pcall(unpack,t,2,7)', pcall(unpack,t,2,7) ); -print( 'pcall(unpack,t,1)', pcall(unpack,t,1) ); -print( 'pcall(unpack,t,1,5)', pcall(unpack,t,1,5) ); -print( 'pcall(unpack,t,1,6)', pcall(unpack,t,1,6) ); -print( 'pcall(unpack,t,1,7)', pcall(unpack,t,1,7) ); -print( 'pcall(unpack,t,0)', pcall(unpack,t,0) ); -print( 'pcall(unpack,t,0,5)', pcall(unpack,t,0,5) ); -print( 'pcall(unpack,t,0,6)', pcall(unpack,t,0,6) ); -print( 'pcall(unpack,t,0,7)', pcall(unpack,t,0,7) ); -print( 'pcall(unpack,t,-1)', pcall(unpack,t,-1) ); -print( 'pcall(unpack,t,-1,5)', pcall(unpack,t,-1,5) ); -print( 'pcall(unpack,t,-1,6)', pcall(unpack,t,-1,6) ); -print( 'pcall(unpack,t,-1,7)', pcall(unpack,t,-1,7) ); -print( 'pcall(unpack,t,2,4)', pcall(unpack,t,2,4) ); -print( 'pcall(unpack,t,2,5)', pcall(unpack,t,2,5) ); -print( 'pcall(unpack,t,2,6)', pcall(unpack,t,2,6) ); -print( 'pcall(unpack,t,2,7)', pcall(unpack,t,2,7) ); -print( 'pcall(unpack,t,2,8)', pcall(unpack,t,2,8) ); -print( 'pcall(unpack,t,2,2)', pcall(unpack,t,2,0) ); -print( 'pcall(unpack,t,2,1)', pcall(unpack,t,2,0) ); -print( 'pcall(unpack,t,2,0)', pcall(unpack,t,2,0) ); -print( 'pcall(unpack,t,2,-1)', pcall(unpack,t,2,-1) ); -t[0] = 'zz' -t[-1] = 'yy' -t[-2] = 'xx' -print( 'pcall(unpack,t,0)', pcall(unpack,t,0) ); -print( 'pcall(unpack,t,2,0)', pcall(unpack,t,2,0) ); -print( 'pcall(unpack,t,2,-1)', pcall(unpack,t,2,-1) ); -print( 'pcall(unpack,t,"3")', pcall(unpack,t,"3") ); -print( 'pcall(unpack,t,"a")', pcall(unpack,t,"a") ); -print( 'pcall(unpack,t,function() end)', pcall(unpack,t,function() end) ); - --- _VERSION -print( '_VERSION', type(_VERSION) ) - --- xpcall -local errfunc = function( detail ) - print( ' in errfunc', type(detail) ) - return 'response-from-xpcall' -end -local badfunc = function() error( 'error-from-badfunc' ) end -local wrappedbad = function() pcall( badfunc ) end -print( 'pcall(badfunc)', pcall(badfunc) ) -print( 'pcall(badfunc,errfunc)', pcall(badfunc,errfunc) ) -print( 'pcall(badfunc,badfunc)', pcall(badfunc,badfunc) ) -print( 'pcall(wrappedbad)', pcall(wrappedbad) ) -print( 'pcall(wrappedbad,errfunc)', pcall(wrappedbad,errfunc) ) -print( 'pcall(xpcall(badfunc))', pcall(xpcall,badfunc) ) -print( 'pcall(xpcall(badfunc,errfunc))', pcall(xpcall,badfunc,errfunc) ) -print( 'pcall(xpcall(badfunc,badfunc))', pcall(xpcall,badfunc,badfunc) ) -print( 'pcall(xpcall(wrappedbad))', pcall(xpcall,wrappedbad) ) -print( 'xpcall(wrappedbad,errfunc)', xpcall(wrappedbad,errfunc) ) - diff --git a/luaj-2.0.3/test/lua/coroutinelib.lua b/luaj-2.0.3/test/lua/coroutinelib.lua deleted file mode 100644 index 31e3934eb..000000000 --- a/luaj-2.0.3/test/lua/coroutinelib.lua +++ /dev/null @@ -1,125 +0,0 @@ -function printrunning() - if coroutine.running() == nil then - print("running is nil"); - else - print("running is not nil") - end -end - -function foo (a) - print("foo", a) - return coroutine.yield(2*a) -end - -co = coroutine.create(function (a,b) - print("co-body", a, b) - local r = foo(a+1) - print("co-body", r) - local r, s = coroutine.yield(a+b, a-b) - print("co-body", r, s) - - printrunning() - print("co.status.inside",coroutine.status(co)); - local co2 = coroutine.create(function() - print("co.status.inside2",coroutine.status(co)); - end) - print("co.status.inside",coroutine.status(co)); - coroutine.resume(co2); - - return b, "end" -end) - -function exercise() - printrunning() - print("co.status",coroutine.status(co)); - print("main", coroutine.resume(co, 1, 10)) - print("co.status",coroutine.status(co)); - print("main", coroutine.resume(co, "r")) - print("co.status",coroutine.status(co)); - print("main", coroutine.resume(co, "x", "y")) - print("co.status",coroutine.status(co)); - print("main", coroutine.resume(co, "x", "y")) - print("co.status",coroutine.status(co)); -end - -exercise(); - -co = coroutine.create(function (a,b) - print("co-body", a, b) --- TODO: make java and C behave the same for yielding in pcalls --- local status,r = pcall( foo, a+1 ) -foo(a+1) - print("co-body", status,r) - local r, s = coroutine.yield(a+b, a-b) - print("co-body", r, s) - return b, "end" -end) - -exercise(); - - --- wrap test -local g = coroutine.wrap(function (a,b) - print("co-body", a, b) - local r = foo(a+1) - print("co-body", r) - local r, s = coroutine.yield(a+b, a-b) - print("co-body", r, s) - return b, "end" -end ) - -print("g", g(1, 10)) -print("g", g("r")) -print("g", g("x", "y")) -local s,e = pcall( g, "x", "y" ) -print("g", string.match(e,'cannot resume dead coroutine') or 'badmessage: '..tostring(e)) - --- varargs passing -local echo = function(msg,...) - print( msg, ...) - return ... -end -local echocr = function(...) - echo('(echocr) first args', unpack(arg,1,arg.n)) - local a = arg - while true do - a = { echo( '(echoch) yield returns', coroutine.yield( unpack(a) ) ) } - end -end -local c = coroutine.create( echocr ) -local step = function(...) - echo( '(main) resume returns', - coroutine.resume(c, echo('(main) sending args', ...)) ) -end -step(111,222,333) -step() -step(111) -step(111,222,333) - --- test loops in resume calls -b = coroutine.create( function( arg ) - while ( true ) do - print( ' b-resumed', arg, b == coroutine.running() ) - print( ' b-b', coroutine.status(b) ) - print( ' b-c', coroutine.status(c) ) - print( ' b-resume-b',coroutine.resume( b, 'b-arg-for-b' ) ) - print( ' b-resume-c',coroutine.resume( c, 'b-arg-for-c' ) ) - arg = coroutine.yield( 'b-rslt' ) - end -end ) -c = coroutine.create( function( arg ) - for i=1,3 do - print( ' c-resumed', arg, c == coroutine.running() ) - print( ' c-b', coroutine.status(b) ) - print( ' c-c', coroutine.status(c) ) - print( ' c-resume-b',coroutine.resume( b, 'b-arg-for-b' ) ) - print( ' c-resume-c',coroutine.resume( c, 'b-arg-for-c' ) ) - arg = coroutine.yield( 'c-rslt' ) - end -end ) -for i=1,3 do - print( 'main-b', coroutine.status(b) ) - print( 'main-c', coroutine.status(c) ) - print( 'main-resume-b',coroutine.resume( b, 'main-arg-for-b' ) ) - print( 'main-resume-c',coroutine.resume( c, 'main-arg-for-c' ) ) -end diff --git a/luaj-2.0.3/test/lua/debuglib.lua b/luaj-2.0.3/test/lua/debuglib.lua deleted file mode 100644 index b858d98a5..000000000 --- a/luaj-2.0.3/test/lua/debuglib.lua +++ /dev/null @@ -1,232 +0,0 @@ - -local print,tostring,_G,pcall,ipairs,isnumber = print,tostring,_G,pcall,ipairs,isnumber -local e,f,g,h,s -print( 'has debug', debug~=nil ) -if not debug then error( 'no debug' ) end - -print( '----- debug.getfenv, debug.setfenv' ) -f = function(a) - return 'f:'..tostring(a)..'|'..tostring(b) -end -s,e,g = pcall( debug.getfenv, f ) -print( s, type(e), type(g), (e==G), pcall( f, 'abc' ) ) -s,e,g = pcall( debug.setfenv, f, {b='def'} ) -print( s, type(e), type(g), (e==G), pcall( f, 'abc' ) ) -s,e,g = pcall( debug.getfenv, f ) -print( s, type(e), type(g), (e==G), pcall( f, 'abc' ) ) - - -print( '----- debug.getlocal, debug.setlocal' ) -h = function(v,i,n) - s = 'h-'..v..'-'..i - local x1,y1 = debug.getlocal(v,i) - local x2,y2 = debug.setlocal(v,i,n) - local x3,y3 = debug.getlocal(v,i) - return s..' -> '..v..'-'..i..' '.. - 'get='..tostring(x1)..','..tostring(y1)..' '.. - 'set='..tostring(x2)..','..tostring(y2)..' '.. - 'get='..tostring(x3)..','..tostring(y3)..' ' -end -g = function(...) - local p,q,r=7,8,9 - local t = h(...) - local b = table.concat({...},',') - return t..'\tg locals='..p..','..q..','..r..' tbl={'..b..'}' -end -f = function(a,b,c) - local d,e,f = 4,5,6 - local t = g(a,b,c) - return t..'\tf locals='..','..a..','..b..','..c..','..d..','..e..','..f -end -for lvl=3,2,-1 do - for lcl=0,7 do - print( pcall( f, lvl, lcl, '#' ) ) - end -end -for lvl=1,1 do - for lcl=3,7 do - print( pcall( f, lvl, lcl, '#' ) ) - end -end - - -print( '----- debug.getupvalue, debug.setupvalue' ) -local m,n,o = 101,102,103 -f = function(p,q,r) - local p,q,r = 104,105,106 - local g = function(s,t,u) - local v,w,x = 107,108,109 - return function() - return m,n,o,p,q,r,v,w,x - end - end - return g -end -g = f() -h = g() -local callh = function() - local t = {} - for i,v in ipairs( { pcall(h) } ) do - t[i] = tostring(v) - end - return table.concat(t,',') -end -print( 'h', h() ) -local funs = { f, g, h } -local names = { 'f', 'g', 'h' } -for i=1,3 do - local fun,name = funs[i],names[i] - for index=0,10 do - local s1,x1,y1 = pcall( debug.getupvalue, fun, index ) - local s2,x2,y2 = pcall( debug.setupvalue, fun, index, 666000+i*111000+index ) - local s3,x3,y3 = pcall( debug.getupvalue, fun, index ) - print( name..' -> '..i..'-'..index..' '.. - 'get='..tostring(s1)..','..tostring(x1)..','..tostring(y1)..' '.. - 'set='..tostring(s2)..','..tostring(x2)..','..tostring(y2)..' '.. - 'get='..tostring(s3)..','..tostring(x3)..','..tostring(y3)..' '.. - 'tbl='..callh() ) - end -end - -print( '----- debug.setmetatable, debug.getmetatable' ) -local a = {a='bbb'} -local b = {} -local mt = {__index={b='ccc'}} -print( 'a.a='..tostring(a.a)..' a.b='..tostring(a.b)..' b.a='..tostring(b.a)..' b.b='..tostring(b.b)) -local s1,x1,y1 = pcall( debug.getmetatable, a ) -local s2,x2,y2 = pcall( debug.setmetatable, a, mt ) -print( 'a.a='..tostring(a.a)..' a.b='..tostring(a.b)..' b.a='..tostring(b.a)..' b.b='..tostring(b.b)) -local s3,x3,y3 = pcall( debug.getmetatable, a ) -local s4,x4,y4 = pcall( debug.getmetatable, b ) -local s5,x5,y5 = pcall( debug.setmetatable, a, nil ) -print( 'a.a='..tostring(a.a)..' a.b='..tostring(a.b)..' b.a='..tostring(b.a)..' b.b='..tostring(b.b)) -local s6,x6,y6 = pcall( debug.getmetatable, a ) -if not s1 then print( 's1 error', x1 ) end -if not s2 then print( 's2 error', x2 ) end -if not s3 then print( 's3 error', x3 ) end -if not s4 then print( 's4 error', x4 ) end -if not s5 then print( 's5 error', x5 ) end -if not s6 then print( 's6 error', x6 ) end -print( 'get='..tostring(s1)..','..tostring(x1==nil)..','..tostring(y1) ) -print( 'set='..tostring(s2)..','..tostring(x2==a)..','..tostring(y2) ) -print( 'get='..tostring(s3)..','..tostring(x3==mt)..','..tostring(y3) ) -print( 'get='..tostring(s4)..','..tostring(x4==nil)..','..tostring(y4) ) -print( 'set='..tostring(s5)..','..tostring(x5==a)..','..tostring(y5) ) -print( 'get='..tostring(s6)..','..tostring(x6==nil)..','..tostring(y6) ) -print( pcall( debug.getmetatable, 1 ) ) -print( pcall( debug.setmetatable, 1, {} ) ) -print( pcall( debug.setmetatable, 1, nil ) ) - -print( '----- debug.getinfo' ) -local printfield = function(tbl, field) - local x = tbl[field] - if x == nil then return end - local typ = type(x) - if typ=='table' then - x = '{'..table.concat(x,',')..'}' - elseif typ=='function' then - x = typ - end - print( ' '..field..': '..tostring(x) ) -end -local fields = { 'source', 'short_src', 'what', - 'currentline', 'linedefined', 'lastlinedefined', - 'nups', 'func', 'activelines' } -local printinfo = function(...) - for i,a in ipairs(arg) do - if type(a) == 'table' then - for j,field in ipairs(fields) do - printfield( a, field) - end - else - print( tostring(a) ) - end - end -end -function test() - local x = 5 - function f() - x = x + 1 - return x - end - function g() - x = x - 1 - print( '---' ) - printinfo( 'debug.getinfo(1)', debug.getinfo(1) ) - printinfo( 'debug.getinfo(1,"")', debug.getinfo(1, "") ) - printinfo( 'debug.getinfo(1,"l")', debug.getinfo(1, "l") ) - printinfo( 'debug.getinfo(1,"fL")', debug.getinfo(1, "fL") ) - printinfo( 'debug.getinfo(2)', debug.getinfo(2) ) - printinfo( 'debug.getinfo(2,"l")', debug.getinfo(2, "l") ) - printinfo( 'debug.getinfo(2,"fL")', debug.getinfo(2, "fL") ) - printinfo( 'debug.getinfo(10,"")', pcall( debug.getinfo, 10, "" ) ) - printinfo( 'debug.getinfo(-10,"")', pcall( debug.getinfo, -10, "" ) ) - --[[ - for i=1,3 do - printinfo( 'debug.traceback("msg")', debug.traceback('msg') ) - printinfo( 'debug.traceback("another",'..i..')', debug.traceback('another',i) ) - end - --]] - print( '---' ) - return x - end - print(f()) - print(g()) - return f, g -end - -local options = "nSlufL" -local e,f,g = pcall( test ) -print( 'e,f,g', e, type(f), type(g) ) -printinfo( 'debug.getinfo(f)', pcall(debug.getinfo, f) ) -printinfo( 'debug.getinfo(f,"'..options..'")', pcall(debug.getinfo, f, options) ) -for j=1,6 do - local opts = options:sub(j,j) - printinfo( 'debug.getinfo(f,"'..opts..'")', pcall(debug.getinfo, f, opts) ) -end -printinfo( 'debug.getinfo(g)', pcall(debug.getinfo, g) ) -printinfo( 'debug.getinfo(test)', pcall(debug.getinfo, test) ) - -print( '----- debug.sethook, debug.gethook' ) -f = function(x) - g = function(y) - return math.min(x,h) - end - local a = g(x) - return a + a -end -local hook = function(...) - print( ' ... in hook', ... ) - local info = debug.getinfo(2,"Sl") - if info then - print( ' info[2]='..tostring(info.short_src)..','..tostring(info.currentline) ) - end -end -local tryfunc = function(hook,mask,func,arg) - local x,f,h,m - pcall( function() - debug.sethook(hook,mask) - x = func(arg) - f,h,m = debug.gethook() - end ) - debug.sethook() - return x,f,h,m -end - -local tryhooks = function(mask) - local s1,a1,b1,c1,d1 = pcall( tryfunc, hook, mask, f, 333 ) - print( 'hook = '..mask..' -> '.. - 'result='..tostring(s1)..','..tostring(a1)..','.. - type(b1)..','..type(c1)..','.. - tostring(b1==f)..','..tostring(c1==hook)..','.. - tostring(d1)..' ' ) -end - ---[[ -tryhooks("c") -tryhooks("r") -tryhooks("l") -tryhooks("crl") ---]] - - \ No newline at end of file diff --git a/luaj-2.0.3/test/lua/errors.lua b/luaj-2.0.3/test/lua/errors.lua deleted file mode 100644 index 3ed06c2e9..000000000 --- a/luaj-2.0.3/test/lua/errors.lua +++ /dev/null @@ -1,137 +0,0 @@ --- tostring replacement that assigns ids -local ts,id,nid,types = tostring,{},0,{table='tbl',thread='thr',userdata='uda',['function']='func'} -tostring = function(x) - if not x or not types[type(x)] then return ts(x) end - if not id[x] then nid=nid+1; id[x]=types[type(x)]..'.'..nid end - return id[x] -end - --- test of common types of errors --- local function c(f,...) return f(...) end --- local function b(...) return c(...) end ---local function a(...) return (pcall(b,...)) end -local function a(...) local s,e=pcall(...) if s then return s,e else return false,type(e) end end -s = 'some string' -local t = {} --- error message tests -print( 'a(error)', a(error) ) -print( 'a(error,"msg")', a(error,"msg") ) -print( 'a(error,"msg",0)', a(error,"msg",0) ) -print( 'a(error,"msg",1)', a(error,"msg",1) ) -print( 'a(error,"msg",2)', a(error,"msg",2) ) -print( 'a(error,"msg",3)', a(error,"msg",3) ) -print( 'a(error,"msg",4)', a(error,"msg",4) ) -print( 'a(error,"msg",5)', a(error,"msg",5) ) -print( 'a(error,"msg",6)', a(error,"msg",6) ) - --- call errors -print( 'a(nil())', a(function() return n() end) ) -print( 'a(t()) ', a(function() return t() end) ) -print( 'a(s()) ', a(function() return s() end) ) -print( 'a(true())', a(function() local b = true; return b() end) ) - --- arithmetic errors -print( 'a(nil+1)', a(function() return nil+1 end) ) -print( 'a(a+1) ', a(function() return a+1 end) ) -print( 'a(s+1) ', a(function() return s+1 end) ) -print( 'a(true+1)', a(function() local b = true; return b+1 end) ) - --- table errors -print( 'a(nil.x)', a(function() return n.x end) ) -print( 'a(a.x) ', a(function() return a.x end) ) -print( 'a(s.x) ', a(function() return s.x end) ) -print( 'a(true.x)', a(function() local b = true; return b.x end) ) -print( 'a(nil.x=5)', a(function() n.x=5 end) ) -print( 'a(a.x=5) ', a(function() a.x=5 end) ) -print( 'a(s.x=5) ', a(function() s.x=5 end) ) -print( 'a(true.x=5)', a(function() local b = true; b.x=5 end) ) - --- len operator -print( 'a(#nil) ', a(function() return #n end) ) -print( 'a(#t) ', a(function() return #t end) ) -print( 'a(#s) ', a(function() return #s end) ) -print( 'a(#a) ', a(function() return #a end) ) -print( 'a(#true)', a(function() local b = true; return #b end) ) - --- comparison errors -print( 'a(nil>1)', a(function() return nil>1 end) ) -print( 'a(a>1) ', a(function() return a>1 end) ) -print( 'a(s>1) ', a(function() return s>1 end) ) -print( 'a(true>1)', a(function() local b = true; return b>1 end) ) - --- unary minus errors -print( 'a(-nil)', a(function() return -n end) ) -print( 'a(-a) ', a(function() return -a end) ) -print( 'a(-s) ', a(function() return -s end) ) -print( 'a(-true)', a(function() local b = true; return -b end) ) - --- string concatenation -local function concatsuite(comparefunc) - print( '"a".."b"', comparefunc("a","b") ) - print( '"a"..nil', comparefunc("a",nil) ) - print( 'nil.."b"', comparefunc(nil,"b") ) - print( '"a"..{}', comparefunc("a",{}) ) - print( '{}.."b"', comparefunc({},"b") ) - print( '"a"..2', comparefunc("a",2) ) - print( '2.."b"', comparefunc(2,"b") ) - print( '"a"..print', comparefunc("a",print) ) - print( 'print.."b"', comparefunc(print,"b") ) - print( '"a"..true', comparefunc("a",true) ) - print( 'true.."b"', comparefunc(true,"b") ) - print( 'nil..true', comparefunc(nil,true) ) - print( '"a"..3.5', comparefunc("a",3.5) ) - print( '3.5.."b"', comparefunc(3.5,"b") ) -end -local function strconcat(a,b) - return (pcall( function() return a..b end) ) -end -local function tblconcat(a,b) - local t={a,b} - return (pcall( function() return table.concat(t,'-',1,2) end )) -end - -print( '-------- string concatenation' ) -concatsuite(strconcat) -print( '-------- table concatenation' ) -concatsuite(tblconcat) - --- pairs -print( '-------- pairs tests' ) -print( 'a(pairs(nil))', a(function() return pairs(nil,{}) end) ) -print( 'a(pairs(a)) ', a(function() return pairs(a,{}) end) ) -print( 'a(pairs(s)) ', a(function() return pairs(s,{}) end) ) -print( 'a(pairs(t)) ', a(function() return pairs(t,{}) end) ) -print( 'a(pairs(true))', a(function() local b = true; return pairs(b,{}) end) ) - --- setmetatable -print( '-------- setmetatable tests' ) -function sm(...) - return tostring(setmetatable(...)) -end -print( 'a(setmetatable(nil))', a(function() return sm(nil,{}) end) ) -print( 'a(setmetatable(a)) ', a(function() return sm(a,{}) end) ) -print( 'a(setmetatable(s)) ', a(function() return sm(s,{}) end) ) -print( 'a(setmetatable(true))', a(function() local b = true; return sm(b,{}) end) ) -print( 'a(setmetatable(t)) ', a(function() return sm(t,{}) end) ) -print( 'a(getmetatable(t)) ', a(function() return getmetatable(t),type(getmetatable(t)) end) ) -print( 'a(setmetatable(t*)) ', a(function() return sm(t,{__metatable={}}) end) ) -print( 'a(getmetatable(t)) ', a(function() return getmetatable(t),type(getmetatable(t)) end) ) -print( 'a(setmetatable(t)) ', a(function() return sm(t,{}) end) ) -print( 'a(getmetatable(t)) ', a(function() return getmetatable(t),type(getmetatable(t)) end) ) -t = {} -print( 'a(setmetatable(t)) ', a(function() return sm(t,{}) end) ) -print( 'a(getmetatable(t)) ', a(function() return getmetatable(t),type(getmetatable(t)) end) ) -print( 'a(setmetatable(t*)) ', a(function() return sm(t,{__metatable='some string'}) end) ) -print( 'a(getmetatable(t)) ', a(function() return getmetatable(t),type(getmetatable(t)) end) ) -print( 'a(setmetatable(t)) ', a(function() return sm(t,{}) end) ) -print( 'a(getmetatable(t)) ', a(function() return getmetatable(t),type(getmetatable(t)) end) ) -print( 'a(setmetatable(t,nil)) ', a(function() return sm(t,nil) end) ) -print( 'a(setmetatable(t)) ', a(function() return sm(t) end) ) -print( 'a(setmetatable({},"abc")) ', a(function() return sm({},'abc') end) ) - --- bad args to error! -print( 'error("msg","arg")', a(function() error('some message', 'some bad arg') end) ) - --- loadfile, dofile on missing files -print( 'loadfile("bogus.txt")', a(function() return loadfile("bogus.txt") end) ) -print( 'dofile("bogus.txt")', a(function() return dofile("bogus.txt") end) ) diff --git a/luaj-2.0.3/test/lua/errors/args.lua b/luaj-2.0.3/test/lua/errors/args.lua deleted file mode 100644 index eafdabf0f..000000000 --- a/luaj-2.0.3/test/lua/errors/args.lua +++ /dev/null @@ -1,197 +0,0 @@ --- utilities to check that args of various types pass or fail --- argument type checking -local ok = '-\t' -local fail = 'fail ' -local needcheck = 'needcheck ' -local badmsg = 'badmsg ' - -akey = 'aa' -astring = 'abc' -astrnum = '789' -anumber = 1.25 -ainteger = 345 -adouble = 12.75 -aboolean = true -atable = {[akey]=456} -afunction = function() end -anil = nil -athread = coroutine.create(afunction) - -anylua = { nil, astring, anumber, aboolean, atable, afunction, athread } - -somestring = { astring, anumber } -somenumber = { anumber, astrnum } -someboolean = { aboolean } -sometable = { atable } -somefunction = { afunction } -somenil = { anil } -somekey = { akey } -notakey = { astring, anumber, aboolean, atable, afunction } - -notastring = { nil, aboolean, atable, afunction, athread } -notanumber = { nil, astring, aboolean, atable, afunction, athread } -notaboolean = { nil, astring, anumber, atable, afunction, athread } -notatable = { nil, astring, anumber, aboolean, afunction, athread } -notafunction = { nil, astring, anumber, aboolean, atable, athread } -notathread = { nil, astring, anumber, aboolean, atable, afunction } -notanil = { astring, anumber, aboolean, atable, afunction, athread } - -nonstring = { aboolean, atable, afunction, athread } -nonnumber = { astring, aboolean, atable, afunction, athread } -nonboolean = { astring, anumber, atable, afunction, athread } -nontable = { astring, anumber, aboolean, afunction, athread } -nonfunction = { astring, anumber, aboolean, atable, athread } -nonthread = { astring, anumber, aboolean, atable, afunction } -nonkey = { astring, anumber, aboolean, atable, afunction } - -local structtypes = { - ['table']='', - ['function']='', - ['thread']='', - ['userdata']='', -} - -local function bracket(v) - return "<"..type(v)..">" -end - -local function quote(v) - return "'"..v.."'" -end - -local function ellipses(v) - local s = tostring(v) - return #s <= 8 and s or (string.sub(s,1,8)..'...') -end - -local pretty = { - ['table']=bracket, - ['function']=bracket, - ['thread']=bracket, - ['userdata']=bracket, - ['string']= quote, - ['number']= ellipses, -} - -local function values(list) - local t = {} - for i=1,(list.n or #list) do - local ai = list[i] - local fi = pretty[type(ai)] - t[i] = fi and fi(ai) or tostring(ai) - end - return table.concat(t,',') -end - -local function types(list) - local t = {} - for i=1,(list.n or #list) do - local ai = list[i] - t[i] = type(ai) - end - return table.concat(t,',') -end - -local function signature(name,arglist) - return name..'('..values(arglist)..')' -end - -local function dup(t) - local s = {} - for i=1,(t.n or #t) do - s[i] = t[i] - end - return s -end - -local function split(t) - local s = {} - local n = (t.n or #t) - for i=1,n-1 do - s[i] = t[i] - end - return s,t[n] -end - -local function expand(argsets, typesets, ...) - local n = typesets and #typesets or 0 - if n <= 0 then - table.insert(argsets,arg) - return argsets - end - - local s,v = split(typesets) - for i=1,(v.n or #v) do - expand(argsets, s, v[i], unpack(arg,1,arg.n)) - end - return argsets -end - -local function arglists(typesets) - local argsets = expand({},typesets) - return ipairs(argsets) -end - -function lookup( name ) - return loadstring('return '..name)() -end - -function invoke( name, arglist ) - local s,c = pcall(lookup, name) - if not s then return s,c end - return pcall(c, unpack(arglist,1,arglist.n or #arglist)) -end - --- messages, banners -local _print = print -local _tostring = tostring -local _find = string.find -function banner(name) - _print( '====== '.._tostring(name)..' ======' ) -end - -local function subbanner(name) - _print( '--- '.._tostring(name) ) -end - -local function pack(s,...) - return s,arg -end - --- check that all combinations of arguments pass -function checkallpass( name, typesets, typesonly ) - subbanner('checkallpass') - for i,v in arglists(typesets) do - local sig = signature(name,v) - local s,r = pack( invoke( name, v ) ) - if s then - if typesonly then - _print( ok, sig, types(r) ) - else - _print( ok, sig, values(r) ) - end - else - _print( fail, sig, values(r) ) - end - end -end - --- check that all combinations of arguments fail in some way, --- ignore error messages -function checkallerrors( name, typesets, template ) - subbanner('checkallerrors') - template = _tostring(template) - for i,v in arglists(typesets) do - local sig = signature(name,v) - local s,e = invoke( name, v ) - if not s then - if _find(e, template, 1, true) then - _print( ok, sig, '...'..template..'...' ) - else - _print( badmsg, sig, "template='"..template.."' actual='"..e.."'" ) - end - else - _print( needcheck, sig, e ) - end - end -end diff --git a/luaj-2.0.3/test/lua/errors/baselibargs.lua b/luaj-2.0.3/test/lua/errors/baselibargs.lua deleted file mode 100644 index 6a0d23492..000000000 --- a/luaj-2.0.3/test/lua/errors/baselibargs.lua +++ /dev/null @@ -1,171 +0,0 @@ -package.path = "?.lua;test/lua/errors/?.lua" -require 'args' - --- arg types for basic library functions - --- assert -banner('assert') -checkallpass('assert',{{true,123},anylua}) -checkallerrors('assert',{{nil,false,n=2},{nil,n=1}},'assertion failed') -checkallerrors('assert',{{nil,false,n=2},{'message'}},'message') - --- collectgarbage -banner('collectgarbage') -checkallpass('collectgarbage',{{'collect','count'}},true) -checkallerrors('collectgarbage',{{astring, anumber}},'bad argument') -checkallerrors('collectgarbage',{{aboolean, atable, afunction, athread}},'string expected') - --- dofile -banner('dofile') ---checkallpass('dofile', {}) -checkallpass('dofile', {{'args.lua'}}) -checkallerrors('dofile', {{'foo.bar'}}, 'cannot open foo.bar') -checkallerrors('dofile', {nonstring}, 'bad argument') - --- error -banner('error') -checkallerrors('error', {{'message'},{nil,0,1,2,n=4}}, 'message') -checkallerrors('error', {{123},{nil,1,2,n=3}}, 123) - --- getfenv -banner('getfenv') -checkallpass('getfenv', {{nil,print,function()end,0,1,2,n=5}}) -checkallerrors('getfenv', {{true,{},'abc'}}, 'bad argument') - --- getmetatable -banner('getmetatable') -checkallpass('getmetatable', {notanil}) -checkallerrors('getmetatable',{},'bad argument') - --- ipairs -banner('ipairs') -checkallpass('ipairs', {sometable}) -checkallerrors('ipairs', {notatable}, 'bad argument') - --- load -banner('load') -checkallpass('load', {somefunction,{nil,astring,n=2}}) -checkallerrors('load', {notafunction,{nil,astring,anumber,n=3}}, 'bad argument') -checkallerrors('load', {somefunction,{afunction,atable}}, 'bad argument') - --- loadfile -banner('loadfile') ---checkallpass('loadfile', {}) -checkallpass('loadfile', {{'bogus'}}) -checkallpass('loadfile', {{'test/lua/errors/args.lua'}}) -checkallpass('loadfile', {{'args.lua'}}) -checkallerrors('loadfile', {nonstring}, 'bad argument') - --- loadstring -banner('loadstring') -checkallpass('loadstring', {{'return'}}) -checkallpass('loadstring', {{'return'},{'mychunk'}}) -checkallpass('loadstring', {{'return a ... b'},{'mychunk'}},true) -checkallerrors('loadstring', {notastring,{nil,astring,anumber,n=3}}, 'bad argument') -checkallerrors('loadstring', {{'return'},{afunction,atable}}, 'bad argument') - --- next -banner('next') -checkallpass('next', {sometable,somekey}) -checkallerrors('next', {notatable,{nil,1,n=2}}, 'bad argument') -checkallerrors('next', {sometable,nonkey}, 'invalid key') - --- pairs -banner('pairs') -checkallpass('pairs', {sometable}) -checkallerrors('pairs', {notatable}, 'bad argument') - --- pcall -banner('pcall') -checkallpass('pcall', {notanil,anylua}, true) -checkallerrors('pcall',{},'bad argument') - --- print -banner('print') -checkallpass('print', {}) -checkallpass('print', {{nil,astring,anumber,aboolean,n=4}}) - --- rawequal -banner('rawequal') -checkallpass('rawequal', {notanil,notanil}) -checkallerrors('rawequal', {}, 'bad argument') -checkallerrors('rawequal', {notanil}, 'bad argument') - --- rawget -banner('rawget') -checkallpass('rawget', {sometable,somekey}) -checkallpass('rawget', {sometable,nonkey}) -checkallerrors('rawget', {sometable,somenil},'bad argument') -checkallerrors('rawget', {notatable,notakey}, 'bad argument') -checkallerrors('rawget', {}, 'bad argument') - --- rawset -banner('rawset') -checkallpass('rawset', {sometable,somekey,notanil}) -checkallpass('rawset', {sometable,nonkey,notanil}) -checkallerrors('rawset', {sometable,somenil},'table index is nil') -checkallerrors('rawset', {}, 'bad argument') -checkallerrors('rawset', {notatable,somestring,somestring}, 'bad argument') -checkallerrors('rawset', {sometable,somekey}, 'bad argument') - --- select -banner('select') -checkallpass('select', {{anumber,'#'},anylua}) -checkallerrors('select', {notanumber}, 'bad argument') - --- setfenv -banner('setfenv') -local g = _G -checkallpass('setfenv', {{function()end},sometable}) -checkallerrors('setfenv', {{-1, '-2'},{g}}, 'level must be non-negative') -checkallerrors('setfenv', {{10, '11'},{g}}, 'invalid level') -checkallerrors('setfenv', {{rawset},{g}}, 'cannot change environment of given object') -checkallerrors('setfenv', {{atable,athread,aboolean,astring},{g}}, 'bad argument') -checkallerrors('setfenv', {notafunction}, 'bad argument') -checkallerrors('setfenv', {anylua}, 'bad argument') -checkallerrors('setfenv', {{function()end},notatable}, 'bad argument') - --- setmetatable -banner('setmetatable') -checkallpass('setmetatable', {sometable,sometable}) -checkallpass('setmetatable', {sometable,{}}) -checkallerrors('setmetatable',{notatable,sometable},'bad argument') -checkallerrors('setmetatable',{sometable,nontable},'bad argument') - --- tonumber -banner('tonumber') -checkallpass('tonumber',{somenumber,{nil,2,10,36,n=4}}) -checkallpass('tonumber',{notanil,{nil,10,n=2}}) -checkallerrors('tonumber',{{nil,afunction,atable,n=3},{2,9,11,36}},'bad argument') -checkallerrors('tonumber',{somenumber,{1,37,atable,afunction,aboolean}},'bad argument') - --- tostring -banner('tostring') -checkallpass('tostring',{{astring,anumber,aboolean}}) -checkallpass('tostring',{{atable,afunction,athread}},true) -checkallpass('tostring',{{astring,anumber,aboolean},{'anchor'}}) -checkallpass('tostring',{{atable,afunction,athread},{'anchor'}},true) -checkallerrors('tostring',{},'bad argument') - --- type -banner('type') -checkallpass('type',{notanil}) -checkallpass('type',{anylua,{'anchor'}}) -checkallerrors('type',{},'bad argument') - --- unpack -banner('unpack') -checkallpass('unpack',{sometable}) -checkallpass('unpack',{sometable,{3,'5'}}) -checkallpass('unpack',{sometable,{3,'5'},{1.25,'7'}}) -checkallerrors('unpack',{notatable,somenumber,somenumber},'bad argument') -checkallerrors('unpack',{sometable,nonnumber,somenumber},'bad argument') -checkallerrors('unpack',{sometable,somenumber,nonnumber},'bad argument') - --- xpcall -banner('xpcall') -checkallpass('xpcall', {notanil,nonfunction}) -checkallpass('xpcall', {notanil,{function(...)return 'aaa', 'bbb', #{...} end}}) -checkallerrors('xpcall',{anylua},'bad argument') - - diff --git a/luaj-2.0.3/test/lua/errors/coroutinelibargs.lua b/luaj-2.0.3/test/lua/errors/coroutinelibargs.lua deleted file mode 100644 index caad62002..000000000 --- a/luaj-2.0.3/test/lua/errors/coroutinelibargs.lua +++ /dev/null @@ -1,47 +0,0 @@ -package.path = "?.lua;test/lua/errors/?.lua" -require 'args' - --- arg type tests for coroutine library functions - --- coroutine.create -banner('coroutine.create') -checkallpass('coroutine.create',{somefunction}) -checkallerrors('coroutine.create',{notafunction},'bad argument') - --- coroutine.resume -banner('coroutine.resume') -local co = coroutine.create(function() while true do coroutine.yield() end end) -checkallpass('coroutine.resume',{{co},anylua}) -checkallerrors('coroutine.resume',{notathread},'bad argument') - --- coroutine.running -banner('coroutine.running') -checkallpass('coroutine.running',{anylua}) - --- coroutine.status -banner('coroutine.status') -checkallpass('coroutine.status',{{co}}) -checkallerrors('coroutine.status',{notathread},'bad argument') - --- coroutine.wrap -banner('coroutine.wrap') -checkallpass('coroutine.wrap',{somefunction}) -checkallerrors('coroutine.wrap',{notafunction},'bad argument') - --- coroutine.yield -banner('coroutine.yield') -local function f() - print( 'yield', coroutine.yield() ) - print( 'yield', coroutine.yield(astring,anumber,aboolean) ) - error('error within coroutine thread') -end -local co = coroutine.create( f ) -print( 'status', coroutine.status(co) ) -print( coroutine.resume(co,astring,anumber) ) -print( 'status', coroutine.status(co) ) -print( coroutine.resume(co,astring,anumber) ) -print( 'status', coroutine.status(co) ) -local s,e = coroutine.resume(co,astring,anumber) -print( s, string.match(e,'error within coroutine thread') or 'bad message: '..tostring(e) ) -print( 'status', coroutine.status(co) ) - diff --git a/luaj-2.0.3/test/lua/errors/iolibargs.lua b/luaj-2.0.3/test/lua/errors/iolibargs.lua deleted file mode 100644 index 1f8a3ac44..000000000 --- a/luaj-2.0.3/test/lua/errors/iolibargs.lua +++ /dev/null @@ -1,85 +0,0 @@ -package.path = "?.lua;test/lua/errors/?.lua" -require 'args' - --- arg type tests for io library functions -local f - --- io.close ([file]) -banner('io.close') -f = io.open("abc.txt","w") -checkallpass('io.close',{{f}}) -checkallerrors('io.close',{notanil},'bad argument') - --- io.input ([file]) -banner('io.input') -f = io.open("abc.txt","r") -checkallpass('io.input',{{nil,f,"abc.txt",n=3}}) -checkallerrors('io.input',{nonstring},'bad argument') - --- io.lines ([filename]) -banner('io.lines') -io.input("abc.txt") -checkallpass('io.lines',{{"abc.txt"}}) -checkallerrors('io.lines',{{f}},'bad argument') -checkallerrors('io.lines',{notastring},'bad argument') - --- io.open (filename [, mode]) -banner('io.open') -checkallpass('io.open',{{"abc.txt"},{nil,"r","w","a","r+","w+","a+"}}) -checkallerrors('io.open',{notastring},'bad argument') -checkallerrors('io.open',{{"abc.txt"},{nonstring}},'bad argument') - --- io.output ([file]) -banner('io.output') -checkallpass('io.output',{{nil,f,"abc.txt",n=3}}) -checkallerrors('io.output',{nonstring},'bad argument') - --- io.popen (prog [, mode]) -banner('io.popen') ---checkallpass('io.popen',{{"hostname"},{nil,"w",n=2}}) -checkallerrors('io.popen',{notastring},'bad argument') -checkallerrors('io.popen',{{"hostname"},{nonstring}},'bad argument') - --- io.read (���) -banner('io.read') -checkallpass('io.read',{}) -checkallpass('io.read',{{2,"*n","*a","*l"}}) -checkallpass('io.read',{{2,"*n","*a","*l"},{2,"*a","*l"}}) -checkallerrors('io.read',{{aboolean,afunction,atable,"3"}},'bad argument') - --- io.write (���) -banner('io.write') -checkallpass('io.write',{}) -checkallpass('io.write',{somestring}) -checkallpass('io.write',{somestring,somestring}) -checkallerrors('io.write',{nonstring},'bad argument') -checkallerrors('io.write',{somestring,nonstring},'bad argument') - --- file:write () -banner('file:write') -file = io.open("seektest.txt","w") -checkallpass('file.write',{{file},somestring}) -checkallpass('file.write',{{file},somestring,somestring}) -checkallerrors('file.write',{},'bad argument') -checkallerrors('file.write',{{file},nonstring},'bad argument') -checkallerrors('file.write',{{file},somestring,nonstring},'bad argument') -pcall( file.close, file ) - --- file:seek ([whence] [, offset]) -banner('file:seek') -file = io.open("seektest.txt","r") -checkallpass('file.seek',{{file}}) -checkallpass('file.seek',{{file},{"set","cur","end"}}) -checkallpass('file.seek',{{file},{"set","cur","end"},{2,"3"}}) -checkallerrors('file.seek',{},'bad argument') -checkallerrors('file.seek',{{file},nonstring},'bad argument') -checkallerrors('file.seek',{{file},{"set","cur","end"},nonnumber},'bad argument') - --- file:setvbuf (mode [, size]) -banner('file:setvbuf') -checkallpass('file.setvbuf',{{file},{"no","full","line"}}) -checkallpass('file.setvbuf',{{file},{"full"},{1024,"512"}}) -checkallerrors('file.setvbuf',{},'bad argument') -checkallerrors('file.setvbuf',{{file},notastring},'bad argument') -checkallerrors('file.setvbuf',{{file},{"full"},nonnumber},'bad argument') - diff --git a/luaj-2.0.3/test/lua/errors/mathlibargs.lua b/luaj-2.0.3/test/lua/errors/mathlibargs.lua deleted file mode 100644 index 225946187..000000000 --- a/luaj-2.0.3/test/lua/errors/mathlibargs.lua +++ /dev/null @@ -1,112 +0,0 @@ -package.path = "?.lua;test/lua/errors/?.lua" -require 'args' - -local tostring = tostring -_G.tostring = function(x) - local s = tostring(x) - return type(x)=='number' and #s>4 and (s:sub(1,5)..'...') or s -end - --- arg type tests for math library functions -local somenumber = {1,0.75,'-1','-0.25'} -local somepositive = {1,0.75,'2', '2.5'} -local notanumber = {nil,astring,aboolean,afunction,atable,athread} -local nonnumber = {astring,aboolean,afunction,atable} - -local singleargfunctions = { - 'abs', 'acos', 'asin', 'atan', 'cos', 'cosh', 'deg', 'exp', 'floor', - 'rad', 'randomseed', 'sin', 'sinh', 'tan', 'tanh', 'frexp', - } - -local singleargposdomain = { - 'log', 'log10', 'sqrt', 'ceil', - } - -local twoargfunctions = { - 'atan2', - } - -local twoargsposdomain = { - 'pow', 'fmod', -} - --- single argument tests -for i,v in ipairs(singleargfunctions) do - local funcname = 'math.'..v - banner(funcname) - checkallpass(funcname,{somenumber}) - checkallerrors(funcname,{notanumber},'bad argument') -end - --- single argument, positive domain tests -for i,v in ipairs(singleargposdomain) do - local funcname = 'math.'..v - banner(funcname) - checkallpass(funcname,{somepositive}) - checkallerrors(funcname,{notanumber},'bad argument') -end - --- two-argument tests -for i,v in ipairs(twoargfunctions) do - local funcname = 'math.'..v - banner(funcname) - checkallpass(funcname,{somenumber,somenumber}) - checkallerrors(funcname,{},'bad argument') - checkallerrors(funcname,{notanumber},'bad argument') - checkallerrors(funcname,{notanumber,somenumber},'bad argument') - checkallerrors(funcname,{somenumber},'bad argument') - checkallerrors(funcname,{somenumber,notanumber},'bad argument') -end - --- two-argument, positive domain tests -for i,v in ipairs(twoargsposdomain) do - local funcname = 'math.'..v - banner(funcname) - checkallpass(funcname,{somepositive,somenumber}) - checkallerrors(funcname,{},'bad argument') - checkallerrors(funcname,{notanumber},'bad argument') - checkallerrors(funcname,{notanumber,somenumber},'bad argument') - checkallerrors(funcname,{somenumber},'bad argument') - checkallerrors(funcname,{somenumber,notanumber},'bad argument') -end - --- math.max -banner('math.max') -checkallpass('math.max',{somenumber}) -checkallpass('math.max',{somenumber,somenumber}) -checkallerrors('math.max',{},'bad argument') -checkallerrors('math.max',{nonnumber},'bad argument') -checkallerrors('math.max',{somenumber,nonnumber},'bad argument') - --- math.min -banner('math.min') -checkallpass('math.min',{somenumber}) -checkallpass('math.min',{somenumber,somenumber}) -checkallerrors('math.min',{},'bad argument') -checkallerrors('math.min',{nonnumber},'bad argument') -checkallerrors('math.min',{somenumber,nonnumber},'bad argument') - --- math.random -local somem = {3,4.5,'6.7'} -local somen = {8,9.10,'12.34'} -local notamn = {astring,aboolean,atable,afunction} -banner('math.random') -checkallpass('math.random',{},true) -checkallpass('math.random',{somem},true) -checkallpass('math.random',{somem,somen},true) -checkallpass('math.random',{{-4,-5.6,'-7','-8.9'},{-1,100,23.45,'-1.23'}},true) -checkallerrors('math.random',{{-4,-5.6,'-7','-8.9'}},'interval is empty') -checkallerrors('math.random',{somen,somem},'interval is empty') -checkallerrors('math.random',{notamn,somen},'bad argument') -checkallerrors('math.random',{somem,notamn},'bad argument') - --- math.ldexp -local somee = {-3,0,3,9.10,'12.34'} -local notae = {nil,astring,aboolean,atable,afunction} -banner('math.ldexp') -checkallpass('math.ldexp',{somenumber,somee}) -checkallerrors('math.ldexp',{},'bad argument') -checkallerrors('math.ldexp',{notanumber},'bad argument') -checkallerrors('math.ldexp',{notanumber,somee},'bad argument') -checkallerrors('math.ldexp',{somenumber},'bad argument') -checkallerrors('math.ldexp',{somenumber,notae},'bad argument') \ No newline at end of file diff --git a/luaj-2.0.3/test/lua/errors/modulelibargs.lua b/luaj-2.0.3/test/lua/errors/modulelibargs.lua deleted file mode 100644 index 711cc7c11..000000000 --- a/luaj-2.0.3/test/lua/errors/modulelibargs.lua +++ /dev/null @@ -1,46 +0,0 @@ -package.path = "?.lua;test/lua/errors/?.lua" -require 'args' - --- arg type tests for module library functions - --- require -banner('require') -checkallpass('require',{{'math','coroutine','package','string','table'}},true) -checkallerrors('require',{{anumber}},'not found') -checkallerrors('require',{{anil,aboolean,afunction,atable}},'bad argument') - --- package.loadlib -banner('package.loadlib') -checkallpass('package.loadlib',{{'foo'},{'bar'}},true) -checkallerrors('package.loadlib',{notastring},'bad argument') - --- package.seeall -banner('package.seeall') -checkallpass('package.seeall',{sometable}) -checkallerrors('package.seeall',{notatable},'bad argument') - - --- module tests - require special rigging -banner('module') -checkallerrors('module',{{20001},{nil,package.seeall,n=2},{nil,function()end,n=2}},"'module' not called from a Lua function") -checkallerrors('module',{{'testmodule1'},{nil,'pqrs',aboolean,athread,atable}},"'module' not called from a Lua function") -checkallerrors('module',{{aboolean,atable,function() end}},'bad argument') -checkallerrors('module',{{aboolean,atable,function() end},{package.seeall}},'bad argument') - --- enclose each invokation in its own function -function invoke( name, arglist ) - assert( name=='module', 'module rig used for '..name ) - local func = function() - module( unpack(arglist,1,arglist.n or #arglist) ) - end - return pcall( func ) -end -checkallpass('module',{{'foo1',20001}}) -checkallpass('module',{{'foo2',20002},{package.seeall}}) -checkallpass('module',{{'foo3',20003},{package.seeall},{function() end}}) -checkallerrors('module',{{aboolean,atable,function() end}},'bad argument') -checkallerrors('module',{{aboolean,atable,function() end},{package.seeall}},'bad argument') -checkallerrors('module',{{'testmodule2'},{'pqrs'}},'attempt to call') -checkallerrors('module',{{'testmodule3'},{aboolean}},'attempt to call') -checkallerrors('module',{{'testmodule4'},{athread}},'attempt to call') -checkallerrors('module',{{'testmodule5'},{atable}},'attempt to call') diff --git a/luaj-2.0.3/test/lua/errors/operators.lua b/luaj-2.0.3/test/lua/errors/operators.lua deleted file mode 100644 index ba53b5077..000000000 --- a/luaj-2.0.3/test/lua/errors/operators.lua +++ /dev/null @@ -1,157 +0,0 @@ -package.path = "?.lua;test/lua/errors/?.lua" -require 'args' - --- arg types for language operator - --- ========= unary operators: - # not - --- unary minus - -banner('unary -') -negative = function(a) return - a end -checkallpass('negative',{somenumber}) -checkallerrors('negative',{notanumber},'attempt to perform arithmetic') - --- length -banner('#') -lengthop = function(a) return #a end -checkallpass('lengthop',{sometable}) -checkallerrors('lengthop',{notatable},'attempt to get length of') - --- length -banner('not') -notop = function(a) return not a end -checkallpass('notop',{somenumber}) -checkallpass('notop',{notanumber}) - --- function call -banner( '()' ) -funcop = function(a) return a() end -checkallpass('funcop',{somefunction}) -checkallerrors('funcop',{notafunction},'attempt to call') - --- ========= binary ops: .. + - * / % ^ == ~= <= >= < > [] . and or -banner( '..' ) -concatop = function(a,b) return a..b end -checkallpass('concatop',{somestring,somestring}) -checkallerrors('concatop',{notastring,somestring},'attempt to concatenate') -checkallerrors('concatop',{somestring,notastring},'attempt to concatenate') - -banner( '+' ) -plusop = function(a,b) return a+b end -checkallpass('plusop',{somenumber,somenumber}) -checkallerrors('plusop',{notanumber,somenumber},'attempt to perform arithmetic') -checkallerrors('plusop',{somenumber,notanumber},'attempt to perform arithmetic') - -banner( '-' ) -minusop = function(a,b) return a-b end -checkallpass('minusop',{somenumber,somenumber}) -checkallerrors('minusop',{notanumber,somenumber},'attempt to perform arithmetic') -checkallerrors('minusop',{somenumber,notanumber},'attempt to perform arithmetic') - -banner( '*' ) -timesop = function(a,b) return a*b end -checkallpass('timesop',{somenumber,somenumber}) -checkallerrors('timesop',{notanumber,somenumber},'attempt to perform arithmetic') -checkallerrors('timesop',{somenumber,notanumber},'attempt to perform arithmetic') - -banner( '/' ) -divideop = function(a,b) return a/b end -checkallpass('divideop',{somenumber,somenumber}) -checkallerrors('divideop',{notanumber,somenumber},'attempt to perform arithmetic') -checkallerrors('divideop',{somenumber,notanumber},'attempt to perform arithmetic') - -banner( '%' ) -modop = function(a,b) return a%b end -checkallpass('modop',{somenumber,somenumber}) -checkallerrors('modop',{notanumber,somenumber},'attempt to perform arithmetic') -checkallerrors('modop',{somenumber,notanumber},'attempt to perform arithmetic') - -banner( '^' ) -powerop = function(a,b) return a^b end -checkallpass('powerop',{{2,'2.5'},{3,'3.5'}}) -checkallerrors('powerop',{notanumber,{3,'3.1'}},'attempt to perform arithmetic') -checkallerrors('powerop',{{2,'2.1'},notanumber},'attempt to perform arithmetic') - -banner( '==' ) -equalsop = function(a,b) return a==b end -checkallpass('equalsop',{anylua,anylua}) - -banner( '~=' ) -noteqop = function(a,b) return a~=b end -checkallpass('noteqop',{anylua,anylua}) - -banner( '<=' ) -leop = function(a,b) return a<=b end -checkallpass('leop',{{anumber},{anumber}}) -checkallpass('leop',{{astring,astrnum},{astring,astrnum}}) -checkallerrors('leop',{notanumber,{anumber}},'attempt to compare') -checkallerrors('leop',{{astrnum},{anumber}},'attempt to compare') -checkallerrors('leop',{notastring,{astring,astrnum}},'attempt to compare') -checkallerrors('leop',{{anumber},notanumber},'attempt to compare') -checkallerrors('leop',{{anumber},{astrnum}},'attempt to compare') -checkallerrors('leop',{{astring,astrnum},notastring},'attempt to compare') - -banner( '>=' ) -geop = function(a,b) return a>=b end -checkallpass('geop',{{anumber},{anumber}}) -checkallpass('geop',{{astring,astrnum},{astring,astrnum}}) -checkallerrors('geop',{notanumber,{anumber}},'attempt to compare') -checkallerrors('geop',{{astrnum},{anumber}},'attempt to compare') -checkallerrors('geop',{notastring,{astring,astrnum}},'attempt to compare') -checkallerrors('geop',{{anumber},notanumber},'attempt to compare') -checkallerrors('geop',{{anumber},{astrnum}},'attempt to compare') -checkallerrors('geop',{{astring,astrnum},notastring},'attempt to compare') - -banner( '<' ) -ltop = function(a,b) return a' ) -gtop = function(a,b) return a>b end -checkallpass('gtop',{{anumber},{anumber}}) -checkallpass('gtop',{{astring,astrnum},{astring,astrnum}}) -checkallerrors('gtop',{notanumber,{anumber}},'attempt to compare') -checkallerrors('gtop',{{astrnum},{anumber}},'attempt to compare') -checkallerrors('gtop',{notastring,{astring,astrnum}},'attempt to compare') -checkallerrors('gtop',{{anumber},notanumber},'attempt to compare') -checkallerrors('gtop',{{anumber},{astrnum}},'attempt to compare') -checkallerrors('gtop',{{astring,astrnum},notastring},'attempt to compare') - -banner( '[]' ) -bracketop = function(a,b) return a[b] end -checkallpass('bracketop',{sometable,notanil}) -checkallerrors('bracketop',{notatable,notanil},'attempt to index') -checkallerrors('bracketop',{sometable},'attempt to index') - -banner( '.' ) -dotop = function(a,b) return a.b end -checkallpass('dotop',{sometable,notanil}) -checkallerrors('dotop',{notatable,notanil},'attempt to index') -checkallerrors('dotop',{sometable},'attempt to index') - -banner( 'and' ) -types = {['table']='table',['function']='function',['thread']='thread'} -clean = function(x) return types[type(x)] or x end -andop = function(a,b) return clean(a and b) end -checkallpass('andop',{anylua,anylua}) - -banner( 'or' ) -orop = function(a,b) return clean(a or b) end -checkallpass('orop',{anylua,anylua}) - --- ========= for x in y -banner( 'for x=a,b,c' ) -forop = function(a,b,c) for x=a,b,c do end end -checkallpass('forop',{{1,'1.1'},{10,'10.1'},{2,'2.1'}}) -checkallerrors('forop',{notanumber,{10,'10.1'},{2,'2.1'}},"'for' initial value must be a number") -checkallerrors('forop',{{1,'1.1'},notanumber,{2,'2.1'}},"'for' limit must be a number") -checkallerrors('forop',{{1,'1.1'},{10,'10.1'},notanumber},"'for' step must be a number") - - diff --git a/luaj-2.0.3/test/lua/errors/stringlibargs.lua b/luaj-2.0.3/test/lua/errors/stringlibargs.lua deleted file mode 100644 index 6cb732e88..000000000 --- a/luaj-2.0.3/test/lua/errors/stringlibargs.lua +++ /dev/null @@ -1,120 +0,0 @@ -package.path = "?.lua;test/lua/errors/?.lua" -require 'args' - --- arg type tests for string library functions - --- string.byte -banner('string.byte') -checkallpass('string.byte',{somestring}) -checkallpass('string.byte',{somestring,somenumber}) -checkallpass('string.byte',{somestring,somenumber,somenumber}) -checkallerrors('string.byte',{somestring,{astring,afunction,atable}},'bad argument') -checkallerrors('string.byte',{notastring,{nil,111,n=2}},'bad argument') - --- string.char -function string_char(...) - return string.byte( string.char( ... ) ) -end -banner('string_char') -checkallpass('string.char',{{60}}) -checkallpass('string.char',{{60},{70}}) -checkallpass('string.char',{{60},{70},{80}}) -checkallpass('string_char',{{0,9,40,127,128,255,'0','9','255','9.2',9.2}}) -checkallpass('string_char',{{0,127,255},{0,127,255}}) -checkallerrors('string_char',{},'bad argument') -checkallerrors('string_char',{{nil,-1,256,3}},'bad argument') -checkallerrors('string_char',{notanumber,{23,'45',6.7}},'bad argument') -checkallerrors('string_char',{{23,'45',6.7},nonnumber},'bad argument') - --- string.dump -banner('string.dump') -local someupval = 435 -local function funcwithupvals() return someupval end -checkallpass('string.dump',{{function() return 123 end}}) -checkallpass('string.dump',{{funcwithupvals}}) -checkallerrors('string.dump',{notafunction},'bad argument') - --- string.find -banner('string.find') -checkallpass('string.find',{somestring,somestring}) -checkallpass('string.find',{somestring,somestring,{nil,-3,3,n=3}}) -checkallpass('string.find',{somestring,somestring,somenumber,anylua}) -checkallerrors('string.find',{notastring,somestring},'bad argument') -checkallerrors('string.find',{somestring,notastring},'bad argument') -checkallerrors('string.find',{somestring,somestring,nonnumber},'bad argument') - --- string.format ---local numfmts = {'%c','%d','%E','%e','%f','%g','%G','%i','%o','%u','%X','%x'} -local numfmts = {'%c','%d','%i','%o','%u','%X','%x'} -local strfmts = {'%q','%s'} -local badfmts = {'%w'} -banner('string.format') -checkallpass('string.format',{somestring,anylua}) -checkallpass('string.format',{numfmts,somenumber}) -checkallpass('string.format',{strfmts,somestring}) -checkallerrors('string.format',{numfmts,notanumber},'bad argument') -checkallerrors('string.format',{strfmts,notastring},'bad argument') -checkallerrors('string.format',{badfmts,somestring},"invalid option '%w'") - --- string.gmatch -banner('string.gmatch') -checkallpass('string.gmatch',{somestring,somestring}) -checkallerrors('string.gmatch',{notastring,somestring},'bad argument') -checkallerrors('string.gmatch',{somestring,notastring},'bad argument') - --- string.gsub -local somerepl = {astring,atable,afunction} -local notarepl = {nil,aboolean,n=2} -banner('string.gsub') -checkallpass('string.gsub',{somestring,somestring,somerepl,{nil,-1,n=2}}) -checkallerrors('string.gsub',{nonstring,somestring,somerepl},'bad argument') -checkallerrors('string.gsub',{somestring,nonstring,somerepl},'bad argument') -checkallerrors('string.gsub',{{astring},{astring},notarepl},'bad argument') -checkallerrors('string.gsub',{{astring},{astring},somerepl,nonnumber},'bad argument') - --- string.len -banner('string.len') -checkallpass('string.len',{somestring}) -checkallerrors('string.len',{notastring},'bad argument') - --- string.lower -banner('string.lower') -checkallpass('string.lower',{somestring}) -checkallerrors('string.lower',{notastring},'bad argument') - --- string.match -banner('string.match') -checkallpass('string.match',{somestring,somestring}) -checkallpass('string.match',{somestring,somestring,{nil,-3,3,n=3}}) -checkallerrors('string.match',{},'bad argument') -checkallerrors('string.match',{nonstring,somestring},'bad argument') -checkallerrors('string.match',{somestring},'bad argument') -checkallerrors('string.match',{somestring,nonstring},'bad argument') -checkallerrors('string.match',{somestring,somestring,notanumber},'bad argument') - --- string.reverse -banner('string.reverse') -checkallpass('string.reverse',{somestring}) -checkallerrors('string.reverse',{notastring},'bad argument') - --- string.rep -banner('string.rep') -checkallpass('string.rep',{somestring,somenumber}) -checkallerrors('string.rep',{notastring,somenumber},'bad argument') -checkallerrors('string.rep',{somestring,notanumber},'bad argument') - --- string.sub -banner('string.sub') -checkallpass('string.sub',{somestring,somenumber}) -checkallpass('string.sub',{somestring,somenumber,somenumber}) -checkallerrors('string.sub',{},'bad argument') -checkallerrors('string.sub',{nonstring,somenumber,somenumber},'bad argument') -checkallerrors('string.sub',{somestring},'bad argument') -checkallerrors('string.sub',{somestring,nonnumber,somenumber},'bad argument') -checkallerrors('string.sub',{somestring,somenumber,nonnumber},'bad argument') - --- string.upper -banner('string.upper') -checkallpass('string.upper',{somestring}) -checkallerrors('string.upper',{notastring},'bad argument') - diff --git a/luaj-2.0.3/test/lua/errors/tablelibargs.lua b/luaj-2.0.3/test/lua/errors/tablelibargs.lua deleted file mode 100644 index 0e85f1f6b..000000000 --- a/luaj-2.0.3/test/lua/errors/tablelibargs.lua +++ /dev/null @@ -1,66 +0,0 @@ -package.path = "?.lua;test/lua/errors/?.lua" -require 'args' - --- arg type tests for table library functions - --- table.concat -local somestringstable = {{8,7,6,5,4,3,2,1,}} -local somenonstringtable = {{true,true,true,true,true,true,true,true,}} -local somesep = {',',1.23} -local notasep = {aboolean,atable,afunction} -local somei = {2,'2','2.2'} -local somej = {4,'4','4.4'} -local notij = {astring,aboolean,atable,afunction} -banner('table.concat') -checkallpass('table.concat',{somestringstable}) -checkallpass('table.concat',{somestringstable,somesep}) -checkallpass('table.concat',{somestringstable,{'-'},somei}) -checkallpass('table.concat',{somestringstable,{'-'},{2},somej}) -checkallerrors('table.concat',{notatable},'bad argument') -checkallerrors('table.concat',{somenonstringtable},'boolean') -checkallerrors('table.concat',{somestringstable,notasep},'bad argument') -checkallerrors('table.concat',{somestringstable,{'-'},notij},'bad argument') -checkallerrors('table.concat',{somestringstable,{'-'},{2},notij},'bad argument') - --- table.insert -banner('table.insert') -checkallpass('table.insert',{sometable,notanil}) -checkallpass('table.insert',{sometable,somei,notanil}) -checkallerrors('table.insert',{notatable,somestring},'bad argument') -checkallerrors('table.insert',{sometable,notij,notanil},'bad argument') - --- table.maxn -banner('table.maxn') -checkallpass('table.maxn',{sometable}) -checkallerrors('table.maxn',{notatable},'bad argument') - --- table.remove -banner('table.remove') -checkallpass('table.remove',{sometable}) -checkallpass('table.remove',{sometable,somei}) -checkallerrors('table.remove',{notatable},'bad argument') -checkallerrors('table.remove',{notatable,somei},'bad argument') -checkallerrors('table.remove',{sometable,notij},'bad argument') - --- table.sort -local somecomp = {nil,afunction,n=2} -local notacomp = {astring,anumber,aboolean,atable} -banner('table.sort') -checkallpass('table.sort',{somestringstable,somecomp}) -checkallerrors('table.sort',{sometable},'attempt to') -checkallerrors('table.sort',{notatable,somecomp},'bad argument') -checkallerrors('table.sort',{sometable,notacomp},'bad argument') - --- table get -banner('table_get - tbl[key]') -function table_get(tbl,key) return tbl[key] end -checkallpass('table_get',{sometable,anylua}) - --- table set -banner('table_set - tbl[key]=val') -function table_set(tbl,key,val) tbl[key]=val end -function table_set_nil_key(tbl,val) tbl[nil]=val end -checkallpass('table_set',{sometable,notanil,anylua}) -checkallerrors('table_set_nil_key',{sometable,anylua},'table index') - - diff --git a/luaj-2.0.3/test/lua/foo.log b/luaj-2.0.3/test/lua/foo.log deleted file mode 100644 index 2b2d01340..000000000 --- a/luaj-2.0.3/test/lua/foo.log +++ /dev/null @@ -1,242 +0,0 @@ -Archive: luaj2.0-tests.zip - inflating: baselib.out - inflating: coroutinelib.out - inflating: debuglib.out - inflating: errors.out - inflating: functions.out - inflating: iolib.out - inflating: manyupvals.out - inflating: mathlib.out - inflating: metatags.out - inflating: oslib.out - inflating: stringlib.out - inflating: tablelib.out - inflating: tailcalls.out - inflating: tmp1.out - inflating: tmp2.out - inflating: upvalues.out - inflating: vm.out - inflating: lua5.1-tests/all.lc - inflating: lua5.1-tests/api.lc - inflating: lua5.1-tests/attrib.lc - inflating: lua5.1-tests/big.lc - inflating: lua5.1-tests/calls.lc - inflating: lua5.1-tests/checktable.lc - inflating: lua5.1-tests/closure.lc - inflating: lua5.1-tests/code.lc - inflating: lua5.1-tests/constructs.lc - inflating: lua5.1-tests/db.lc - inflating: lua5.1-tests/errors.lc - inflating: lua5.1-tests/events.lc - inflating: lua5.1-tests/files.lc - inflating: lua5.1-tests/gc.lc - inflating: lua5.1-tests/literals.lc - inflating: lua5.1-tests/locals.lc - inflating: lua5.1-tests/main.lc - inflating: lua5.1-tests/math.lc - inflating: lua5.1-tests/nextvar.lc - inflating: lua5.1-tests/pm.lc - inflating: lua5.1-tests/sort.lc - inflating: lua5.1-tests/strings.lc - inflating: lua5.1-tests/vararg.lc - inflating: lua5.1-tests/verybig.lc - inflating: regressions/bigattr.lc - inflating: regressions/comparators.lc - inflating: regressions/construct.lc - inflating: regressions/controlchars.lc - inflating: regressions/mathrandomseed.lc - inflating: regressions/modulo.lc - inflating: regressions/varargs.lc - extracting: errors/args.out - inflating: errors/baselibargs.out - inflating: errors/coroutinelibargs.out - inflating: errors/iolibargs.out - inflating: errors/mathlibargs.out - inflating: errors/modulelibargs.out - inflating: errors/operators.out - inflating: errors/stringlibargs.out - inflating: errors/tablelibargs.out - inflating: perf/binarytrees.out - extracting: perf/fannkuch.out - inflating: perf/nbody.out - inflating: perf/nsieve.out -compiling /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/lua5.1-tests all -compiling /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/lua5.1-tests api -compiling /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/lua5.1-tests attrib -compiling /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/lua5.1-tests big -compiling /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/lua5.1-tests calls -compiling /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/lua5.1-tests checktable -compiling /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/lua5.1-tests closure -compiling /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/lua5.1-tests code -compiling /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/lua5.1-tests constructs -compiling /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/lua5.1-tests db -compiling /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/lua5.1-tests errors -compiling /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/lua5.1-tests events -compiling /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/lua5.1-tests files -compiling /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/lua5.1-tests gc -compiling /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/lua5.1-tests literals -compiling /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/lua5.1-tests locals -compiling /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/lua5.1-tests main -compiling /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/lua5.1-tests math -compiling /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/lua5.1-tests nextvar -compiling /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/lua5.1-tests pm -compiling /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/lua5.1-tests sort -compiling /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/lua5.1-tests strings -compiling /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/lua5.1-tests vararg -compiling /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/lua5.1-tests verybig -compiling /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/regressions bigattr -compiling /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/regressions comparators -compiling /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/regressions construct -compiling /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/regressions controlchars -compiling /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/regressions mathrandomseed -compiling /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/regressions modulo -compiling /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/regressions varargs -executing /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/errors args -executing /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/errors baselibargs -executing /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/errors coroutinelibargs -executing /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/errors iolibargs -executing /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/errors mathlibargs -executing /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/errors modulelibargs -executing /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/errors operators -executing /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/errors stringlibargs -executing /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/errors tablelibargs -executing /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/perf binarytrees -executing /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/perf fannkuch -executing /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/perf nbody -executing /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua/perf nsieve -executing /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua baselib -executing /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua coroutinelib -executing /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua debuglib -executing /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua errors -executing /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua functions -executing /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua iolib -executing /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua manyupvals -executing /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua mathlib -executing /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua metatags -executing /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua oslib -executing /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua stringlib -executing /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua tablelib -executing /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua tailcalls -executing /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua upvalues -executing /Users/jrosebor/Workspaces/luaj3/luaj-vm-2.0/test/lua vm - zip warning: name not matched: *.lc - adding: baselib.lua (deflated 81%) - adding: coroutinelib.lua (deflated 74%) - adding: debuglib.lua (deflated 72%) - adding: errors.lua (deflated 80%) - adding: functions.lua (deflated 74%) - adding: iolib.lua (deflated 73%) - adding: manyupvals.lua (deflated 51%) - adding: mathlib.lua (deflated 69%) - adding: metatags.lua (deflated 86%) - adding: oslib.lua (deflated 65%) - adding: stringlib.lua (deflated 71%) - adding: tablelib.lua (deflated 75%) - adding: tailcalls.lua (deflated 65%) - adding: upvalues.lua (deflated 66%) - adding: vm.lua (deflated 76%) - adding: baselib.out (deflated 83%) - adding: coroutinelib.out (deflated 83%) - adding: debuglib.out (deflated 84%) - adding: errors.out (deflated 81%) - adding: functions.out (deflated 75%) - adding: iolib.out (deflated 70%) - adding: manyupvals.out (deflated 91%) - adding: mathlib.out (deflated 80%) - adding: metatags.out (deflated 91%) - adding: oslib.out (deflated 55%) - adding: stringlib.out (deflated 86%) - adding: tablelib.out (deflated 83%) - adding: tailcalls.out (deflated 89%) - adding: tmp1.out (deflated 33%) - adding: tmp2.out (deflated 33%) - adding: upvalues.out (deflated 48%) - adding: vm.out (deflated 79%) - adding: errors/args.lua (deflated 71%) - adding: errors/baselibargs.lua (deflated 78%) - adding: errors/coroutinelibargs.lua (deflated 73%) - adding: errors/iolibargs.lua (deflated 77%) - adding: errors/mathlibargs.lua (deflated 78%) - adding: errors/modulelibargs.lua (deflated 70%) - adding: errors/operators.lua (deflated 82%) - adding: errors/stringlibargs.lua (deflated 81%) - adding: errors/tablelibargs.lua (deflated 76%) - adding: lua5.1-tests/all.lua (deflated 61%) - adding: lua5.1-tests/api.lua (deflated 71%) - adding: lua5.1-tests/attrib.lua (deflated 67%) - adding: lua5.1-tests/big.lua (deflated 66%) - adding: lua5.1-tests/calls.lua (deflated 66%) - adding: lua5.1-tests/checktable.lua (deflated 64%) - adding: lua5.1-tests/closure.lua (deflated 70%) - adding: lua5.1-tests/code.lua (deflated 66%) - adding: lua5.1-tests/constructs.lua (deflated 65%) - adding: lua5.1-tests/db.lua (deflated 70%) - adding: lua5.1-tests/errors.lua (deflated 66%) - adding: lua5.1-tests/events.lua (deflated 73%) - adding: lua5.1-tests/files.lua (deflated 72%) - adding: lua5.1-tests/gc.lua (deflated 69%) - adding: lua5.1-tests/literals.lua (deflated 81%) - adding: lua5.1-tests/locals.lua (deflated 64%) - adding: lua5.1-tests/main.lua (deflated 64%) - adding: lua5.1-tests/math.lua (deflated 68%) - adding: lua5.1-tests/nextvar.lua (deflated 70%) - adding: lua5.1-tests/pm.lua (deflated 69%) - adding: lua5.1-tests/sort.lua (deflated 61%) - adding: lua5.1-tests/strings.lua (deflated 73%) - adding: lua5.1-tests/vararg.lua (deflated 63%) - adding: lua5.1-tests/verybig.lua (deflated 55%) - adding: perf/binarytrees.lua (deflated 61%) - adding: perf/fannkuch.lua (deflated 51%) - adding: perf/nbody.lua (deflated 62%) - adding: perf/nsieve.lua (deflated 56%) - adding: regressions/bigattr.lua (deflated 31%) - adding: regressions/comparators.lua (stored 0%) - adding: regressions/construct.lua (stored 0%) - adding: regressions/controlchars.lua (deflated 11%) - adding: regressions/mathrandomseed.lua (stored 0%) - adding: regressions/modulo.lua (deflated 28%) - adding: regressions/varargs.lua (deflated 79%) - adding: lua5.1-tests/all.lc (deflated 64%) - adding: lua5.1-tests/api.lc (deflated 73%) - adding: lua5.1-tests/attrib.lc (deflated 71%) - adding: lua5.1-tests/big.lc (deflated 70%) - adding: lua5.1-tests/calls.lc (deflated 71%) - adding: lua5.1-tests/checktable.lc (deflated 64%) - adding: lua5.1-tests/closure.lc (deflated 71%) - adding: lua5.1-tests/code.lc (deflated 70%) - adding: lua5.1-tests/constructs.lc (deflated 71%) - adding: lua5.1-tests/db.lc (deflated 70%) - adding: lua5.1-tests/errors.lc (deflated 66%) - adding: lua5.1-tests/events.lc (deflated 76%) - adding: lua5.1-tests/files.lc (deflated 72%) - adding: lua5.1-tests/gc.lc (deflated 68%) - adding: lua5.1-tests/literals.lc (deflated 78%) - adding: lua5.1-tests/locals.lc (deflated 67%) - adding: lua5.1-tests/main.lc (deflated 65%) - adding: lua5.1-tests/math.lc (deflated 73%) - adding: lua5.1-tests/nextvar.lc (deflated 73%) - adding: lua5.1-tests/pm.lc (deflated 74%) - adding: lua5.1-tests/sort.lc (deflated 68%) - adding: lua5.1-tests/strings.lc (deflated 78%) - adding: lua5.1-tests/vararg.lc (deflated 69%) - adding: lua5.1-tests/verybig.lc (deflated 62%) - adding: regressions/bigattr.lc (deflated 50%) - adding: regressions/comparators.lc (deflated 47%) - adding: regressions/construct.lc (deflated 46%) - adding: regressions/controlchars.lc (deflated 34%) - adding: regressions/mathrandomseed.lc (deflated 46%) - adding: regressions/modulo.lc (deflated 51%) - adding: regressions/varargs.lc (deflated 73%) - adding: errors/args.out (stored 0%) - adding: errors/baselibargs.out (deflated 88%) - adding: errors/coroutinelibargs.out (deflated 83%) - adding: errors/iolibargs.out (deflated 88%) - adding: errors/mathlibargs.out (deflated 89%) - adding: errors/modulelibargs.out (deflated 85%) - adding: errors/operators.out (deflated 90%) - adding: errors/stringlibargs.out (deflated 92%) - adding: errors/tablelibargs.out (deflated 89%) - adding: perf/binarytrees.out (deflated 46%) - adding: perf/fannkuch.out (stored 0%) - adding: perf/nbody.out (deflated 12%) - adding: perf/nsieve.out (deflated 49%) diff --git a/luaj-2.0.3/test/lua/functions.lua b/luaj-2.0.3/test/lua/functions.lua deleted file mode 100644 index e55f03579..000000000 --- a/luaj-2.0.3/test/lua/functions.lua +++ /dev/null @@ -1,74 +0,0 @@ - -function f0() print( "f0:" ) end -function f1(a) print( "f1:", a ) end -function f2(a,b) print( "f2:", a, b ) end -function f3(a,b,c) print( "f3:", a, b, c ) end -function f4(a,b,c,d) print( "f4:", a, b, c, d ) end - -f0() f0( "a1/1" ) f0( "a1/2", "a2/2" ) f0( "a1/3", "a2/3", "a3/3" ) f0( "a1/4", "a2/4", "a3/4", "a4/4" ) -f1() f1( "a1/1" ) f1( "a1/2", "a2/2" ) f1( "a1/3", "a2/3", "a3/3" ) f1( "a1/4", "a2/4", "a3/4", "a4/4" ) -f2() f2( "a1/1" ) f2( "a1/2", "a2/2" ) f2( "a1/3", "a2/3", "a3/3" ) f2( "a1/4", "a2/4", "a3/4", "a4/4" ) -f3() f3( "a1/1" ) f3( "a1/2", "a2/2" ) f3( "a1/3", "a2/3", "a3/3" ) f3( "a1/4", "a2/4", "a3/4", "a4/4" ) -f4() f4( "a1/1" ) f4( "a1/2", "a2/2" ) f4( "a1/3", "a2/3", "a3/3" ) f4( "a1/4", "a2/4", "a3/4", "a4/4" ) - -function g0(a,b,c,d) return end -function g1(a,b,c,d) return d end -function g2(a,b,c,d) return c, d end -function g3(a,b,c,d) return b, c, d end -function g4(a,b,c,d) return a, b, c, d end - -z = g0("c0.1/4", "c0.2/4", "c0.3/4", "c0.4/4") -print( "z0:", z ) -z = g2("c2.1/4", "c2.2/4", "c2.3/4", "c2.4/4") -print( "z2:", z ) -z = g4("c4.1/4", "c4.2/4", "c4.3/4", "c4.4/4") -print( "z4:", z ) - -a,b,c,d = g0( "c0.1/4", "c0.2/4", "c0.3/4", "c0.4/4" ) -print( "g0:", a, b, c, d, "(eol)" ) -a,b,c,d = g2( "b2.1/4", "b2.2/4", "b2.3/4", "b2.4/4" ) -print( "g2:", a, b, c, d, "(eol)" ) -a,b,c,d = g4( "b4.1/4", "b4.2/4", "b4.3/4", "b4.4/4" ) -print( "g4:", a, b, c, d, "(eol)" ) - -function func(a,b,c) - return a, b, c -end - -print( func(11, 12, 13) ) -print( func(23, 22, 21) ) -print( func(func(32,33,34), func(45,46,47), func(58,59,50)) ) - -function p(a,...) - print("a",a) - print("...",...) - print("...,a",...,a) - print("a,...",a,...) -end -p() -p("q") -p("q","r") -p("q","r","s") - --- tail call tests -function first(...) - return 'abc', ..., '|', ... -end - -function second(a,...) - return 'def', ..., '|', a, ... -end - -function third( a, b, c ) - print( 'third', first( a, b, c ) ) - print( 'third', second( a, b, c ) ) - return second( a, b, c ) -end - -print( 'third', third() ) -print( 'third', third('p') ) -print( 'third', third('p','q') ) -print( 'third', third('p','q','r') ) -print( 'third', third('p','q','r','s') ) -print( 'third', third() ) - diff --git a/luaj-2.0.3/test/lua/iolib.lua b/luaj-2.0.3/test/lua/iolib.lua deleted file mode 100644 index ec87c0cbd..000000000 --- a/luaj-2.0.3/test/lua/iolib.lua +++ /dev/null @@ -1,141 +0,0 @@ -local platform = ... -print( 'platform', platform ) - --- simple io-library tests --- --- C version on Windows will add change \n into \r\n for text files at least --- -print( io ~= nil ) -print( io.open ~= nil ) -print( io.stdin ~= nil ) -print( io.stdout ~= nil ) -print( io.stderr ~= nil ) -print( 'write', io.write() ) -print( 'write', io.write("This") ) -print( 'write', io.write(" is a pen.") ) -print( 'flush', io.flush() ) - -local f = io.open("abc.txt","w") -print( 'f', type(f) ) -print( io.type(f) ) -print( 'write', f:write("abcdef 12345 \t\t 678910 more\aaaaaaa\bbbbthe rest") ) -print( 'type(f)', io.type(f) ) -print( 'close', f:close() ) -print( 'type(f)', io.type(f) ) -print( 'type("f")', io.type("f") ) - -local g = io.open("abc.txt","r") -local t = { g:read(3, 3, "*n", "*n", "*l", "*l", "*a") } -for i,v in ipairs(t) do - print( string.format("%q",tostring(v)), type(v)) - print( '----- ', i ) -end - -local h,s = io.open("abc.txt", "a") -print( 'h', io.type(h), string.sub(tostring(h),1,6), s ) -print( 'write', h:write('and more and more and more text.') ) -print( 'close', h:close() ) - -if platform ~= 'JME' then - local j = io.open( "abc.txt", "r" ) - print( 'j', io.type(j) ) - print( 'seek', j:seek("set", 3) ) - print( 'read', j:read(4), j:read(3) ) - print( 'seek', j:seek("set", 2) ) - print( 'read', j:read(4), j:read(3) ) - print( 'seek', j:seek("cur", -8 ) ) - print( 'read', j:read(4), j:read(3) ) - print( 'seek(cur,0)', j:seek("cur",0) ) - print( 'seek(cur,20)', j:seek("cur",20) ) - print( 'seek(end,-5)', j:seek("end", -5) ) - print( 'read(4)', string.format("%q", tostring(j:read(4))) ) - print( 'read(4)', string.format("%q", tostring(j:read(4))) ) - print( 'read(4)', string.format("%q", tostring(j:read(4))) ) - print( 'close', j:close() ) -end - --- write a few lines, including a non-terminating one -f = io.open("abc.txt","w") -print( 'f', io.type(f) ) -print( 'write', f:write("line one\nline two\n\nafter blank line\nunterminated line") ) -print( 'type(f)', io.type(f) ) -print( 'close', f:close() ) - --- read using io.lines() -for l in io.lines("abc.txt") do - print( string.format('%q',l) ) -end -io.input("abc.txt") -for l in io.lines() do - print( string.format('%q',l) ) -end -io.input(io.open("abc.txt","r")) -for l in io.lines() do - print( string.format('%q',l) ) -end -io.input("abc.txt") -io.input(io.input()) -for l in io.lines() do - print( string.format('%q',l) ) -end - -local count = 0 -io.tmpfile = function() - count = count + 1 - return io.open("tmp"..count..".out","w") -end - -local a = io.tmpfile() -local b = io.tmpfile() -print( io.type(a) ) -print( io.type(b) ) -print( "a:write", a:write('aaaaaaa') ) -print( "b:write", b:write('bbbbbbb') ) -print( "a:setvbuf", a:setvbuf("no") ) -print( "a:setvbuf", a:setvbuf("full",1024) ) -print( "a:setvbuf", a:setvbuf("line") ) -print( "a:write", a:write('ccccc') ) -print( "b:write", b:write('ddddd') ) -print( "a:flush", a:flush() ) -print( "b:flush", b:flush() ) ---[[ -print( "a:read", a:read(7) ) -print( "b:read", b:read(7) ) -print( "a:seek", a:seek("cur",-4) ) -print( "b:seek", b:seek("cur",-4) ) -print( "a:read", ( a:read(7) ) ) -print( "b:read", ( b:read(7) ) ) -print( "a:seek", a:seek("cur",-8) ) -print( "b:seek", b:seek("cur",-8) ) -print( "a:read", ( a:read(7) ) ) -print( "b:read", ( b:read(7) ) ) ---]] - -local pcall = function(...) - local s,e = pcall(...) - if s then return s end - return s,e:match("closed") -end - -print( 'a:close', pcall( a.close, a ) ) -print( 'a:write', pcall( a.write, a, 'eee') ) -print( 'a:flush', pcall( a.flush, a) ) -print( 'a:read', pcall( a.read, a, 5) ) -print( 'a:lines', pcall( a.lines, a) ) -print( 'a:seek', pcall( a.seek, a, "cur", -2) ) -print( 'a:setvbuf', pcall( a.setvbuf, a, "no") ) -print( 'a:close', pcall( a.close, a ) ) -print( 'io.type(a)', pcall( io.type, a ) ) - -print( 'io.close()', pcall( io.close ) ) -print( 'io.close(io.output())', pcall( io.close, io.output() ) ) - -io.output('abc.txt') -print( 'io.close()', pcall( io.close ) ) -print( 'io.write', pcall( io.write, 'eee') ) -print( 'io.flush', pcall( io.flush) ) -print( 'io.close', pcall( io.close ) ) -io.input('abc.txt'):close() -print( 'io.read', pcall( io.read, 5) ) -print( 'io.lines', pcall( io.lines) ) - diff --git a/luaj-2.0.3/test/lua/luaj2.0-tests.zip b/luaj-2.0.3/test/lua/luaj2.0-tests.zip deleted file mode 100644 index d1213b4c7..000000000 Binary files a/luaj-2.0.3/test/lua/luaj2.0-tests.zip and /dev/null differ diff --git a/luaj-2.0.3/test/lua/manyupvals.lua b/luaj-2.0.3/test/lua/manyupvals.lua deleted file mode 100644 index b72d6fa13..000000000 --- a/luaj-2.0.3/test/lua/manyupvals.lua +++ /dev/null @@ -1,38 +0,0 @@ -local t = {} -local template = [[ - local f - do - local result - function f() - if not result then - result = f() + f() - end - return result - end - end -]] -t[1] = [[ - local f1 - f1 = function() return 1 end -]] -t[2] = [[ - local f2 - f2 = function() return 1 end -]] -for i = 3, 149 do - t[i] = template:gsub("<([^>]+)>", function(s) - local c = assert(loadstring('return '..s), 'could not compile: '..s) - setfenv(c, { i = i }) - return c() - end) -end -t[150] = [[ - print("5th fibonacci number is", f5()) - print("10th fibonacci number is", f10()) - print("149th fibonacci number is", f149()) -]] - -local s = table.concat(t) -print(s) -f = loadstring(s) -f() diff --git a/luaj-2.0.3/test/lua/mathlib.lua b/luaj-2.0.3/test/lua/mathlib.lua deleted file mode 100644 index cf39b6e68..000000000 --- a/luaj-2.0.3/test/lua/mathlib.lua +++ /dev/null @@ -1,223 +0,0 @@ -local platform = ... -print( 'platform', platform ) - -local aliases = { - ['0']='', - ['-0']='', - ['nan']='', - ['inf']='', - ['-inf']='', - ['1.#INF']='', - ['-1.#INF']='', - ['1.#IND']='', - ['-1.#IND']='', -} - -local UNOPVALUES = { -2.5, -2, 0, 2, 2.5, "'-2.5'", "'-2'", "'0'", "'2'", "'2.5'" } - -local NUMBERPAIRS = { - { 2, 0 }, { -2.5, 0 }, { 2, 1 }, - { 5, 2 }, {-5, 2 }, {16, 2}, {-16, -2}, - {256, .25}, - {256, -0.25}, {256, -.25}, {-256, .25}, - { .5, 0}, {.5, 1}, {.5, 2}, {.5, -1}, {.5, 2}, - {2.25, 0}, {2.25, 2}, {2.25, .25}, {2.25, 2.25}, {-2, 0}, - { 3, 3 }, -} - -local STRINGPAIRS = { - { "'2'", "'0'" }, { "'2.5'","'3'" }, { "'-2'", "'1.25'" }, { "'-2.5'", "'-1.25'" }, - { "'3.0'", "'3.0'" }, { 2.75, 2.25 }, { "'2.75'", "'2.25'" }, -} - -local MIXEDPAIRS = { - { 3, "'3'" }, { "'3'", 3 }, { 2.75, "'2.25'" }, { "'2.75'", 2.25 }, - { -3, "'-4'" }, { "'-3'", 4 }, { -3, "'4'" }, { "'-3'", -4 }, - { -4.75, "'2.25'" }, { "'-2.75'", 1.25 }, { 4.75, "'-2.25'" }, { "'2.75'", -1.25 }, -} - -local BINOPVALUES = {} - -local RELATIONALOPVALUES = {} - -local function addall( t, s ) - for i,v in ipairs(s) do - t[#t+1] = v - end -end -addall( BINOPVALUES, NUMBERPAIRS ) -addall( BINOPVALUES, STRINGPAIRS ) -addall( BINOPVALUES, MIXEDPAIRS ) -addall( RELATIONALOPVALUES, NUMBERPAIRS ) -addall( RELATIONALOPVALUES, STRINGPAIRS ) - -local VARARGSVALUES = { - { 4, }, { -4.5 }, { "'5.5'" }, { "'-5'" }, - { 4, "'8'" }, { -4.5, "'-8'" }, { "'5.5'", 2.2 }, { "'-5'", -2.2 }, - { 111,222,333 }, { -222,-333,-111 }, { 444,-111,-222 }, -} - -local CONSTANTS = { - "huge", "pi", -} -local UNARYOPS = { - "-", "not ", -} -local BINARYOPS = { - "+", "-", "*", "^", "/", "%", -} -local RELATIONALS = { - "==", "~=", ">", "<", ">=", "<=", -} -local ONEARG_JME = { - "abs", "ceil", "cos", "deg", - "exp", "floor", "frexp", "modf", - "rad", "sin", "sqrt", "tan", -} -local ONEARG_JSE = { - "acos", "asin", "atan", "cosh", - "log", "log10", "sinh", "tanh", -} -local TWOARGS_JME = { - "fmod", "ldexp", "pow", -} -local TWOARGS_JSE = { - "atan2", -} -local VARARGSFUNCS = { - "max", "min", -} - -local ts = tostring -tostring = function(x) - local s = ts(x) - if type(x)~='number' then return s end - if aliases[s] then return aliases[s] end - if #s < 7 then return s end - local a,b = string.match(s,'([%-0-9%.]*)([eE]?[%-0-9]*)') - return a and (string.sub(a,1,6)..(b or '')) or s -end - -local function eval( expr, script ) - script = script or ('return '..expr) - local s,a,b = loadstring( script, 'expr' ) - if s then print( expr, pcall( s ) ) - else print( expr, 'loadstring:', a ) end -end - --- misc tests -print( '---------- miscellaneous tests ----------' ) -eval( 'math.sin( 0.0 )' ) -eval( 'math.cos( math.pi )' ) -eval( 'math.sqrt( 9.0 )' ) -eval( 'math.modf( 5.25 )') -eval( 'math.frexp(0.00625)' ) -eval( '-5 ^ 2' ) -eval( '-5 / 2' ) -eval( '-5 % 2' ) - --- constants -print( '---------- constants ----------' ) -for i,v in ipairs(CONSTANTS) do - eval( 'math.'..v ) -end - --- unary operators -for i,v in ipairs(UNARYOPS) do - print( '---------- unary operator '..v..' ----------' ) - for j,a in ipairs(UNOPVALUES) do - eval( v..a, 'return '..v..a ) - end -end - --- binary operators -for i,v in ipairs(BINARYOPS) do - print( '---------- binary operator '..v..' ----------' ) - for j,xy in ipairs(BINOPVALUES) do - eval( xy[1]..v..xy[2], - 'local x,y='..xy[1]..','..xy[2]..'; return x'..v..'y' ) - end -end - --- relational operators -for i,v in ipairs(RELATIONALS) do - print( '---------- binary operator '..v..' ----------' ) - for j,xy in ipairs(RELATIONALOPVALUES) do - eval( xy[1]..v..xy[2], - 'local x,y='..xy[1]..','..xy[2]..'; return x'..v..'y' ) - end -end - --- one-argument math functions -for i,v in ipairs(ONEARG_JME) do - print( '---------- math.'..v..' ----------' ) - for j,x in ipairs(UNOPVALUES) do - eval( 'math.'..v..'('..x..')' ) - end -end -if platform ~= 'JME' then - for i,v in ipairs(ONEARG_JSE) do - print( '---------- math.'..v..' (jse only) ----------' ) - for j,x in ipairs(UNOPVALUES) do - eval( 'math.'..v..'('..x..')' ) - end - end -end - --- two-argument math functions -for i,v in ipairs(TWOARGS_JME) do - print( '---------- math.'..v..' ----------' ) - for j,x in ipairs(BINOPVALUES) do - eval( 'math.'..v..'('..x[1]..','..x[2]..')' ) - end -end -if platform ~= 'JME' then - for i,v in ipairs(TWOARGS_JSE) do - print( '---------- math.'..v..' (jse only) ----------' ) - for j,x in ipairs(BINOPVALUES) do - eval( 'math.'..v..'('..x[1]..','..x[2]..')' ) - end - end -end - --- var-arg math functions -for i,v in ipairs(VARARGSFUNCS) do - print( '---------- math.'..v..' ----------' ) - for j,x in ipairs(VARARGSVALUES) do - eval( 'math.'..v..'('..table.concat(x,',')..')' ) - end -end - --- random tests -print("----------- Random number tests") -local function testrandom(string,lo,hi) - local c,e = loadstring('return '..string) - for i=1,5 do - local s,e = pcall(c) - if s then - print( string, s and type(e) or e, (e>=lo) and (e<=hi) ) - else - print( string, 'error', e ) - end - end -end -testrandom('math.random()',0,1) -testrandom('math.random(5,10)',5,10) -testrandom('math.random(30)',0,30) -testrandom('math.random(-4,-2)',-4,-2) -local t = {} -print( math.randomseed(20) ) -for i=1,20 do - t[i] = math.random() -end -print( '-- comparing new numbers') -for i=1,20 do - print( t[i] == math.random(), t[i] == t[0] ) -end -print( '-- resetting seed') - -print( math.randomseed(20) ) -for i=1,20 do - print( t[i] == math.random() ) -end ---]] diff --git a/luaj-2.0.3/test/lua/metatags.lua b/luaj-2.0.3/test/lua/metatags.lua deleted file mode 100644 index 676590be5..000000000 --- a/luaj-2.0.3/test/lua/metatags.lua +++ /dev/null @@ -1,286 +0,0 @@ -local anumber,bnumber = 111,23.45 -local astring,bstring = "abc","def" -local anumstr,bnumstr = tostring(anumber),tostring(bnumber) -local aboolean,bboolean = false,true -local afunction,bfunction = function() end, function() end -local athread,bthead = coroutine.create(afunction),coroutine.create(bfunction) -local atable,btable = {},{} -local values = { anumber, aboolean, afunction, athread, atable } -local groups -local ts = tostring -local tb,count = {},0 - -tostring = function(o) - local t = type(o) - if t~='thread' and t~='function' and t~='table' then return ts(o) end - if not tb[o] then - count = count + 1 - tb[o] = t..'.'..count - end - return tb[o] -end - -local buildop = function(name) - return function(a,b) - print( 'mt.__'..name..'()', a, b ) - return '__'..name..'-result' - end -end -local buildop3 = function(name) - return function(a,b,c) - print( 'mt.__'..name..'()', a, b, c ) - return '__'..name..'-result' - end -end -local buildop1 = function(name) - return function(a) - print( 'mt.__'..name..'()', a ) - return '__'..name..'-result' - end -end - -local mt = { - __call=buildop('call'), - __add=buildop('add'), - __sub=buildop('sub'), - __mul=buildop('mul'), - __div=buildop('div'), - __pow=buildop('pow'), - __mod=buildop('mod'), - __unm=buildop1('unm'), - __len=buildop1('len'), - __lt=buildop('lt'), - __le=buildop('le'), - __index=buildop('index'), - __newindex=buildop3('newindex'), - __concat=buildop('concat'), -} - --- pcall a function and check for a pattern in the error string -ecall = function(pattern, ...) - local s,e = pcall(...) - if not s then e = string.match(e,pattern) or e end - return s,e -end - -print( '---- __eq same types' ) -local eqmt = { __eq=buildop('eq'), } -groups = { {nil,nil}, {true,false}, {123,456}, {11,5.5}, {afunction,bfunction}, {athread,bthread}, {astring,bstring}, {anumber,anumstr} } -for i=1,#groups do - local a,b = groups[i][1], groups[i][2] - local amt,bmt = debug.getmetatable(a),debug.getmetatable(b) - print( type(a), type(b), 'before', pcall( function() return a==b end ) ) - print( type(a), type(b), 'before', pcall( function() return a~=b end ) ) - print( debug.setmetatable( a, eqmt ) ) - print( debug.setmetatable( b, eqmt ) ) - print( type(a), type(b), 'after', pcall( function() return a==b end ) ) - print( type(a), type(b), 'after', pcall( function() return a~=b end ) ) - print( debug.setmetatable( a, amt ) ) - print( debug.setmetatable( b, bmt ) ) -end - -print( '---- __eq, tables - should invoke metatag comparison' ) -groups = { {atable,btable} } -for i=1,#groups do - local a,b = groups[i][1], groups[i][2] - local amt,bmt = debug.getmetatable(a),debug.getmetatable(b) - print( type(a), type(b), 'before', pcall( function() return a==b end ) ) - print( type(a), type(b), 'before', pcall( function() return a~=b end ) ) - print( debug.setmetatable( a, eqmt ) ) - print( debug.setmetatable( b, eqmt ) ) - print( type(a), type(b), 'after-a', pcall( function() return a==b end ) ) - print( type(a), type(b), 'after-a', pcall( function() return a~=b end ) ) - print( debug.setmetatable( a, amt ) ) - print( debug.setmetatable( b, bmt ) ) -end - - -print( 'nilmt', debug.getmetatable(nil) ) -print( 'boolmt', debug.getmetatable(true) ) -print( 'number', debug.getmetatable(1) ) -print( 'function', debug.getmetatable(afunction) ) -print( 'thread', debug.getmetatable(athread) ) - -print( '---- __call' ) -for i=1,#values do - local a = values[i] - local amt = debug.getmetatable(a) - print( type(a), 'before', ecall( 'attempt to call', function() return a('a','b') end ) ) - print( debug.setmetatable( a, mt ) ) - print( type(a), 'after', pcall( function() return a() end ) ) - print( type(a), 'after', pcall( function() return a('a') end ) ) - print( type(a), 'after', pcall( function() return a('a','b') end ) ) - print( type(a), 'after', pcall( function() return a('a','b','c') end ) ) - print( type(a), 'after', pcall( function() return a('a','b','c','d') end ) ) - print( debug.setmetatable( a, amt ) ) -end - -print( '---- __add, __sub, __mul, __div, __pow, __mod' ) -local groups = { {aboolean, aboolean}, {aboolean, athread}, {aboolean, afunction}, {aboolean, "abc"}, {aboolean, atable} } -for i=1,#groups do - local a,b = groups[i][1], groups[i][2] - local amt,bmt = debug.getmetatable(a),debug.getmetatable(b) - print( type(a), type(b), 'before', ecall( 'attempt to perform arithmetic', function() return a+b end ) ) - print( type(a), type(b), 'before', ecall( 'attempt to perform arithmetic', function() return b+a end ) ) - print( type(a), type(b), 'before', ecall( 'attempt to perform arithmetic', function() return a-b end ) ) - print( type(a), type(b), 'before', ecall( 'attempt to perform arithmetic', function() return b-a end ) ) - print( type(a), type(b), 'before', ecall( 'attempt to perform arithmetic', function() return a*b end ) ) - print( type(a), type(b), 'before', ecall( 'attempt to perform arithmetic', function() return b*a end ) ) - print( type(a), type(b), 'before', ecall( 'attempt to perform arithmetic', function() return a^b end ) ) - print( type(a), type(b), 'before', ecall( 'attempt to perform arithmetic', function() return b^a end ) ) - print( type(a), type(b), 'before', ecall( 'attempt to perform arithmetic', function() return a%b end ) ) - print( type(a), type(b), 'before', ecall( 'attempt to perform arithmetic', function() return b%a end ) ) - print( debug.setmetatable( a, mt ) ) - print( type(a), type(b), 'after', pcall( function() return a+b end ) ) - print( type(a), type(b), 'after', pcall( function() return b+a end ) ) - print( type(a), type(b), 'after', pcall( function() return a-b end ) ) - print( type(a), type(b), 'after', pcall( function() return b-a end ) ) - print( type(a), type(b), 'after', pcall( function() return a*b end ) ) - print( type(a), type(b), 'after', pcall( function() return b*a end ) ) - print( type(a), type(b), 'after', pcall( function() return a^b end ) ) - print( type(a), type(b), 'after', pcall( function() return b^a end ) ) - print( type(a), type(b), 'after', pcall( function() return a%b end ) ) - print( type(a), type(b), 'after', pcall( function() return b%a end ) ) - print( debug.setmetatable( a, amt ) ) - print( debug.setmetatable( b, bmt ) ) -end - -print( '---- __len' ) -values = { aboolean, afunction, athread, anumber } -for i=1,#values do - local a = values[i] - local amt = debug.getmetatable(a) - print( type(a), 'before', ecall( 'attempt to get length of ', function() return #a end ) ) - print( debug.setmetatable( a, mt ) ) - print( type(a), 'after', pcall( function() return #a end ) ) - print( debug.setmetatable( a, amt ) ) -end --- -print( '---- __neg' ) -values = { aboolean, afunction, athread, "abcd", atable, anumber } -for i=1,#values do - local a = values[i] - local amt = debug.getmetatable(a) - print( type(v), 'before', ecall( 'attempt to perform arithmetic ', function() return -a end ) ) - print( debug.setmetatable( a, mt ) ) - print( type(v), 'after', pcall( function() return -a end ) ) - print( debug.setmetatable( a, amt ) ) -end - -print( '---- __lt, __le, same types' ) -local bfunction = function() end -local bthread = coroutine.create( bfunction ) -local btable = {} -local groups -groups = { {true, true}, {true, false}, {afunction, bfunction}, {athread, bthread}, {atable, atable}, {atable, btable} } -for i=1,#groups do - local a,b = groups[i][1], groups[i][2] - local amt,bmt = debug.getmetatable(a),debug.getmetatable(b) - print( type(a), type(b), 'before', ecall( 'attempt to compare', function() return ab end ) ) - print( type(a), type(b), 'before', ecall( 'attempt to compare', function() return a>=b end ) ) - print( debug.setmetatable( a, mt ) ) - print( debug.setmetatable( b, mt ) ) - print( type(a), type(b), 'after', pcall( function() return ab end ) ) - print( type(a), type(b), 'after', pcall( function() return a>=b end ) ) - print( debug.setmetatable( a, amt ) ) - print( debug.setmetatable( b, bmt ) ) -end - -print( '---- __lt, __le, different types' ) -groups = { {aboolean, athread}, } -for i=1,#groups do - local a,b = groups[i][1], groups[i][2] - local amt,bmt = debug.getmetatable(a),debug.getmetatable(b) - print( type(a), type(b), 'before', ecall( 'attempt to compare', function() return ab end ) ) - print( type(a), type(b), 'before', ecall( 'attempt to compare', function() return a>=b end ) ) - print( debug.setmetatable( a, mt ) ) - print( debug.setmetatable( b, mt ) ) - print( type(a), type(b), 'after-a', ecall( 'attempt to compare', function() return ab end ) ) - print( type(a), type(b), 'after-a', ecall( 'attempt to compare', function() return a>=b end ) ) - print( debug.setmetatable( a, amt ) ) - print( debug.setmetatable( b, bmt ) ) -end - -print( '---- __tostring' ) -values = { aboolean, afunction, athread, atable, "abc" } -local strmt = { __tostring=function(a) - return 'mt.__tostring('..type(a)..')' - end, -} -for i=1,#values do - local a = values[i] - local amt = debug.getmetatable(a) - print( debug.setmetatable( a, strmt ) ) - print( type(a), 'after', pcall( function() return ts(a) end ) ) - print( debug.setmetatable( a, amt ) ) -end - -print( '---- __index, __newindex' ) -values = { aboolean, anumber, afunction, athread } -for i=1,#values do - local a = values[i] - local amt = debug.getmetatable(a) - print( type(a), 'before', ecall( 'attempt to index', function() return a.foo end ) ) - print( type(a), 'before', ecall( 'attempt to index', function() return a[123] end ) ) - print( type(a), 'before', ecall( 'index', function() a.foo = 'bar' end ) ) - print( type(a), 'before', ecall( 'index', function() a[123] = 'bar' end ) ) - print( type(a), 'before', ecall( 'attempt to index', function() return a:foo() end ) ) - print( debug.setmetatable( a, mt ) ) - print( type(a), 'after', pcall( function() return a.foo end ) ) - print( type(a), 'after', pcall( function() return a[123] end ) ) - print( type(a), 'after', pcall( function() a.foo = 'bar' end ) ) - print( type(a), 'after', pcall( function() a[123] = 'bar' end ) ) - print( type(a), 'after', ecall( 'attempt to call', function() return a:foo() end ) ) - print( debug.setmetatable( a, amt ) ) -end - -print( '---- __concat' ) -groups = { {atable, afunction}, {afunction, atable}, {123, nil}, {nil, 123} } -local s,t,u = 'sss',777 -local concatresult = setmetatable( { '__concat-result' }, { - __tostring=function() - return 'concat-string-result' - end } ) -local concatmt = { - __concat=function(a,b) - print( 'mt.__concat('..type(a)..','..type(b)..')', a, b ) - return concatresult - end -} -for i=1,#groups do - local a,b = groups[i][1], groups[i][2] - local amt,bmt = debug.getmetatable(a),debug.getmetatable(b) - print( type(a), type(b), 'before', ecall( 'attempt to concatenate ', function() return a..b end ) ) - print( type(a), type(b), 'before', ecall( 'attempt to concatenate ', function() return b..a end ) ) - print( type(a), type(s), type(t), 'before', ecall( 'attempt to concatenate ', function() return a..s..t end ) ) - print( type(s), type(a), type(t), 'before', ecall( 'attempt to concatenate ', function() return s..a..t end ) ) - print( type(s), type(t), type(a), 'before', ecall( 'attempt to concatenate ', function() return s..t..a end ) ) - print( debug.setmetatable( a, concatmt ) ) - print( type(a), type(b), 'after', pcall( function() return a..b end ) ) - print( type(a), type(b), 'after', pcall( function() return b..a end ) ) - print( type(a), type(s), type(t), 'before', pcall( function() return a..s..t end ) ) - print( type(s), type(a), type(t), 'before', ecall( 'attempt to concatenate ', function() return s..a..t end ) ) - print( type(s), type(t), type(a), 'before', ecall( 'attempt to concatenate ', function() return s..t..a end ) ) - print( debug.setmetatable( a, amt ) ) - print( debug.setmetatable( b, bmt ) ) -end - -print( '---- __metatable' ) -values = { aboolean, afunction, athread, atable, "abc" } -local mtmt = { __metatable={}, } -for i=1,#values do - local a = values[i] - local amt = debug.getmetatable(a) - print( type(a), 'before', pcall( function() return debug.getmetatable(a), getmetatable(a) end ) ) - print( debug.setmetatable( a, mtmt ) ) - print( type(a), 'after', pcall( function() return debug.getmetatable(a), getmetatable(a) end ) ) - print( debug.setmetatable( a, amt ) ) -end diff --git a/luaj-2.0.3/test/lua/oslib.lua b/luaj-2.0.3/test/lua/oslib.lua deleted file mode 100644 index a46c4bdb4..000000000 --- a/luaj-2.0.3/test/lua/oslib.lua +++ /dev/null @@ -1,40 +0,0 @@ --- simple os-library tests --- --- because the nature of the "os" library is to provide os-specific behavior, --- the compatibility tests must be extremely loose, and can really only --- compare things like return value type to be meaningful. --- --- actual os behavior needs to go in an oslib function test --- -local pcall = function(...) - local s,e,f = pcall(...) - return s,type(e) -end -print( 'os', type(os) ) -print( 'os.clock()', pcall( os.clock ) ) -print( 'os.date()', pcall( os.date ) ) -print( 'os.difftime(123000, 21500)', pcall( os.difftime, 123000, 21250 ) ) -print( 'os.execute("bogus")', pcall( os.execute, '' ) ) -print( 'os.getenv()', pcall( os.getenv ) ) -print( 'os.getenv("bogus.key")', pcall( os.getenv, 'bogus.key' ) ) -local s,p = pcall( os.tmpname ) -local s,q = pcall( os.tmpname ) -print( 'os.tmpname()', s, p ) -print( 'os.tmpname()', s, q ) --- permission denied on windows ---print( 'os.remove(p)', pcall( os.remove, p ) ) ---print( 'os.rename(p,q)', pcall( os.rename, p, q ) ) -local s,f = pcall( io.open, p,"w" ) -print( 'io.open', s, f ) -print( 'write', pcall( f.write, f, "abcdef 12345" ) ) -print( 'close', pcall( f.close, f ) ) -print( 'os.rename(p,q)', pcall( os.rename, p, q ) ) -print( 'os.remove(q)', pcall( os.remove, q ) ) -print( 'os.remove(q)', pcall( os.remove, q ) ) --- setlocale not supported on jse yet --- print( 'os.setlocale()', pcall( os.setlocale ) ) --- print( 'os.setlocale("jp")', pcall( os.setlocale, "jp" ) ) --- print( 'os.setlocale("us","monetary")', pcall( os.setlocale, "us", "monetary" ) ) --- print( 'os.setlocale(nil,"all")', pcall( os.setlocale, nil, "all" ) ) -print( 'os.setlocale("C")', pcall( os.setlocale, "C" ) ) -print( 'os.exit', type(os.exit) ) diff --git a/luaj-2.0.3/test/lua/perf/binarytrees.lua b/luaj-2.0.3/test/lua/perf/binarytrees.lua deleted file mode 100644 index 04ca7eee0..000000000 --- a/luaj-2.0.3/test/lua/perf/binarytrees.lua +++ /dev/null @@ -1,50 +0,0 @@ --- The Computer Language Benchmarks Game --- http://shootout.alioth.debian.org/ --- contributed by Mike Pall - -local function BottomUpTree(item, depth) - if depth > 0 then - local i = item + item - depth = depth - 1 - local left, right = BottomUpTree(i-1, depth), BottomUpTree(i, depth) - return { item, left, right } - else - return { item } - end -end - -local function ItemCheck(tree) - if tree[2] then - return tree[1] + ItemCheck(tree[2]) - ItemCheck(tree[3]) - else - return tree[1] - end -end - -local N = tonumber(arg and arg[1]) or 0 -local mindepth = 4 -local maxdepth = mindepth + 2 -if maxdepth < N then maxdepth = N end - -do - local stretchdepth = maxdepth + 1 - local stretchtree = BottomUpTree(0, stretchdepth) - io.write(string.format("stretch tree of depth %d\t check: %d\n", - stretchdepth, ItemCheck(stretchtree))) -end - -local longlivedtree = BottomUpTree(0, maxdepth) - -for depth=mindepth,maxdepth,2 do - local iterations = 2 ^ (maxdepth - depth + mindepth) - local check = 0 - for i=1,iterations do - check = check + ItemCheck(BottomUpTree(1, depth)) + - ItemCheck(BottomUpTree(-1, depth)) - end - io.write(string.format("%d\t trees of depth %d\t check: %d\n", - iterations*2, depth, check)) -end - -io.write(string.format("long lived tree of depth %d\t check: %d\n", - maxdepth, ItemCheck(longlivedtree))) diff --git a/luaj-2.0.3/test/lua/perf/fannkuch.lua b/luaj-2.0.3/test/lua/perf/fannkuch.lua deleted file mode 100644 index 4fd7b5111..000000000 --- a/luaj-2.0.3/test/lua/perf/fannkuch.lua +++ /dev/null @@ -1,51 +0,0 @@ --- The Computer Language Benchmarks Game --- http://shootout.alioth.debian.org/ --- contributed by Mike Pall - -local function fannkuch(n) - local p, q, s, odd, check, maxflips = {}, {}, {}, true, 0, 0 - for i=1,n do p[i] = i; q[i] = i; s[i] = i end - repeat - -- Print max. 30 permutations. - if check < 30 then - if not p[n] then return maxflips end -- Catch n = 0, 1, 2. - io.write(unpack(p)); io.write("\n") - check = check + 1 - end - -- Copy and flip. - local q1 = p[1] -- Cache 1st element. - if p[n] ~= n and q1 ~= 1 then -- Avoid useless work. - for i=2,n do q[i] = p[i] end -- Work on a copy. - for flips=1,1000000 do -- Flip ... - local qq = q[q1] - if qq == 1 then -- ... until 1st element is 1. - if flips > maxflips then maxflips = flips end -- New maximum? - break - end - q[q1] = q1 - if q1 >= 4 then - local i, j = 2, q1 - 1 - repeat q[i], q[j] = q[j], q[i]; i = i + 1; j = j - 1; until i >= j - end - q1 = qq - end - end - -- Permute. - if odd then - p[2], p[1] = p[1], p[2]; odd = false -- Rotate 1<-2. - else - p[2], p[3] = p[3], p[2]; odd = true -- Rotate 1<-2 and 1<-2<-3. - for i=3,n do - local sx = s[i] - if sx ~= 1 then s[i] = sx-1; break end - if i == n then return maxflips end -- Out of permutations. - s[i] = i - -- Rotate 1<-...<-i+1. - local t = p[1]; for j=1,i do p[j] = p[j+1] end; p[i+1] = t - end - end - until false -end - -local n = tonumber(arg and arg[1]) or 1 -io.write("Pfannkuchen(", n, ") = ", fannkuch(n), "\n") diff --git a/luaj-2.0.3/test/lua/perf/nbody.lua b/luaj-2.0.3/test/lua/perf/nbody.lua deleted file mode 100644 index 91d7d5c6f..000000000 --- a/luaj-2.0.3/test/lua/perf/nbody.lua +++ /dev/null @@ -1,123 +0,0 @@ --- The Great Computer Language Shootout --- http://shootout.alioth.debian.org/ --- contributed by Isaac Gouy, tuned by Mike Pall - -local sqrt = math.sqrt - -local PI = 3.141592653589793 -local SOLAR_MASS = 4 * PI * PI -local DAYS_PER_YEAR = 365.24 - -local Jupiter = { - x = 4.84143144246472090e+00 - ,y = -1.16032004402742839e+00 - ,z = -1.03622044471123109e-01 - ,vx = 1.66007664274403694e-03 * DAYS_PER_YEAR - ,vy = 7.69901118419740425e-03 * DAYS_PER_YEAR - ,vz = -6.90460016972063023e-05 * DAYS_PER_YEAR - ,mass = 9.54791938424326609e-04 * SOLAR_MASS -} - -local Saturn = { - x = 8.34336671824457987e+00 - ,y = 4.12479856412430479e+00 - ,z = -4.03523417114321381e-01 - ,vx = -2.76742510726862411e-03 * DAYS_PER_YEAR - ,vy = 4.99852801234917238e-03 * DAYS_PER_YEAR - ,vz = 2.30417297573763929e-05 * DAYS_PER_YEAR - ,mass = 2.85885980666130812e-04 * SOLAR_MASS -} - -local Uranus = { - x = 1.28943695621391310e+01 - ,y = -1.51111514016986312e+01 - ,z = -2.23307578892655734e-01 - ,vx = 2.96460137564761618e-03 * DAYS_PER_YEAR - ,vy = 2.37847173959480950e-03 * DAYS_PER_YEAR - ,vz = -2.96589568540237556e-05 * DAYS_PER_YEAR - ,mass = 4.36624404335156298e-05 * SOLAR_MASS -} - -local Neptune = { - x = 1.53796971148509165e+01 - ,y = -2.59193146099879641e+01 - ,z = 1.79258772950371181e-01 - ,vx = 2.68067772490389322e-03 * DAYS_PER_YEAR - ,vy = 1.62824170038242295e-03 * DAYS_PER_YEAR - ,vz = -9.51592254519715870e-05 * DAYS_PER_YEAR - ,mass = 5.15138902046611451e-05 * SOLAR_MASS -} - -local Sun = { x = 0, y = 0, z = 0, - vx = 0, vy = 0, vz = 0, mass = SOLAR_MASS } - -local function advance(bodies, nbody, dt) - for i=1,nbody do - local bi = bodies[i] - local bix, biy, biz, bimass = bi.x, bi.y, bi.z, bi.mass - local bivx, bivy, bivz = bi.vx, bi.vy, bi.vz - for j=i+1,nbody do - local bj = bodies[j] - local dx, dy, dz = bix-bj.x, biy-bj.y, biz-bj.z - local distance = sqrt(dx*dx + dy*dy + dz*dz) - local mag = dt / (distance * distance * distance) - local bim, bjm = bimass*mag, bj.mass*mag - bivx = bivx - (dx * bjm) - bivy = bivy - (dy * bjm) - bivz = bivz - (dz * bjm) - bj.vx = bj.vx + (dx * bim) - bj.vy = bj.vy + (dy * bim) - bj.vz = bj.vz + (dz * bim) - end - bi.vx = bivx - bi.vy = bivy - bi.vz = bivz - end - for i=1,nbody do - local bi = bodies[i] - bi.x = bi.x + (dt * bi.vx) - bi.y = bi.y + (dt * bi.vy) - bi.z = bi.z + (dt * bi.vz) - end -end - - -local function energy(bodies, nbody) - local e = 0 - for i=1,nbody do - local bi = bodies[i] - local vx, vy, vz, bim = bi.vx, bi.vy, bi.vz, bi.mass - e = e + (0.5 * bim * (vx*vx + vy*vy + vz*vz)) - for j=i+1,nbody do - local bj = bodies[j] - local dx, dy, dz = bi.x-bj.x, bi.y-bj.y, bi.z-bj.z - local distance = sqrt(dx*dx + dy*dy + dz*dz) - e = e - ((bim * bj.mass) / distance) - end - end - return e -end - - -local function offsetMomentum(b, nbody) - local px, py, pz = 0, 0, 0 - for i=1,nbody do - local bi = b[i] - local bim = bi.mass - px = px + (bi.vx * bim) - py = py + (bi.vy * bim) - pz = pz + (bi.vz * bim) - end - b[1].vx = -px / SOLAR_MASS - b[1].vy = -py / SOLAR_MASS - b[1].vz = -pz / SOLAR_MASS -end - -local N = tonumber(arg and arg[1]) or 1000 -local bodies = { Sun, Jupiter, Saturn, Uranus, Neptune } -local nbody = table.getn(bodies) - -offsetMomentum(bodies, nbody) -io.write( string.format("%0.9f",energy(bodies, nbody)), "\n") -for i=1,N do advance(bodies, nbody, 0.01) end -io.write( string.format("%0.9f",energy(bodies, nbody)), "\n") diff --git a/luaj-2.0.3/test/lua/perf/nsieve.lua b/luaj-2.0.3/test/lua/perf/nsieve.lua deleted file mode 100644 index 475a05b46..000000000 --- a/luaj-2.0.3/test/lua/perf/nsieve.lua +++ /dev/null @@ -1,35 +0,0 @@ --- The Computer Language Shootout --- http://shootout.alioth.debian.org/ --- contributed by Isaac Gouy --- modified by Mike Pall - - -local function nsieve(m,isPrime) - for i=2,m do - isPrime[i] = true - end - local count = 0 - - for i=2,m do - if isPrime[i] then - for k=i+i, m, i do - if isPrime[k] then isPrime[k] = false end - end - count = count + 1 - end - end - return count -end - - -local n = tonumber(arg and arg[1]) or 1 -local flags = {} - -local m = (2^n)*10000 -print( string.format("Primes up to %8d %8d", m, nsieve(m,flags))) - -m = (2^(n-1))*10000 -print( string.format("Primes up to %8d %8d", m, nsieve(m,flags))) - -m = (2^(n-2))*10000 -print( string.format("Primes up to %8d %8d", m, nsieve(m,flags))) diff --git a/luaj-2.0.3/test/lua/repack.sh b/luaj-2.0.3/test/lua/repack.sh deleted file mode 100644 index de30ed2e6..000000000 --- a/luaj-2.0.3/test/lua/repack.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -# -# unpack the luaj test archive, compile and run it locally, and repack the results -# -if [ ! -x "$LUA51" -o ! -x "$LUA51C" ]; then - echo "LUA51 and LUA51C must be set to version 5.1 lua and luac" - exit -1 -fi - -# unzip existing archive -ZIP="luaj2.0-tests.zip" -unzip -n ${ZIP} -rm *.lc *.out */*.lc */*.out - -# compile tests for compiler and save binary files -for DIR in "lua5.1-tests" "regressions"; do - cd ${DIR} - FILES=`ls -1 *.lua | awk 'BEGIN { FS="." } ; { print $1 }'` - for FILE in $FILES ; do - echo 'compiling' `pwd` $FILE - ${LUA51C} ${FILE}.lua - mv luac.out ${FILE}.lc - done - cd .. -done - -# run test lua scripts and save output -for DIR in "errors" "perf" "."; do - cd ${DIR} - FILES=`ls -1 *.lua | awk 'BEGIN { FS="." } ; { print $1 }'` - for FILE in $FILES ; do - echo 'executing' `pwd` $FILE - ${LUA51} ${FILE}.lua JSE > ${FILE}.out - done - cd .. -done -cd lua - -# create new zipfile -rm -f ${ZIP} -zip ${ZIP} *.lua *.lc *.out */*.lua */*.lc */*.out - -# cleanup -rm *.out */*.lc */*.out *.txt */*.txt -rm -r lua5.1-tests -rm -r regressions diff --git a/luaj-2.0.3/test/lua/stringlib.lua b/luaj-2.0.3/test/lua/stringlib.lua deleted file mode 100644 index 83cce2dbc..000000000 --- a/luaj-2.0.3/test/lua/stringlib.lua +++ /dev/null @@ -1,184 +0,0 @@ -print( string.find("1234567890", ".", 0, true) ) -print( string.find( 'alo alx 123 b\0o b\0o', '(..*) %1' ) ) -print( string.find( 'aloALO', '%l*' ) ) -print( string.find( ' \n isto � assim', '%S%S*' ) ) - -print( string.find( "", "" ) ) -print( string.find( "ababaabbaba", "abb" ) ) -print( string.find( "ababaabbaba", "abb", 7 ) ) - -print( string.match( "aabaa", "a*" ) ) -print( string.match( "aabaa", "a*", 3 ) ) -print( string.match( "aabaa", "a*b" ) ) -print( string.match( "aabaa", "a*b", 3 ) ) - -print( string.match( "abbaaababaabaaabaa", "b(a*)b" ) ) - -print( string.match( "abbaaababaabaaabaa", "b(a*)()b" ) ) -print( string.match( "abbaaababaabaaabaa", "b(a*)()b", 3 ) ) -print( string.match( "abbaaababaabaaabaa", "b(a*)()b", 8 ) ) -print( string.match( "abbaaababaabaaabaa", "b(a*)()b", 12 ) ) - -print( string.byte("hi", -3) ) - -print( string.gsub("ABC", "@(%x+)", function(s) return "|abcd" end) ) -print( string.gsub("@123", "@(%x+)", function(s) return "|abcd" end) ) -print( string.gsub("ABC@123", "@(%x+)", function(s) return "|abcd" end) ) -print( string.gsub("ABC@123@def", "@(%x+)", function(s) return "|abcd" end) ) -print( string.gsub("ABC@123@qrs@def@tuv", "@(%x+)", function(s) return "|abcd" end) ) -print( string.gsub("ABC@123@qrs@def@tuv", "@(%x+)", function(s) return "@ab" end) ) - -print( tostring(1234567890123) ) -print( tostring(1234567890124) ) -print( tostring(1234567890125) ) - -function f1(s, p) - print(p) - p = string.gsub(p, "%%([0-9])", function (s) return "%" .. (s+1) end) - print(p) - p = string.gsub(p, "^(^?)", "%1()", 1) - print(p) - p = string.gsub(p, "($?)$", "()%1", 1) - print(p) - local t = {string.match(s, p)} - return string.sub(s, t[1], t[#t] - 1) -end - -print( pcall( f1, 'alo alx 123 b\0o b\0o', '(..*) %1' ) ) - -local function badpat() - print( string.gsub( "alo", "(.)", "%2" ) ) -end - -print( ( pcall( badpat ) ) ) - -for k, v in string.gmatch("w=200&h=150", "(%w+)=(%w+)") do - print(k, v) -end - --- string.sub -function t(str) - local i = { 0, 1, 2, 8, -1 } - for ki,vi in ipairs(i) do - local s,v = pcall( string.sub, str, vi ) - print( 'string.sub("'..str..'",'..tostring(vi)..')='..tostring(s)..',"'..tostring(v)..'"' ) - local j = { 0, 1, 2, 4, 8, -1 } - for kj,vj in ipairs(j) do - local s,v = pcall( string.sub, str, vi, vj ) - print( 'string.sub("'..str..'",'..tostring(vi)..','..tostring(vj)..')='..tostring(s)..',"'..tostring(v)..'"' ) - end - end -end -t( 'abcdefghijklmn' ) -t( 'abcdefg' ) -t( 'abcd' ) -t( 'abc' ) -t( 'ab' ) -t( 'a' ) -t( '' ) - -print(string.len("Hello, world")) -print(#"Hello, world") -print(string.len("\0\0\0")) -print(#"\0\0\0") -print(string.len("\0\1\2\3")) -print(#"\0\1\2\3") -local s = "My JaCk-O-lAnTeRn CaSe TeXt" -print(s, string.len(s), #s) - - --- string.format -print(string.format("(%.0d) (%.0d) (%.0d)", 0, -5, 9)) -print(string.format("(%.1d) (%.1d) (%.1d)", 0, -5, 9)) -print(string.format("(%.2d) (%.2d) (%.2d)", 0, -5, 9)) - -print(string.format("(%+.0d) (%+.0d) (%+.0d)", 0, -5, 9)) -print(string.format("(%+.1d) (%+.1d) (%+.1d)", 0, -5, 9)) -print(string.format("(%+.2d) (%+.2d) (%+.2d)", 0, -5, 9)) - -print(string.format("(%+3d) (% 3d) (%+ 3d)", 55, 55, 55)) - -print(string.format("(%-1d) (%-1d) (%-1d)", 1, 12, -12)) -print(string.format("(%-2d) (%-2d) (%-2d)", 1, 12, -12)) -print(string.format("(%-3d) (%-3d) (%-3d)", 1, 12, -12)) - - -print(string.format("(%8x) (%8d) (%8o)", 255, 255, 255)) -print(string.format("(%08x) (%08d) (%08o)", 255, 255, 255)) - -print(string.format("simple%ssimple", " simple ")) - -local testformat = function(message,fmt,...) - local s,e = pcall( string.format, fmt, ... ) - if s then - print( message, string.byte(e,1,#e) ) - else - print( message, 'error', e ) - end -end - -specials = "\"specials\": %% \000 \r \n" -testformat('plain %', "%%") -testformat("specials (%s)", "---%s---", specials) -testformat("specials (%q)", "---%q---", specials) -testformat("controls (%q)", "---%q---", ' \a \b \f \t \v \\ ') -testformat("extended (%q)", "---%q---", ' \222 \223 \224 ') -testformat("embedded newlines", "%s\r%s\n%s", '===', '===', '===') - --- format long string -print("this is a %s long string", string.rep("really, ", 30)) - -local function pc(...) - local s,e = pcall(...) - return s and e or 'false-'..type(e) -end - -local function strtests(name,func,...) - print(name, 'good', pc( func, ... ) ) - print(name, 'empty', pc( func ) ) - print(name, 'table', pc( func, {} ) ) - print(name, 'nil', pc( func, nil ) ) -end - -strtests('lower', string.lower, s ) -strtests('upper', string.upper, s ) -strtests('reverse', string.reverse, s ) -strtests('char', string.char, 92, 60, 61, 93 ) -strtests('dump', string.dump, loadstring('print("hello, world")', 'sample') ) - - --- floating point formats (not supported yet) ---[==[ -local prefixes = {'','+','-'} -local lengths = {'7','2','0','1',''} -local letters = {'f','e','g'} -local fmt, spec, desc -for i,letter in ipairs(letters) do - for k,before in ipairs(lengths) do - for j,prefix in ipairs(prefixes) do - spec = '(%'..prefix..before..letter..')' - fmt = spec..'\t'..spec..'\t'..spec..'\t'..spec..'\t'..spec..'\t'..spec - print(spec, string.format(fmt, 12.34, -12.34, 1/11, -1/11, 300/11, -300/11) ) - for l,after in ipairs(lengths) do - spec = '(%'..prefix..before..'.'..after..letter..')' - fmt = spec..' '..spec..' '..spec..' '..spec..' '..spec..' '..spec - print(spec, string.format(fmt, 12.34, -12.34, 1/11, -1/11, 300/11, -300/11) ) - end - end - end -end ---]==] - -local function fmterr(...) - local r, s = pcall(...) - if r then - return s - else - s = string.gsub(s, "stringlib.lua:%d+:%s*", "") - return s - end -end - -print(fmterr(string.find, "ab%c)0(", "%")) -print(fmterr(string.find, "ab%c)0(", "(")) -print(pcall(string.find, "ab%c)0(", ")")) diff --git a/luaj-2.0.3/test/lua/tablelib.lua b/luaj-2.0.3/test/lua/tablelib.lua deleted file mode 100644 index da69efb98..000000000 --- a/luaj-2.0.3/test/lua/tablelib.lua +++ /dev/null @@ -1,274 +0,0 @@ -local func = function(t,...) - return (...) -end -local tbl = setmetatable({},{__index=func}) -print( tbl[2] ) - - --- tostring replacement that assigns ids -local ts,id,nid,types = tostring,{},0,{table='tbl',thread='thr',userdata='uda',['function']='func'} -tostring = function(x) - if not x or not types[type(x)] then return ts(x) end - if not id[x] then nid=nid+1; id[x]=types[type(x)]..'.'..nid end - return id[x] -end - -local t = { "one", "two", "three", a='aaa', b='bbb', c='ccc' } - -table.insert(t,'six'); -table.insert(t,1,'seven'); -table.insert(t,4,'eight'); -table.insert(t,7,'nine'); -table.insert(t,10,'ten'); print( #t ) - --- concat -print( '-- concat tests' ) -function tryconcat(t) - print( table.concat(t) ) - print( table.concat(t,'--') ) - print( table.concat(t,',',2) ) - print( table.concat(t,',',2,2) ) - print( table.concat(t,',',5,2) ) -end -tryconcat( { "one", "two", "three", a='aaa', b='bbb', c='ccc' } ) -tryconcat( { "one", "two", "three", "four", "five" } ) -function tryconcat(t) - print( table.concat(t) ) - print( table.concat(t,'--') ) - print( table.concat(t,',',2) ) -end -tryconcat( { a='aaa', b='bbb', c='ccc', d='ddd', e='eee' } ) -tryconcat( { [501]="one", [502]="two", [503]="three", [504]="four", [505]="five" } ) -tryconcat( {} ) - --- print the elements of a table in a platform-independent way -function eles(t,f) - f = f or pairs - all = {} - for k,v in f(t) do - table.insert( all, "["..tostring(k).."]="..tostring(v) ) - end - table.sort( all ) - return "{"..table.concat(all,',').."}" -end - --- insert, maxn -print( '-- insert, len tests' ) -local t = { "one", "two", "three", a='aaa', b='bbb', c='ccc' } - -print( eles(t), #t ) -table.insert(t,'six'); print( eles(t), #t ) -table.insert(t,1,'seven'); print( eles(t), #t ) -table.insert(t,4,'eight'); print( eles(t), #t ) -table.insert(t,7,'nine'); print( eles(t), #t ) -table.insert(t,10,'ten'); print( eles(t), #t ) -print( '#{}', #{} ) -print( '#{"a"}', #{"a"} ) -print( '#{"a","b"}', #{"a","b"} ) -print( '#{"a",nil}', #{"a",nil} ) -print( '#{nil,nil}', #{nil,nil} ) -print( '#{nil,"b"}', #{nil,"b"}==0 or #{nil,"b"}==2 ) -print( '#{"a","b","c"}', #{"a","b","c"} ) -print( '#{"a","b",nil}', #{"a","b",nil} ) -print( '#{"a",nil,nil}', #{"a",nil,nil} ) -print( '#{nil,nil,nil}', #{nil,nil,nil} ) -print( '#{nil,nil,"c"}', #{nil,nil,"c"}==0 or #{nil,nil,"c"}==3 ) -print( '#{nil,"b","c"}', #{nil,"b","c"}==0 or #{nil,"b","c"}==3 ) -print( '#{nil,"b",nil}', #{nil,"b",nil}==0 or #{nil,"b",nil}==2 ) -print( '#{"a",nil,"c"}', #{"a",nil,"c"}==1 or #{"a",nil,"c"}==3 ) - --- remove -print( '-- remove tests' ) -t = { "one", "two", "three", "four", "five", "six", "seven", [10]="ten", a='aaa', b='bbb', c='ccc' } -print( eles(t), #t ) -print( 'table.remove(t)', table.remove(t) ); print( eles(t), #t ) -print( 'table.remove(t,1)', table.remove(t,1) ); print( eles(t), #t ) -print( 'table.remove(t,3)', table.remove(t,3) ); print( eles(t), #t ) -print( 'table.remove(t,5)', table.remove(t,5) ); print( eles(t), #t ) -print( 'table.remove(t,10)', table.remove(t,10) ); print( eles(t), #t ) -print( 'table.remove(t,-1)', table.remove(t,-1) ); print( eles(t), #t ) -print( 'table.remove(t,-1)', table.remove(t,-1) ) ; print( eles(t), #t ) - --- sort -print( '-- sort tests' ) -function sorttest(t,f) - t = (t) - print( table.concat(t,'-') ) - if f then - table.sort(t,f) - else - table.sort(t) - end - print( table.concat(t,'-') ) -end -sorttest{ "one", "two", "three" } -sorttest{ "www", "vvv", "uuu", "ttt", "sss", "zzz", "yyy", "xxx" } -sorttest( { "www", "vvv", "uuu", "ttt", "sss", "zzz", "yyy", "xxx" }, function(a,b) return b0, returning f2(n-1,n,...)", n-1,n,... ) - return f2(n-1,n,...) -end - -local function f3(n,...) - if n <= 0 then - return sum(...) - end - print( " f3,n-1,n,...", f3,n-1,n,... ) - return pcall(f3,n-1,n,...) -end - -local function all(f) - for n=0,3 do - t = {} - for m=1,5 do - print( "--f, n, unpack(t)", f, n, unpack(t) ) - print( pcall( f, n, unpack(t)) ) - t[m] = m - end - end -end - -all(f1) -all(f2) -all(f3) - - -local function f(x) - -- tailcall to a builtin - return math.abs(x) -end - -local function factorial(i) - local function helper(product, n) - if n <= 0 then - return product - else - -- tail call to a nested Lua function - return helper(n * product, n - 1) - end - end - return helper(1, i) -end - -local result1 = factorial(5) -print(result1) -print(factorial(5)) - -local result2 = f(-1234) -print( result2 ) - -local function fib_bad(n) - local function helper(i, a, b) - if i >= n then - return a - else - -- not recognized by luac as a tailcall! - local result = helper(i + 1, b, a + b) - return result - end - end - return helper(1, 1, 1) -end - -local function fib_good(n) - local function helper(i, a, b) - if i >= n then - return a - else - -- must be a tail call! - return helper(i + 1, b, a + b) - end - end - return helper(1, 1, 1) -end - -local aliases = { - ['1.#INF'] = 'inf', - ['-1.#INF'] = '-inf', - ['1.#IND'] = 'nan', - ['-1.#IND'] = 'nan', -} - -local p = function( s,e ) - print( s, e and aliases[tostring(e)] or e ) -end -p(pcall(fib_bad, 30)) ---p((pcall(fib_bad, 25000))) -p(pcall(fib_good, 30)) -p(pcall(fib_good, 25000)) - -local function fib_all(n, i, a, b) - i = i or 1 - a = a or 1 - b = b or 1 - if i >= n then - return - else - return a, fib_all(n, i+1, b, a+b) - end -end - -print(fib_all(10)) diff --git a/luaj-2.0.3/test/lua/upvalues.lua b/luaj-2.0.3/test/lua/upvalues.lua deleted file mode 100644 index 2c263dd84..000000000 --- a/luaj-2.0.3/test/lua/upvalues.lua +++ /dev/null @@ -1,97 +0,0 @@ - -print( '-------- simple upvalues tests --------' ) -local function simpleupvalues() - function test() - local x = 5 - function f() - x = x + 1 - return x - end - function g() - x = x - 1 - return x - end - print(f()) - print(g()) - return f, g - end - - f1, g1 = test() - print("f1()=", f1()) - print("g1()=", g1()) - - f2, g2 = test() - print("f2()=", f2()) - print("g2()=", g2()) - - print("g1()=", g1()) - print("f1()=", f1()) -end -print( 'simplevalues result:', pcall( simpleupvalues ) ) - - --- The point of this test is that when an upvalue is created, it may --- need to be inserted in the middle of the list, rather than always --- appended at the end. Otherwise, it may not be found when it is --- needed by another closure. -print( '----------- upvalued in middle ------------' ) -local function middleupvaluestest() - local function test() - local x = 3 - local y = 5 - local z = 7 - - local function f() - print("y=", y) - end - - local function g() - print("z=", z) - end - - local function h() - print("x=", x) - end - - local function setter(x1, y1, z1) - x = x1 - y = y1 - z = z1 - end - - return f, g, h, setter - end - - local f, g, h, setter = test() - - h() - f() - g() - - setter("x", "y", "z") - - h() - f() - g() -end -print( pcall( middleupvaluestest ) ) - - -print( '--------- nested upvalues ----------' ) -local function nestedupvaluestest() - local f - do - local x = 10 - function g() - print(x, f()) - end - end - - function f() - return 20 - end - - g() -end -print( 'nestedupvaluestest result:', pcall( nestedupvaluestest ) ) - diff --git a/luaj-2.0.3/test/lua/vm.lua b/luaj-2.0.3/test/lua/vm.lua deleted file mode 100644 index 735ccfb17..000000000 --- a/luaj-2.0.3/test/lua/vm.lua +++ /dev/null @@ -1,250 +0,0 @@ - -print( '-------- basic vm tests --------' ) - -print( '-- boolean tests' ) -local function booleantests() - t = true - f = false - n = nil - s = "Hello" - z = 0 - one = 1 - - print(t) - print(f) - - print(not t) - print(not f) - print(not n) - print(not z) - print(not s) - print(not(not(t))) - print(not(not(z))) - print(not(not(n))) - - print(t and f) - print(t or f) - print(f and t) - print(f or t) - - print(f or one) - print(f or z) - print(f or n) - - print(t and one) - print(t and z) - print(t and n) -end -print( 'booleantests result:', pcall( booleantests ) ) - - -print( '------------- varargs' ) -local function varargstest() - function p(a,...) - print("a",a) - print("...",...) - print("...,a",...,a) - print("a,...",a,...) - end - function q(a,...) - print("a,arg[1],arg[2],arg[3]",a,arg.n,arg[1],arg[2],arg[3]) - end - function r(a,...) - print("a,arg",a,arg) - print("a",a) - print("...",...) - print("...,a",...,a) - print("a,...",a,...) - end - function s(a) - local arg = { '1', '2', '3' } - print("a,arg[1],arg[2],arg[3]",a,arg[1],arg[2],arg[3]) - print("a",a) - end - function t(a,...) - local arg = { '1', '2', '3' } - print("a,arg[1],arg[2],arg[3]",a,arg[1],arg[2],arg[3]) - print("a",a) - print("...",...) - print("...,a",...,a) - print("a,...",a,...) - end - function u(arg) - print( 'arg', arg ) - end - function v(arg,...) - print( 'arg', arg ) - print("...",...) - print("arg,...",arg,...) - end - arg = { "global-1", "global-2", "global-3" } - function tryall(f,name) - print( '---- function '..name..'()' ) - print( '--'..name..'():' ) - print( ' ->', pcall( f ) ) - print( '--'..name..'("q"):' ) - print( ' ->', pcall( f, "q" ) ) - print( '--'..name..'("q","r"):' ) - print( ' ->', pcall( f, "q", "r" ) ) - print( '--'..name..'("q","r","s"):' ) - print( ' ->', pcall( f, "q", "r", "s" ) ) - end - tryall(p,'p') - tryall(q,'q') - tryall(r,'r') - tryall(s,'s') - tryall(t,'t') - tryall(u,'u') - tryall(v,'v') -end -print( 'varargstest result:', pcall( varargstest ) ) - --- The purpose of this test case is to demonstrate that --- basic metatable operations on non-table types work. --- i.e. that s.sub(s,...) could be used in place of string.sub(s,...) -print( '---------- metatable tests' ) -local function metatabletests() - - -- tostring replacement that assigns ids - local ts,id,nid,types = tostring,{},0,{table='tbl',thread='thr',userdata='uda',['function']='func'} - tostring = function(x) - if not x or not types[type(x)] then return ts(x) end - if not id[x] then nid=nid+1; id[x]=types[type(x)]..'.'..nid end - return id[x] - end - local results = function(s,e,...) - if s then return e,... end - return false,type(e) - end - local pcall = function(...) - return results( pcall(...) ) - end - - - local s = "hello" - print(s:sub(2,4)) - - local t = {} - function op(name,...) - local a,b = pcall( setmetatable, t, ... ) - print( name, t, getmetatable(t), a, b ) - end - op('set{} ',{}) - op('set-nil',nil) - op('set{} ',{}) - op('set') - op('set{} ',{}) - op('set{} ',{}) - op('set{}{}',{},{}) - op('set-nil',nil) - op('set{__}',{__metatable={}}) - op('set{} ',{}) - op('set-nil',nil) - t = {} - op('set{} ',{}) - op('set-nil',nil) - op('set{__}',{__metatable='abc'}) - op('set{} ',{}) - op('set-nil',nil) - - - local i = 1234 - local t = setmetatable( {}, { - __mode="v", - __index=function(t,k) - local v = i - i = i + 1 - rawset(t,k,v) - return v - end, - } ) - - local l = { 'a', 'b', 'a', 'b', 'c', 'a', 'b', 'c', 'd' } - for i,key in ipairs(l) do - print( 't.'..key, t[key] ) - end -end -print( 'metatabletests result:', pcall( metatabletests ) ) - --- test tables with more than 50 elements -print( '------------ huge tables' ) -local function hugetables() - local t = { 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - } - print ("#t=",#t,'t[1,50,51,59]', t[1], t[50], t[51], t[59]) - print (table.concat(t,',')) - - local t2= { 0,3,4,7,9,8,12,15,23,5, - 10,13,14,17,19,18,112,115,123,15, - 20,33,24,27,29,28,212,215,223,25, - 40,43,44,47,49,48,412,415,423,45, - 50,53,54,57,59,58,512,515,523,55, - 60,63,64,67,69,68,612,615,623,65, - 70,73,74,77,79,78,72,715,723,75, - } - - print ("#t2=",#t2,'t[1,50,51,59]', t[1], t[50], t[51], t[59]) - print (table.concat(t2,',')) - - local t = { - [2000]='a', [2001]='b', [2002]='c', [2003]='d', [2004]='e', [2005]='f', [2006]='g', [2007]='h', [2008]='i', [2009]='j', - [3000]='a', [3001]='b', [3002]='c', [3003]='d', [3004]='e', [3005]='f', [3006]='g', [3007]='h', [3008]='i', [3009]='j', - [4000]='a', [4001]='b', [4002]='c', [4003]='d', [4004]='e', [4005]='f', [4006]='g', [4007]='h', [4008]='i', [4009]='j', - [5000]='a', [5001]='b', [5002]='c', [5003]='d', [5004]='e', [5005]='f', [5006]='g', [5007]='h', [5008]='i', [5009]='j', - [6000]='a', [6001]='b', [6002]='c', [6003]='d', [6004]='e', [6005]='f', [6006]='g', [6007]='h', [6008]='i', [6009]='j', - [7000]='a', [7001]='b', [7002]='c', [7003]='d', [7004]='e', [7005]='f', [7006]='g', [7007]='h', [7008]='i', [7009]='j', - [8000]='a', [8001]='b', [8002]='c', [8003]='d', [8004]='e', [8005]='f', [8006]='g', [8007]='h', [8008]='i', [8009]='j', - } - - for i=2000,8000,1000 do - for j=0,9,1 do - print( 't['..tostring(i+j)..']', t[i+j] ) - end - end -end -print( 'hugetables result:', pcall( hugetables ) ) - -print( '--------- many locals' ) -local function manylocals() - -- test program with more than 50 non-sequential integer elements - local t0000='a'; local t0001='b'; local t0002='c'; local t0003='d'; local t0004='e'; local t0005='f'; local t0006='g'; local t0007='h'; local t0008='i'; local t0009='j'; - local t1000='a'; local t1001='b'; local t1002='c'; local t1003='d'; local t1004='e'; local t1005='f'; local t1006='g'; local t1007='h'; local t1008='i'; local t1009='j'; - local t2000='a'; local t2001='b'; local t2002='c'; local t2003='d'; local t2004='e'; local t2005='f'; local t2006='g'; local t2007='h'; local t2008='i'; local t2009='j'; - local t3000='a'; local t3001='b'; local t3002='c'; local t3003='d'; local t3004='e'; local t3005='f'; local t3006='g'; local t3007='h'; local t3008='i'; local t3009='j'; - local t4000='a'; local t4001='b'; local t4002='c'; local t4003='d'; local t4004='e'; local t4005='f'; local t4006='g'; local t4007='h'; local t4008='i'; local t4009='j'; - local t5000='a'; local t5001='b'; local t5002='c'; local t5003='d'; local t5004='e'; local t5005='f'; local t5006='g'; local t5007='h'; local t5008='i'; local t5009='j'; - local t6000='a'; local t6001='b'; local t6002='c'; local t6003='d'; local t6004='e'; local t6005='f'; local t6006='g'; local t6007='h'; local t6008='i'; local t6009='j'; - local t7000='a'; local t7001='b'; local t7002='c'; local t7003='d'; local t7004='e'; local t7005='f'; local t7006='g'; local t7007='h'; local t7008='i'; local t7009='j'; - local t8000='a'; local t8001='b'; local t8002='c'; local t8003='d'; local t8004='e'; local t8005='f'; local t8006='g'; local t8007='h'; local t8008='i'; local t8009='j'; - local t9000='a'; local t9001='b'; local t9002='c'; local t9003='d'; local t9004='e'; local t9005='f'; local t9006='g'; local t9007='h'; local t9008='i'; local t9009='j'; - local t10000='a'; local t10001='b'; local t10002='c'; local t10003='d'; local t10004='e'; local t10005='f'; local t10006='g'; local t10007='h'; local t10008='i'; local t10009='j'; - local t11000='a'; local t11001='b'; local t11002='c'; local t11003='d'; local t11004='e'; local t11005='f'; local t11006='g'; local t11007='h'; local t11008='i'; local t11009='j'; - local t12000='a'; local t12001='b'; local t12002='c'; local t12003='d'; local t12004='e'; local t12005='f'; local t12006='g'; local t12007='h'; local t12008='i'; local t12009='j'; - local t13000='a'; local t13001='b'; local t13002='c'; local t13003='d'; local t13004='e'; local t13005='f'; local t13006='g'; local t13007='h'; local t13008='i'; local t13009='j'; - - -- print the variables - print(t0000,'a'); print(t0001,'b'); print(t0002,'c'); print(t0003,'d'); print(t0004,'e'); print(t0005,'f'); print(t0006,'g'); print(t0007,'h'); print(t0008,'i'); print(t0009,'j'); - print(t1000,'a'); print(t1001,'b'); print(t1002,'c'); print(t1003,'d'); print(t1004,'e'); print(t1005,'f'); print(t1006,'g'); print(t1007,'h'); print(t1008,'i'); print(t1009,'j'); - print(t2000,'a'); print(t2001,'b'); print(t2002,'c'); print(t2003,'d'); print(t2004,'e'); print(t2005,'f'); print(t2006,'g'); print(t2007,'h'); print(t2008,'i'); print(t2009,'j'); - print(t3000,'a'); print(t3001,'b'); print(t3002,'c'); print(t3003,'d'); print(t3004,'e'); print(t3005,'f'); print(t3006,'g'); print(t3007,'h'); print(t3008,'i'); print(t3009,'j'); - print(t4000,'a'); print(t4001,'b'); print(t4002,'c'); print(t4003,'d'); print(t4004,'e'); print(t4005,'f'); print(t4006,'g'); print(t4007,'h'); print(t4008,'i'); print(t4009,'j'); - print(t5000,'a'); print(t5001,'b'); print(t5002,'c'); print(t5003,'d'); print(t5004,'e'); print(t5005,'f'); print(t5006,'g'); print(t5007,'h'); print(t5008,'i'); print(t5009,'j'); - print(t6000,'a'); print(t6001,'b'); print(t6002,'c'); print(t6003,'d'); print(t6004,'e'); print(t6005,'f'); print(t6006,'g'); print(t6007,'h'); print(t6008,'i'); print(t6009,'j'); - print(t7000,'a'); print(t7001,'b'); print(t7002,'c'); print(t7003,'d'); print(t7004,'e'); print(t7005,'f'); print(t7006,'g'); print(t7007,'h'); print(t7008,'i'); print(t7009,'j'); - print(t8000,'a'); print(t8001,'b'); print(t8002,'c'); print(t8003,'d'); print(t8004,'e'); print(t8005,'f'); print(t8006,'g'); print(t8007,'h'); print(t8008,'i'); print(t8009,'j'); - print(t9000,'a'); print(t9001,'b'); print(t9002,'c'); print(t9003,'d'); print(t9004,'e'); print(t9005,'f'); print(t9006,'g'); print(t9007,'h'); print(t9008,'i'); print(t9009,'j'); - print(t10000,'a'); print(t10001,'b'); print(t10002,'c'); print(t10003,'d'); print(t10004,'e'); print(t10005,'f'); print(t10006,'g'); print(t10007,'h'); print(t10008,'i'); print(t10009,'j'); - print(t11000,'a'); print(t11001,'b'); print(t11002,'c'); print(t11003,'d'); print(t11004,'e'); print(t11005,'f'); print(t11006,'g'); print(t11007,'h'); print(t11008,'i'); print(t11009,'j'); - print(t12000,'a'); print(t12001,'b'); print(t12002,'c'); print(t12003,'d'); print(t12004,'e'); print(t12005,'f'); print(t12006,'g'); print(t12007,'h'); print(t12008,'i'); print(t12009,'j'); - print(t13000,'a'); print(t13001,'b'); print(t13002,'c'); print(t13003,'d'); print(t13004,'e'); print(t13005,'f'); print(t13006,'g'); print(t13007,'h'); print(t13008,'i'); print(t13009,'j'); -end -print( 'manylocals result:', pcall( manylocals ) ) diff --git a/setup.sh b/setup.sh index 4ae0579c5..8a26118bb 100755 --- a/setup.sh +++ b/setup.sh @@ -1,13 +1,14 @@ #!/bin/sh echo "Setting permissions..." +chmod +x codesize.sh chmod +x build_luaj.sh chmod +x deploy.sh chmod +x gradlew echo "Setting up IntelliJ development environment with gradle..." rm -rf build -./gradlew setupDecompWorkspace --refresh-dependencies -./gradlew cleanIdea idea +./gradlew --stacktrace setupDecompWorkspace --refresh-dependencies +./gradlew --stacktrace cleanIdea idea echo "Done." diff --git a/src/main/java/dan200/computercraft/ComputerCraft.java b/src/main/java/dan200/computercraft/ComputerCraft.java index dc5d1240a..33386f69e 100644 --- a/src/main/java/dan200/computercraft/ComputerCraft.java +++ b/src/main/java/dan200/computercraft/ComputerCraft.java @@ -53,7 +53,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.network.PacketBuffer; import net.minecraft.server.MinecraftServer; -import net.minecraft.util.BlockPos; +import net.minecraft.util.SoundEvent; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; import net.minecraftforge.common.config.Configuration; @@ -122,8 +123,6 @@ public class ComputerCraft public static int computerSpaceLimit = 1000 * 1000; public static int floppySpaceLimit = 125 * 1000; - public static int treasureDiskLootFrequency = 1; - // Blocks and Items public static class Blocks { @@ -198,71 +197,67 @@ public void preInit( FMLPreInitializationEvent event ) // Setup general Property prop = config.get(Configuration.CATEGORY_GENERAL, "http_enable", http_enable); - prop.comment = "Enable the \"http\" API on Computers (see \"http_whitelist\" for more fine grained control than this)"; + prop.setComment( "Enable the \"http\" API on Computers (see \"http_whitelist\" for more fine grained control than this)" ); http_enable = prop.getBoolean(http_enable); prop = config.get(Configuration.CATEGORY_GENERAL, "http_whitelist", http_whitelist ); - prop.comment = "A semicolon limited list of wildcards for domains that can be accessed through the \"http\" API on Computers. Set this to \"*\" to access to the entire internet. Example: \"*.pastebin.com;*.github.com;*.computercraft.info\" will restrict access to just those 3 domains."; + prop.setComment( "A semicolon limited list of wildcards for domains that can be accessed through the \"http\" API on Computers. Set this to \"*\" to access to the entire internet. Example: \"*.pastebin.com;*.github.com;*.computercraft.info\" will restrict access to just those 3 domains." ); http_whitelist = prop.getString(); prop = config.get(Configuration.CATEGORY_GENERAL, "disable_lua51_features", disable_lua51_features ); - prop.comment = "Set this to true to disable Lua 5.1 functions that will be removed in a future update. Useful for ensuring forward compatibility of your programs now."; + prop.setComment( "Set this to true to disable Lua 5.1 functions that will be removed in a future update. Useful for ensuring forward compatibility of your programs now." ); disable_lua51_features = prop.getBoolean( disable_lua51_features ); prop = config.get( Configuration.CATEGORY_GENERAL, "default_computer_settings", default_computer_settings ); - prop.comment = "A comma seperated list of default system settings to set on new computers. Example: \"shell.autocomplete=false,lua.autocomplete=false,edit.autocomplete=false\" will disable all autocompletion"; + prop.setComment( "A comma seperated list of default system settings to set on new computers. Example: \"shell.autocomplete=false,lua.autocomplete=false,edit.autocomplete=false\" will disable all autocompletion" ); default_computer_settings = prop.getString(); prop = config.get(Configuration.CATEGORY_GENERAL, "enableCommandBlock", enableCommandBlock); - prop.comment = "Enable Command Block peripheral support"; + prop.setComment( "Enable Command Block peripheral support" ); enableCommandBlock = prop.getBoolean(enableCommandBlock); prop = config.get(Configuration.CATEGORY_GENERAL, "modem_range", modem_range); - prop.comment = "The range of Wireless Modems at low altitude in clear weather, in meters"; + prop.setComment( "The range of Wireless Modems at low altitude in clear weather, in meters" ); modem_range = Math.min( prop.getInt(), 100000 ); prop = config.get(Configuration.CATEGORY_GENERAL, "modem_highAltitudeRange", modem_highAltitudeRange); - prop.comment = "The range of Wireless Modems at maximum altitude in clear weather, in meters"; + prop.setComment( "The range of Wireless Modems at maximum altitude in clear weather, in meters" ); modem_highAltitudeRange = Math.min( prop.getInt(), 100000 ); prop = config.get(Configuration.CATEGORY_GENERAL, "modem_rangeDuringStorm", modem_rangeDuringStorm); - prop.comment = "The range of Wireless Modems at low altitude in stormy weather, in meters"; + prop.setComment( "The range of Wireless Modems at low altitude in stormy weather, in meters" ); modem_rangeDuringStorm = Math.min( prop.getInt(), 100000 ); prop = config.get(Configuration.CATEGORY_GENERAL, "modem_highAltitudeRangeDuringStorm", modem_highAltitudeRangeDuringStorm); - prop.comment = "The range of Wireless Modems at maximum altitude in stormy weather, in meters"; + prop.setComment( "The range of Wireless Modems at maximum altitude in stormy weather, in meters" ); modem_highAltitudeRangeDuringStorm = Math.min( prop.getInt(), 100000 ); prop = config.get(Configuration.CATEGORY_GENERAL, "computerSpaceLimit", computerSpaceLimit); - prop.comment = "The disk space limit for computers and turtles, in bytes"; + prop.setComment( "The disk space limit for computers and turtles, in bytes" ); computerSpaceLimit = prop.getInt(); prop = config.get(Configuration.CATEGORY_GENERAL, "floppySpaceLimit", floppySpaceLimit); - prop.comment = "The disk space limit for floppy disks, in bytes"; + prop.setComment( "The disk space limit for floppy disks, in bytes" ); floppySpaceLimit = prop.getInt(); - prop = config.get(Configuration.CATEGORY_GENERAL, "treasureDiskLootFrequency", treasureDiskLootFrequency); - prop.comment = "The frequency that treasure disks will be found in dungeon chests, from 0 to 100. Increase this value if running a modpack with lots of mods that add dungeon loot, or you just want more treasure disks. Set to 0 to disable treasure disks."; - treasureDiskLootFrequency = prop.getInt(); - prop = config.get(Configuration.CATEGORY_GENERAL, "turtlesNeedFuel", turtlesNeedFuel); - prop.comment = "Set whether Turtles require fuel to move"; + prop.setComment( "Set whether Turtles require fuel to move" ); turtlesNeedFuel = prop.getBoolean( turtlesNeedFuel ); prop = config.get(Configuration.CATEGORY_GENERAL, "turtleFuelLimit", turtleFuelLimit); - prop.comment = "The fuel limit for Turtles"; + prop.setComment( "The fuel limit for Turtles" ); turtleFuelLimit = prop.getInt( turtleFuelLimit ); prop = config.get(Configuration.CATEGORY_GENERAL, "advancedTurtleFuelLimit", advancedTurtleFuelLimit); - prop.comment = "The fuel limit for Advanced Turtles"; + prop.setComment( "The fuel limit for Advanced Turtles" ); advancedTurtleFuelLimit = prop.getInt(advancedTurtleFuelLimit); prop = config.get(Configuration.CATEGORY_GENERAL, "turtlesObeyBlockProtection", turtlesObeyBlockProtection); - prop.comment = "If set to true, Turtles will be unable to build, dig, or enter protected areas (such as near the server spawn point)"; + prop.setComment( "If set to true, Turtles will be unable to build, dig, or enter protected areas (such as near the server spawn point)" ); turtlesObeyBlockProtection = prop.getBoolean( turtlesObeyBlockProtection ); prop = config.get(Configuration.CATEGORY_GENERAL, "turtlesCanPush", turtlesCanPush); - prop.comment = "If set to true, Turtles will push entities out of the way instead of stopping if there is space to do so"; + prop.setComment( "If set to true, Turtles will push entities out of the way instead of stopping if there is space to do so" ); turtlesCanPush = prop.getBoolean(turtlesCanPush); config.save(); @@ -285,7 +280,6 @@ public void init( FMLInitializationEvent event ) @Mod.EventHandler public void onServerStarting( FMLServerStartingEvent event ) { - ItemTreasureDisk.registerDungeonLoot(); } @Mod.EventHandler @@ -338,7 +332,7 @@ public static Object getFixedWidthFontRenderer() return proxy.getFixedWidthFontRenderer(); } - public static void playRecord( String record, String recordInfo, World world, BlockPos pos ) + public static void playRecord( SoundEvent record, String recordInfo, World world, BlockPos pos ) { proxy.playRecord( record, recordInfo, world, pos ); } @@ -426,20 +420,20 @@ public static void handlePacket( ComputerCraftPacket packet, EntityPlayer player public static boolean canPlayerUseCommands( EntityPlayer player ) { - MinecraftServer server = MinecraftServer.getServer(); + MinecraftServer server = player.getServer(); if( server != null ) { - return server.getConfigurationManager().canSendCommands( player.getGameProfile() ); + return server.getPlayerList().canSendCommands( player.getGameProfile() ); } return false; } public static boolean isPlayerOpped( EntityPlayer player ) { - MinecraftServer server = MinecraftServer.getServer(); + MinecraftServer server = player.getServer(); if( server != null ) { - return server.getConfigurationManager().getOppedPlayers().getEntry( player.getGameProfile() ) != null; + return server.getPlayerList().getOppedPlayers().getEntry( player.getGameProfile() ) != null; } return false; } @@ -454,7 +448,7 @@ public static void registerPermissionProvider( ITurtlePermissionProvider provide public static boolean isBlockEnterable( World world, BlockPos pos, EntityPlayer player ) { - MinecraftServer server = MinecraftServer.getServer(); + MinecraftServer server = player.getServer(); if( server != null && !world.isRemote ) { if( server.isBlockProtected( world, pos, player ) ) @@ -476,7 +470,7 @@ public static boolean isBlockEnterable( World world, BlockPos pos, EntityPlayer public static boolean isBlockEditable( World world, BlockPos pos, EntityPlayer player ) { - MinecraftServer server = MinecraftServer.getServer(); + MinecraftServer server = player.getServer(); if( server != null && !world.isRemote ) { if( server.isBlockProtected( world, pos, player ) ) diff --git a/src/main/java/dan200/computercraft/api/ComputerCraftAPI.java b/src/main/java/dan200/computercraft/api/ComputerCraftAPI.java index 48cf87014..40acca58e 100644 --- a/src/main/java/dan200/computercraft/api/ComputerCraftAPI.java +++ b/src/main/java/dan200/computercraft/api/ComputerCraftAPI.java @@ -13,7 +13,7 @@ import dan200.computercraft.api.permissions.ITurtlePermissionProvider; import dan200.computercraft.api.redstone.IBundledRedstoneProvider; import dan200.computercraft.api.turtle.ITurtleUpgrade; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; diff --git a/src/main/java/dan200/computercraft/api/media/IMedia.java b/src/main/java/dan200/computercraft/api/media/IMedia.java index 75c6b6433..3bd5199ae 100644 --- a/src/main/java/dan200/computercraft/api/media/IMedia.java +++ b/src/main/java/dan200/computercraft/api/media/IMedia.java @@ -8,6 +8,7 @@ import dan200.computercraft.api.filesystem.IMount; import net.minecraft.item.ItemStack; +import net.minecraft.util.SoundEvent; import net.minecraft.world.World; /** @@ -43,7 +44,7 @@ public interface IMedia * @param stack The itemstack to inspect. * @return The name, or null if this item does not represent an item with audio. */ - public String getAudioRecordName( ItemStack stack ); + public SoundEvent getAudio( ItemStack stack ); /** * If this disk represents an item with data (like a floppy disk), get a mount representing it's contents. This will be mounted onto the filesystem of the computercraft while the media is in the disk drive. diff --git a/src/main/java/dan200/computercraft/api/peripheral/IPeripheralProvider.java b/src/main/java/dan200/computercraft/api/peripheral/IPeripheralProvider.java index 49ce88e11..723c1f66a 100644 --- a/src/main/java/dan200/computercraft/api/peripheral/IPeripheralProvider.java +++ b/src/main/java/dan200/computercraft/api/peripheral/IPeripheralProvider.java @@ -6,7 +6,7 @@ package dan200.computercraft.api.peripheral; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; diff --git a/src/main/java/dan200/computercraft/api/permissions/ITurtlePermissionProvider.java b/src/main/java/dan200/computercraft/api/permissions/ITurtlePermissionProvider.java index 1afc0fea6..ed6fdb197 100644 --- a/src/main/java/dan200/computercraft/api/permissions/ITurtlePermissionProvider.java +++ b/src/main/java/dan200/computercraft/api/permissions/ITurtlePermissionProvider.java @@ -6,7 +6,7 @@ package dan200.computercraft.api.permissions; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; /** diff --git a/src/main/java/dan200/computercraft/api/redstone/IBundledRedstoneProvider.java b/src/main/java/dan200/computercraft/api/redstone/IBundledRedstoneProvider.java index 8893ec695..30216b2fb 100644 --- a/src/main/java/dan200/computercraft/api/redstone/IBundledRedstoneProvider.java +++ b/src/main/java/dan200/computercraft/api/redstone/IBundledRedstoneProvider.java @@ -6,7 +6,7 @@ package dan200.computercraft.api.redstone; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; diff --git a/src/main/java/dan200/computercraft/api/turtle/ITurtleAccess.java b/src/main/java/dan200/computercraft/api/turtle/ITurtleAccess.java index f30032efa..f66e98642 100644 --- a/src/main/java/dan200/computercraft/api/turtle/ITurtleAccess.java +++ b/src/main/java/dan200/computercraft/api/turtle/ITurtleAccess.java @@ -11,9 +11,9 @@ import dan200.computercraft.api.peripheral.IPeripheral; import net.minecraft.inventory.IInventory; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; -import net.minecraft.util.Vec3; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; /** @@ -45,7 +45,7 @@ public interface ITurtleAccess * @param f The subframe fraction * @return a vector containing the floating point co-ordinates at which the turtle resides. */ - public Vec3 getVisualPosition( float f ); + public Vec3d getVisualPosition( float f ); /** * TODO: Document me diff --git a/src/main/java/dan200/computercraft/api/turtle/ITurtleUpgrade.java b/src/main/java/dan200/computercraft/api/turtle/ITurtleUpgrade.java index 5de721541..96645a10e 100644 --- a/src/main/java/dan200/computercraft/api/turtle/ITurtleUpgrade.java +++ b/src/main/java/dan200/computercraft/api/turtle/ITurtleUpgrade.java @@ -7,7 +7,7 @@ package dan200.computercraft.api.turtle; import dan200.computercraft.api.peripheral.IPeripheral; -import net.minecraft.client.resources.model.IBakedModel; +import net.minecraft.client.renderer.block.model.IBakedModel; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; diff --git a/src/main/java/dan200/computercraft/client/gui/FixedWidthFontRenderer.java b/src/main/java/dan200/computercraft/client/gui/FixedWidthFontRenderer.java index fb2d8b8b4..52b190694 100644 --- a/src/main/java/dan200/computercraft/client/gui/FixedWidthFontRenderer.java +++ b/src/main/java/dan200/computercraft/client/gui/FixedWidthFontRenderer.java @@ -9,7 +9,7 @@ import dan200.computercraft.core.terminal.TextBuffer; import dan200.computercraft.shared.util.Colour; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.VertexBuffer; import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.util.ResourceLocation; @@ -30,7 +30,7 @@ public FixedWidthFontRenderer( TextureManager textureManager ) m_textureManager = textureManager; } - private void drawChar( WorldRenderer renderer, double x, double y, int index, int color ) + private void drawChar( VertexBuffer renderer, double x, double y, int index, int color ) { int column = index % 16; int row = index / 16; @@ -41,7 +41,7 @@ private void drawChar( WorldRenderer renderer, double x, double y, int index, in renderer.pos( x, y, 0.0 ).tex( (double) (column * FONT_WIDTH) / 256.0, (double) (row * FONT_HEIGHT ) / 256.0 ).color( colour.getR(), colour.getG(), colour.getB(), 1.0f ).endVertex(); } - private void drawQuad( WorldRenderer renderer, double x, double y, int color, double width ) + private void drawQuad( VertexBuffer renderer, double x, double y, int color, double width ) { Colour colour = Colour.values()[ 15 - color ]; renderer.pos( x, y + FONT_HEIGHT, 0.0 ).tex( 0.0, 1.0 ).color( colour.getR(), colour.getG(), colour.getB(), 1.0f ).endVertex(); @@ -59,7 +59,7 @@ public void drawStringBackgroundPart( int x, int y, TextBuffer backgroundColour, { // Draw the quads Tessellator tessellator = Tessellator.getInstance(); - WorldRenderer renderer = tessellator.getWorldRenderer(); + VertexBuffer renderer = tessellator.getBuffer(); renderer.begin( GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR ); if( leftMarginSize > 0.0 ) { @@ -95,7 +95,7 @@ public void drawStringTextPart( int x, int y, TextBuffer s, TextBuffer textColou { // Draw the quads Tessellator tessellator = Tessellator.getInstance(); - WorldRenderer renderer = tessellator.getWorldRenderer(); + VertexBuffer renderer = tessellator.getBuffer(); renderer.begin( GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR ); for( int i = 0; i < s.length(); i++ ) { diff --git a/src/main/java/dan200/computercraft/client/gui/widgets/MousePos.java b/src/main/java/dan200/computercraft/client/gui/widgets/MousePos.java deleted file mode 100644 index c3c944f24..000000000 --- a/src/main/java/dan200/computercraft/client/gui/widgets/MousePos.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - * This file is part of ComputerCraft - http://www.computercraft.info - * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. - * Send enquiries to dratcliffe@gmail.com - */ - -package dan200.computercraft.client.gui.widgets; - -public class MousePos -{ - public int x; - public int y; - - public MousePos( int x, int y ) - { - this.x = x; - this.y = y; - } -} diff --git a/src/main/java/dan200/computercraft/client/gui/widgets/Widget.java b/src/main/java/dan200/computercraft/client/gui/widgets/Widget.java index efdb9ab70..89f35567a 100644 --- a/src/main/java/dan200/computercraft/client/gui/widgets/Widget.java +++ b/src/main/java/dan200/computercraft/client/gui/widgets/Widget.java @@ -6,16 +6,16 @@ package dan200.computercraft.client.gui.widgets; +import dan200.computercraftedu.client.gui.widgets.MousePos; +import dan200.computercraftedu.client.gui.widgets.WidgetContainer; import net.minecraft.client.Minecraft; import net.minecraft.client.audio.PositionedSoundRecord; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.OpenGlHelper; -import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.*; +import net.minecraft.client.renderer.RenderItem; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.init.SoundEvents; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; @@ -177,11 +177,11 @@ public boolean suppressKeyPress( char c, int k ) protected void drawFullImage( int x, int y, int w, int h ) { Tessellator tessellator = Tessellator.getInstance(); - tessellator.getWorldRenderer().begin( GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX ); - tessellator.getWorldRenderer().pos( (double) ( x + 0 ), (double) ( y + h ), (double) this.zLevel ).tex( 0.0, 1.0 ).endVertex(); - tessellator.getWorldRenderer().pos( (double) ( x + w ), (double) ( y + h ), (double) this.zLevel ).tex( 1.0, 1.0 ).endVertex(); - tessellator.getWorldRenderer().pos( (double) ( x + w ), (double) ( y + 0 ), (double) this.zLevel ).tex( 1.0, 0.0 ).endVertex(); - tessellator.getWorldRenderer().pos( (double) ( x + 0 ), (double) ( y + 0 ), (double) this.zLevel ).tex( 0.0, 0.0 ).endVertex(); + tessellator.getBuffer().begin( GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX ); + tessellator.getBuffer().pos( (double) ( x + 0 ), (double) ( y + h ), (double) this.zLevel ).tex( 0.0, 1.0 ).endVertex(); + tessellator.getBuffer().pos( (double) ( x + w ), (double) ( y + h ), (double) this.zLevel ).tex( 1.0, 1.0 ).endVertex(); + tessellator.getBuffer().pos( (double) ( x + w ), (double) ( y + 0 ), (double) this.zLevel ).tex( 1.0, 0.0 ).endVertex(); + tessellator.getBuffer().pos( (double) ( x + 0 ), (double) ( y + 0 ), (double) this.zLevel ).tex( 0.0, 0.0 ).endVertex(); tessellator.draw(); } @@ -381,6 +381,6 @@ protected int getStringWidth( String s ) protected void playClickSound() { Minecraft mc = Minecraft.getMinecraft(); - mc.getSoundHandler().playSound( PositionedSoundRecord.create( new ResourceLocation( "gui.button.press" ), 1.0F ) ); + mc.getSoundHandler().playSound( PositionedSoundRecord.getMasterRecord( SoundEvents.UI_BUTTON_CLICK, 1.0F ) ); } } diff --git a/src/main/java/dan200/computercraft/client/gui/widgets/WidgetContainer.java b/src/main/java/dan200/computercraft/client/gui/widgets/WidgetContainer.java deleted file mode 100644 index 17526c883..000000000 --- a/src/main/java/dan200/computercraft/client/gui/widgets/WidgetContainer.java +++ /dev/null @@ -1,344 +0,0 @@ -/** - * This file is part of ComputerCraft - http://www.computercraft.info - * Copyright Daniel Ratcliffe, 2011-2016. Do not distribute without permission. - * Send enquiries to dratcliffe@gmail.com - */ - - -package dan200.computercraft.client.gui.widgets; - -import dan200.computercraft.client.gui.widgets.Widget; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.GlStateManager; - -import java.util.ArrayList; - -public class WidgetContainer extends Widget -{ - private ArrayList m_widgets; - private Widget m_modalWidget; - - public WidgetContainer( int x, int y, int w, int h ) - { - super( x, y, w, h ); - m_widgets = new ArrayList(); - m_modalWidget = null; - } - - public void addWidget( Widget widget ) - { - m_widgets.add( widget ); - widget.setParent( this ); - } - - public void setModalWidget( Widget widget ) - { - m_modalWidget = widget; - if( widget != null ) - { - widget.setParent( this ); - } - } - - public Widget getModalWidget() - { - return m_modalWidget; - } - - @Override - public void update() - { - for( int i=0; i() + IModel model = ModelLoaderRegistry.getModelOrMissing( + new ResourceLocation( "computercraft", "block/" + name ) + ); + IBakedModel bakedModel = model.bake( + model.getDefaultState(), + DefaultVertexFormats.ITEM, + new Function() + { + @Override + public TextureAtlasSprite apply( ResourceLocation location ) { - @Override - public TextureAtlasSprite apply( ResourceLocation location ) - { - return Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite( location.toString() ); - } + return Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite( location.toString() ); } - ); - event.modelRegistry.putObject( - new ModelResourceLocation( "computercraft:" + name, "inventory" ), - bakedModel - ); - } - catch( IOException e ) - { - System.out.println( "Could not load model: name" ); - e.printStackTrace(); - } + } + ); + event.getModelRegistry().putObject( + new ModelResourceLocation( "computercraft:" + name, "inventory" ), + bakedModel + ); } - private void loadSmartModel( ModelBakeEvent event, String name, ISmartItemModel smartModel ) + private void loadSmartModel( ModelBakeEvent event, String name, IBakedModel smartModel ) { - event.modelRegistry.putObject( + event.getModelRegistry().putObject( new ModelResourceLocation( "computercraft:" + name, "inventory" ), smartModel ); diff --git a/src/main/java/dan200/computercraft/client/proxy/ComputerCraftProxyClient.java b/src/main/java/dan200/computercraft/client/proxy/ComputerCraftProxyClient.java index 7c2c2aad8..85ceb9fa1 100644 --- a/src/main/java/dan200/computercraft/client/proxy/ComputerCraftProxyClient.java +++ b/src/main/java/dan200/computercraft/client/proxy/ComputerCraftProxyClient.java @@ -26,14 +26,16 @@ import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.ItemMeshDefinition; -import net.minecraft.client.resources.model.ModelBakery; -import net.minecraft.client.resources.model.ModelResourceLocation; +import net.minecraft.client.renderer.block.model.ModelBakery; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.server.MinecraftServer; -import net.minecraft.util.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.SoundEvent; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.IThreadListener; import net.minecraft.world.World; import net.minecraftforge.client.event.RenderGameOverlayEvent; @@ -184,9 +186,8 @@ private void registerItemModel( Block block, int damage, String name ) private void registerItemModel( Item item, int damage, String name ) { - name = "computercraft:" + name; - ModelResourceLocation res = new ModelResourceLocation( name, "inventory" ); - ModelBakery.addVariantName( item, name ); + ModelResourceLocation res = new ModelResourceLocation( "computercraft:" + name, "inventory" ); + ModelBakery.registerItemVariants( item, new ResourceLocation( "computercraft", name ) ); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register( item, damage, res ); } @@ -197,9 +198,8 @@ private void registerItemModel( Block block, String name ) private void registerItemModel( Item item, String name ) { - name = "computercraft:" + name; - final ModelResourceLocation res = new ModelResourceLocation( name, "inventory" ); - ModelBakery.addVariantName( item, name ); + final ModelResourceLocation res = new ModelResourceLocation( "computercraft:" + name, "inventory" ); + ModelBakery.registerItemVariants( item, new ResourceLocation( "computercraft", name ) ); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register( item, new ItemMeshDefinition() { @Override @@ -217,10 +217,12 @@ private void registerItemModel( Block block, ItemMeshDefinition definition, Stri private void registerItemModel( Item item, ItemMeshDefinition definition, String[] names ) { - for( int i=0; i m_generalQuads; - private List[] m_faceQuads; + private List m_faceQuads[]; public TurtleMultiModel( IBakedModel baseModel, IBakedModel overlayModel, IBakedModel leftUpgradeModel, Matrix4f leftUpgradeTransform, IBakedModel rightUpgradeModel, Matrix4f rightUpgradeTransform ) { // Get the models - m_baseModel = makeFlexible( baseModel ); - m_overlayModel = makeFlexible( overlayModel ); - m_leftUpgradeModel = makeFlexible( leftUpgradeModel ); - m_rightUpgradeModel = makeFlexible( rightUpgradeModel ); - - // Bake the quads - m_generalQuads = new ArrayList(); - m_generalQuads.addAll( m_baseModel.getGeneralQuads() ); - if( m_overlayModel != null ) - { - m_generalQuads.addAll( m_overlayModel.getGeneralQuads() ); - } - if( m_leftUpgradeModel != null ) - { - m_generalQuads.addAll( transformQuads( m_leftUpgradeModel.getFormat(), m_leftUpgradeModel.getGeneralQuads(), leftUpgradeTransform ) ); - } - if( m_rightUpgradeModel != null ) - { - m_generalQuads.addAll( transformQuads( m_rightUpgradeModel.getFormat(), m_rightUpgradeModel.getGeneralQuads(), rightUpgradeTransform ) ); - } - - m_faceQuads = new List[ EnumFacing.VALUES.length ]; - for( EnumFacing facing : EnumFacing.VALUES ) - { - List faces = new ArrayList(); - faces.addAll( m_baseModel.getFaceQuads( facing ) ); - if( m_overlayModel != null ) - { - faces.addAll( m_overlayModel.getFaceQuads( facing ) ); - } - if( m_leftUpgradeModel != null ) - { - faces.addAll( transformQuads( m_leftUpgradeModel.getFormat(), m_leftUpgradeModel.getFaceQuads( facing ), leftUpgradeTransform ) ); - } - if( m_rightUpgradeModel != null ) - { - faces.addAll( transformQuads( m_rightUpgradeModel.getFormat(), m_rightUpgradeModel.getFaceQuads( facing ), rightUpgradeTransform ) ); - } - m_faceQuads[ facing.getIndex() ] = faces; - } + m_baseModel = baseModel; + m_overlayModel = overlayModel; + m_leftUpgradeModel = leftUpgradeModel; + m_leftUpgradeTransform = leftUpgradeTransform; + m_rightUpgradeModel = rightUpgradeModel; + m_rightUpgradeTransform = rightUpgradeTransform; + m_generalQuads = null; + m_faceQuads = new List[6]; } @Override - public List getFaceQuads( EnumFacing side ) + public List getQuads( IBlockState state, EnumFacing side, long rand ) { - return m_faceQuads[ side.getIndex() ]; - } - - @Override - public List getGeneralQuads() - { - return m_generalQuads; + if( side != null ) + { + if( m_faceQuads[ side.ordinal() ] == null ) + { + List quads = new ArrayList(); + if( m_overlayModel != null ) + { + quads.addAll( m_overlayModel.getQuads( state, side, rand ) ); + } + if( m_leftUpgradeModel != null ) + { + quads.addAll( transformQuads( m_leftUpgradeModel.getQuads( state, side, rand ), m_leftUpgradeTransform ) ); + } + if( m_rightUpgradeModel != null ) + { + quads.addAll( transformQuads( m_rightUpgradeModel.getQuads( state, side, rand ), m_rightUpgradeTransform ) ); + } + m_faceQuads[ side.ordinal() ] = quads; + } + return m_faceQuads[ side.ordinal() ]; + } + else + { + if( m_generalQuads == null ) + { + m_generalQuads = new ArrayList(); + m_generalQuads.addAll( m_baseModel.getQuads( state, side, rand ) ); + if( m_overlayModel != null ) + { + m_generalQuads.addAll( m_overlayModel.getQuads( state, side, rand ) ); + } + if( m_leftUpgradeModel != null ) + { + m_generalQuads.addAll( transformQuads( m_leftUpgradeModel.getQuads( state, side, rand ), m_leftUpgradeTransform ) ); + } + if( m_rightUpgradeModel != null ) + { + m_generalQuads.addAll( transformQuads( m_rightUpgradeModel.getQuads( state, side, rand ), m_rightUpgradeTransform ) ); + } + } + return m_generalQuads; + } } @Override @@ -113,12 +120,12 @@ public ItemCameraTransforms getItemCameraTransforms() } @Override - public VertexFormat getFormat() + public ItemOverrideList getOverrides() { - return m_baseModel.getFormat(); + return ItemOverrideList.NONE; } - private List transformQuads( VertexFormat format, List input, Matrix4f transform ) + private List transformQuads( List input, Matrix4f transform ) { if( transform == null || input.size() == 0 ) { @@ -130,17 +137,18 @@ private List transformQuads( VertexFormat format, List inp for( int i=0; i m_cachedModels; + private ItemOverrideList m_overrides; public TurtleSmartItemModel() { m_defaultItem = TurtleItemFactory.create( -1, null, null, ComputerFamily.Normal, null, null, 0, null ); m_cachedModels = new HashMap(); + m_overrides = new ItemOverrideList( new ArrayList() ) + { + @Override + public IBakedModel handleItemState(IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity) + { + ItemTurtleBase turtle = (ItemTurtleBase) stack.getItem(); + ComputerFamily family = turtle.getFamily( stack ); + Colour colour = turtle.getColour( stack ); + ITurtleUpgrade leftUpgrade = turtle.getUpgrade( stack, TurtleSide.Left ); + ITurtleUpgrade rightUpgrade = turtle.getUpgrade( stack, TurtleSide.Right ); + ResourceLocation overlay = turtle.getOverlay( stack ); + boolean christmas = HolidayUtil.getCurrentHoliday() == Holiday.Christmas; + TurtleModelCombination combo = new TurtleModelCombination( family, colour, leftUpgrade, rightUpgrade, overlay, christmas ); + if( m_cachedModels.containsKey( combo ) ) + { + return m_cachedModels.get( combo ); + } + else + { + IBakedModel model = buildModel( combo ); + m_cachedModels.put( combo, model ); + return model; + } + } + }; + } + + @Override + public ItemOverrideList getOverrides() + { + return m_overrides; } @Override @@ -105,29 +139,6 @@ public void onResourceManagerReload( IResourceManager resourceManager ) m_cachedModels.clear(); } - @Override - public IBakedModel handleItemState( ItemStack stack ) - { - ItemTurtleBase turtle = (ItemTurtleBase) stack.getItem(); - ComputerFamily family = turtle.getFamily( stack ); - Colour colour = turtle.getColour( stack ); - ITurtleUpgrade leftUpgrade = turtle.getUpgrade( stack, TurtleSide.Left ); - ITurtleUpgrade rightUpgrade = turtle.getUpgrade( stack, TurtleSide.Right ); - ResourceLocation overlay = turtle.getOverlay( stack ); - boolean christmas = HolidayUtil.getCurrentHoliday() == Holiday.Christmas; - TurtleModelCombination combo = new TurtleModelCombination( family, colour, leftUpgrade, rightUpgrade, overlay, christmas ); - if( m_cachedModels.containsKey( combo ) ) - { - return m_cachedModels.get( combo ); - } - else - { - IBakedModel model = buildModel( combo ); - m_cachedModels.put( combo, model ); - return model; - } - } - private IBakedModel buildModel( TurtleModelCombination combo ) { Minecraft mc = Minecraft.getMinecraft(); @@ -163,15 +174,9 @@ else if( overlayModel != null ) // These should not be called: @Override - public List getFaceQuads( EnumFacing facing ) + public List getQuads( IBlockState state, EnumFacing facing, long rand ) { - return getDefaultModel().getFaceQuads( facing ); - } - - @Override - public List getGeneralQuads() - { - return getDefaultModel().getGeneralQuads(); + return getDefaultModel().getQuads( state, facing, rand ); } @Override @@ -206,6 +211,6 @@ public ItemCameraTransforms getItemCameraTransforms() private IBakedModel getDefaultModel() { - return handleItemState( m_defaultItem ); + return m_overrides.handleItemState( this, m_defaultItem, null, null ); } } diff --git a/src/main/java/dan200/computercraft/core/terminal/Terminal.java b/src/main/java/dan200/computercraft/core/terminal/Terminal.java index 36d4c7142..4cf0eace3 100644 --- a/src/main/java/dan200/computercraft/core/terminal/Terminal.java +++ b/src/main/java/dan200/computercraft/core/terminal/Terminal.java @@ -302,7 +302,7 @@ public void clearChanged() m_changed = false; } - public void writeToNBT( NBTTagCompound nbttagcompound ) + public NBTTagCompound writeToNBT( NBTTagCompound nbttagcompound ) { nbttagcompound.setInteger( "term_cursorX", m_cursorX ); nbttagcompound.setInteger( "term_cursorY", m_cursorY ); @@ -315,6 +315,7 @@ public void writeToNBT( NBTTagCompound nbttagcompound ) nbttagcompound.setString( "term_textColour_" + n, m_textColour[n].toString() ); nbttagcompound.setString( "term_textBgColour_" + n, m_backgroundColour[ n ].toString() ); } + return nbttagcompound; } public void readFromNBT( NBTTagCompound nbttagcompound ) diff --git a/src/main/java/dan200/computercraft/server/proxy/ComputerCraftProxyServer.java b/src/main/java/dan200/computercraft/server/proxy/ComputerCraftProxyServer.java index fad7b9624..6b4adaaae 100644 --- a/src/main/java/dan200/computercraft/server/proxy/ComputerCraftProxyServer.java +++ b/src/main/java/dan200/computercraft/server/proxy/ComputerCraftProxyServer.java @@ -13,7 +13,8 @@ import dan200.computercraft.shared.proxy.ComputerCraftProxyCommon; import dan200.computercraft.shared.turtle.blocks.TileTurtle; import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.BlockPos; +import net.minecraft.util.SoundEvent; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; @@ -64,7 +65,7 @@ public Object getFixedWidthFontRenderer() } @Override - public void playRecord( String record, String recordInfo, World world, BlockPos pos ) + public void playRecord( SoundEvent record, String recordInfo, World world, BlockPos pos ) { } @@ -101,6 +102,6 @@ public Object getPocketComputerGUI( InventoryPlayer inventory ) @Override public File getWorldDir( World world ) { - return new File( ComputerCraft.getBaseDir(), DimensionManager.getWorld(0).getSaveHandler().getWorldDirectoryName() ); + return DimensionManager.getWorld( 0 ).getSaveHandler().getWorldDirectory(); } } diff --git a/src/main/java/dan200/computercraft/shared/common/BlockDirectional.java b/src/main/java/dan200/computercraft/shared/common/BlockDirectional.java index f7ccfe012..376a97aa0 100644 --- a/src/main/java/dan200/computercraft/shared/common/BlockDirectional.java +++ b/src/main/java/dan200/computercraft/shared/common/BlockDirectional.java @@ -8,7 +8,7 @@ import net.minecraft.block.material.Material; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; diff --git a/src/main/java/dan200/computercraft/shared/common/BlockGeneric.java b/src/main/java/dan200/computercraft/shared/common/BlockGeneric.java index 335af3a72..e61b0e335 100644 --- a/src/main/java/dan200/computercraft/shared/common/BlockGeneric.java +++ b/src/main/java/dan200/computercraft/shared/common/BlockGeneric.java @@ -16,10 +16,11 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.Explosion; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; @@ -54,7 +55,7 @@ public final List getDrops( IBlockAccess world, BlockPos pos, IBlockS if( tile != null && tile instanceof TileGeneric ) { TileGeneric generic = (TileGeneric)tile; - generic.getDroppedItems( drops, fortune, false, false ); + generic.getDroppedItems( drops, false ); } return drops; } @@ -66,22 +67,20 @@ public final IBlockState onBlockPlaced( World world, BlockPos pos, EnumFacing si } @Override - public final boolean removedByPlayer( World world, BlockPos pos, EntityPlayer player, boolean willHarvest ) + public final boolean removedByPlayer( IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest ) { if( !world.isRemote ) { // Drop items - int fortune = EnchantmentHelper.getFortuneModifier( player ); boolean creative = player.capabilities.isCreativeMode; - boolean silkTouch = EnchantmentHelper.getSilkTouchModifier( player ); - dropAllItems( world, pos, fortune, creative, silkTouch ); + dropAllItems( world, pos, creative ); } // Remove block - return super.removedByPlayer( world, pos, player, willHarvest ); + return super.removedByPlayer( state, world, pos, player, willHarvest ); } - public final void dropAllItems( World world, BlockPos pos, int fortune, boolean creative, boolean silkTouch ) + public final void dropAllItems( World world, BlockPos pos, boolean creative ) { // Get items to drop List drops = new ArrayList( 1 ); @@ -89,7 +88,7 @@ public final void dropAllItems( World world, BlockPos pos, int fortune, boolean if( tile != null && tile instanceof TileGeneric ) { TileGeneric generic = (TileGeneric)tile; - generic.getDroppedItems( drops, fortune, creative, silkTouch ); + generic.getDroppedItems( drops, creative ); } // Drop items @@ -123,7 +122,7 @@ public final void breakBlock( World world, BlockPos pos, IBlockState newState ) } @Override - public final ItemStack getPickBlock( MovingObjectPosition target, World world, BlockPos pos, EntityPlayer player ) + public final ItemStack getPickBlock( IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player ) { TileEntity tile = world.getTileEntity( pos ); if( tile != null && tile instanceof TileGeneric ) @@ -141,7 +140,7 @@ protected final ItemStack createStackedBlock( IBlockState state ) } @Override - public final boolean onBlockActivated( World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ ) + public final boolean onBlockActivated( World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing side, float hitX, float hitY, float hitZ ) { TileEntity tile = world.getTileEntity( pos ); if( tile != null && tile instanceof TileGeneric ) @@ -153,7 +152,7 @@ public final boolean onBlockActivated( World world, BlockPos pos, IBlockState st } @Override - public final void onNeighborBlockChange( World world, BlockPos pos, IBlockState state, Block neighbour ) + public final void onNeighborChange( IBlockAccess world, BlockPos pos, BlockPos neighborPos ) { TileEntity tile = world.getTileEntity( pos ); if( tile != null && tile instanceof TileGeneric ) @@ -164,7 +163,7 @@ public final void onNeighborBlockChange( World world, BlockPos pos, IBlockState } @Override - public final boolean isSideSolid( IBlockAccess world, BlockPos pos, EnumFacing side ) + public final boolean isSideSolid( IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side ) { TileEntity tile = world.getTileEntity( pos ); if( tile != null && tile instanceof TileGeneric ) @@ -176,7 +175,7 @@ public final boolean isSideSolid( IBlockAccess world, BlockPos pos, EnumFacing s } @Override - public final boolean canBeReplacedByLeaves( IBlockAccess world, BlockPos pos ) + public final boolean canBeReplacedByLeaves( IBlockState state, IBlockAccess world, BlockPos pos ) { return false; // Generify me if anyone ever feels the need to change this } @@ -196,37 +195,56 @@ public float getExplosionResistance( World world, BlockPos pos, Entity exploder, return super.getExplosionResistance( exploder ); } - private void setBlockBounds( AxisAlignedBB bounds ) - { - setBlockBounds( - (float)bounds.minX, (float)bounds.minY, (float)bounds.minZ, - (float)bounds.maxX, (float)bounds.maxY, (float)bounds.maxZ - ); - } - @Override - public final void setBlockBoundsBasedOnState( IBlockAccess world, BlockPos pos ) + public final AxisAlignedBB getBoundingBox( IBlockState state, IBlockAccess world, BlockPos pos ) { TileEntity tile = world.getTileEntity( pos ); if( tile != null && tile instanceof TileGeneric && tile.hasWorldObj() ) { TileGeneric generic = (TileGeneric)tile; - setBlockBounds( generic.getBounds() ); + return generic.getBounds(); } + return NULL_AABB; } @Override - public final AxisAlignedBB getCollisionBoundingBox( World world, BlockPos pos, IBlockState state ) + public final AxisAlignedBB getSelectedBoundingBox( IBlockState state, World world, BlockPos pos ) { - setBlockBoundsBasedOnState( world, pos ); - return super.getCollisionBoundingBox( world, pos, state ); + return getBoundingBox( state, world, pos ); } @Override - public final void addCollisionBoxesToList( World world, BlockPos pos, IBlockState state, AxisAlignedBB bigBox, List list, Entity entity ) + public final AxisAlignedBB getCollisionBoundingBox( IBlockState state, World world, BlockPos pos ) { TileEntity tile = world.getTileEntity( pos ); - if( tile != null && tile instanceof TileGeneric ) + if( tile != null && tile instanceof TileGeneric && tile.hasWorldObj() ) + { + TileGeneric generic = (TileGeneric)tile; + + // Get collision bounds + List collision = new ArrayList( 1 ); + generic.getCollisionBounds( collision ); + + // Return the union of the collision bounds + if( collision.size() > 0 ) + { + AxisAlignedBB aabb = collision.get( 0 ); + for (int i=1; i list, Entity entity ) + { + TileEntity tile = world.getTileEntity( pos ); + if( tile != null && tile instanceof TileGeneric && tile.hasWorldObj() ) { TileGeneric generic = (TileGeneric)tile; @@ -241,26 +259,20 @@ public final void addCollisionBoxesToList( World world, BlockPos pos, IBlockStat while( it.hasNext() ) { AxisAlignedBB localBounds = it.next(); - setBlockBounds( localBounds ); - - AxisAlignedBB bounds = super.getCollisionBoundingBox( world, pos, state ); - if( bounds != null && bigBox.intersectsWith(bounds) ) - { - list.add( bounds ); - } + addCollisionBoxToList( pos, bigBox, list, localBounds ); } } } } @Override - public final boolean canProvidePower() + public final boolean canProvidePower( IBlockState state ) { return true; } @Override - public final boolean canConnectRedstone( IBlockAccess world, BlockPos pos, EnumFacing side ) + public final boolean canConnectRedstone( IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side ) { TileEntity tile = world.getTileEntity( pos ); if( tile != null && tile instanceof TileGeneric ) @@ -272,7 +284,7 @@ public final boolean canConnectRedstone( IBlockAccess world, BlockPos pos, EnumF } @Override - public final int getStrongPower( IBlockAccess world, BlockPos pos, IBlockState state, EnumFacing oppositeSide ) + public final int getStrongPower( IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing oppositeSide ) { TileEntity tile = world.getTileEntity( pos ); if( tile != null && tile instanceof TileGeneric && tile.hasWorldObj() ) @@ -284,9 +296,9 @@ public final int getStrongPower( IBlockAccess world, BlockPos pos, IBlockState s } @Override - public final int getWeakPower( IBlockAccess world, BlockPos pos, IBlockState state, EnumFacing oppositeSide ) + public final int getWeakPower( IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing oppositeSide ) { - return getStrongPower( world, pos, state, oppositeSide ); + return getStrongPower( state, world, pos, oppositeSide ); } public boolean getBundledRedstoneConnectivity( World world, BlockPos pos, EnumFacing side ) @@ -312,7 +324,7 @@ public int getBundledRedstoneOutput( World world, BlockPos pos, EnumFacing side } @Override - public boolean onBlockEventReceived( World world, BlockPos pos, IBlockState state, int eventID, int eventParameter ) + public boolean eventReceived( IBlockState state, World world, BlockPos pos, int eventID, int eventParameter ) { if( world.isRemote ) { diff --git a/src/main/java/dan200/computercraft/shared/common/DefaultBundledRedstoneProvider.java b/src/main/java/dan200/computercraft/shared/common/DefaultBundledRedstoneProvider.java index 1aa46578a..dc4db1091 100644 --- a/src/main/java/dan200/computercraft/shared/common/DefaultBundledRedstoneProvider.java +++ b/src/main/java/dan200/computercraft/shared/common/DefaultBundledRedstoneProvider.java @@ -8,7 +8,7 @@ import dan200.computercraft.api.redstone.IBundledRedstoneProvider; import net.minecraft.block.Block; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; diff --git a/src/main/java/dan200/computercraft/shared/common/TileGeneric.java b/src/main/java/dan200/computercraft/shared/common/TileGeneric.java index de2a45eff..25175b97d 100644 --- a/src/main/java/dan200/computercraft/shared/common/TileGeneric.java +++ b/src/main/java/dan200/computercraft/shared/common/TileGeneric.java @@ -16,10 +16,10 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.NetworkManager; import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.network.play.server.SPacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; @@ -65,8 +65,9 @@ protected final IBlockState getBlockState() public final void updateBlock() { - worldObj.markBlockForUpdate( getPos() ); - worldObj.markChunkDirty( getPos(), this ); + BlockPos pos = getPos(); + worldObj.markBlockRangeForRenderUpdate( pos, pos ); + worldObj.markChunkDirty( pos, this ); } protected final void setBlockState( IBlockState newState ) @@ -74,7 +75,7 @@ protected final void setBlockState( IBlockState newState ) worldObj.setBlockState( getPos(), newState, 3 ); } - public void getDroppedItems( List drops, int fortune, boolean creative, boolean silkTouch ) + public void getDroppedItems( List drops, boolean creative ) { } @@ -185,16 +186,16 @@ public boolean shouldRefresh( World world, BlockPos pos, IBlockState oldState, I } @Override - public final Packet getDescriptionPacket() + public final SPacketUpdateTileEntity getUpdatePacket() { // Communicate properties NBTTagCompound nbttagcompound = new NBTTagCompound(); writeDescription( nbttagcompound ); - return new S35PacketUpdateTileEntity( getPos(), 0, nbttagcompound ); + return new SPacketUpdateTileEntity( getPos(), 0, nbttagcompound ); } @Override - public final void onDataPacket( NetworkManager net, S35PacketUpdateTileEntity packet ) + public final void onDataPacket( NetworkManager net, SPacketUpdateTileEntity packet ) { switch( packet.getTileEntityType() ) { diff --git a/src/main/java/dan200/computercraft/shared/computer/apis/CommandAPI.java b/src/main/java/dan200/computercraft/shared/computer/apis/CommandAPI.java index 3d5c2a78f..c98b11fca 100644 --- a/src/main/java/dan200/computercraft/shared/computer/apis/CommandAPI.java +++ b/src/main/java/dan200/computercraft/shared/computer/apis/CommandAPI.java @@ -20,7 +20,7 @@ import net.minecraft.command.ICommandManager; import net.minecraft.command.ICommandSender; import net.minecraft.server.MinecraftServer; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; @@ -83,7 +83,7 @@ private Map createOutput( String output ) private Object[] doCommand( String command ) { - MinecraftServer server = MinecraftServer.getServer(); + MinecraftServer server = m_computer.getWorld().getMinecraftServer(); if( server != null && server.isCommandBlockEnabled() ) { ICommandManager commandManager = server.getCommandManager(); @@ -111,7 +111,7 @@ private Object getBlockInfo( World world, BlockPos pos ) // Get the details of the block IBlockState state = world.getBlockState( pos ); Block block = state.getBlock(); - String name = ((ResourceLocation)Block.blockRegistry.getNameForObject( block )).toString(); + String name = ((ResourceLocation)Block.REGISTRY.getNameForObject( block )).toString(); int metadata = block.getMetaFromState( state ); Map table = new HashMap(); @@ -188,7 +188,7 @@ public Object[] execute() throws LuaException { int i = 1; Map result = new HashMap(); - MinecraftServer server = MinecraftServer.getServer(); + MinecraftServer server = m_computer.getWorld().getMinecraftServer(); if( server != null ) { ICommandManager commandManager = server.getCommandManager(); @@ -201,7 +201,7 @@ public Object[] execute() throws LuaException ICommand command = (ICommand)entry.getValue(); try { - if( command.canCommandSenderUseCommand( commmandSender ) ) + if( command.checkPermission( server, commmandSender ) ) { result.put( i++, name ); } diff --git a/src/main/java/dan200/computercraft/shared/computer/blocks/BlockCommandComputer.java b/src/main/java/dan200/computercraft/shared/computer/blocks/BlockCommandComputer.java index e5b6917b2..f5db1af1f 100644 --- a/src/main/java/dan200/computercraft/shared/computer/blocks/BlockCommandComputer.java +++ b/src/main/java/dan200/computercraft/shared/computer/blocks/BlockCommandComputer.java @@ -15,12 +15,12 @@ import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.properties.PropertyEnum; -import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; @@ -32,14 +32,14 @@ public class BlockCommandComputer extends BlockComputerBase public static class Properties { public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); - public static final PropertyEnum STATE = PropertyEnum.create("state", ComputerState.class); + public static final PropertyEnum STATE = PropertyEnum.create("state", ComputerState.class); } // Members public BlockCommandComputer() { - super( Material.iron ); + super( Material.IRON ); setBlockUnbreakable(); setResistance( 6000000.0F ); setUnlocalizedName( "computercraft:command_computer" ); @@ -51,9 +51,9 @@ public BlockCommandComputer() } @Override - protected BlockState createBlockState() + protected BlockStateContainer createBlockState() { - return new BlockState(this, new IProperty[] { + return new BlockStateContainer(this, new IProperty[] { Properties.FACING, Properties.STATE }); diff --git a/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputer.java b/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputer.java index d23cecd1b..a813baa39 100644 --- a/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputer.java +++ b/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputer.java @@ -16,13 +16,13 @@ import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.properties.PropertyEnum; -import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; @@ -34,14 +34,14 @@ public static class Properties { public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); public static final PropertyBool ADVANCED = PropertyBool.create("advanced"); - public static final PropertyEnum STATE = PropertyEnum.create("state", ComputerState.class); + public static final PropertyEnum STATE = PropertyEnum.create("state", ComputerState.class); } // Members public BlockComputer() { - super( Material.rock ); + super( Material.ROCK ); setHardness( 2.0f ); setUnlocalizedName( "computercraft:computer" ); setCreativeTab( ComputerCraft.mainCreativeTab ); @@ -53,9 +53,9 @@ public BlockComputer() } @Override - protected BlockState createBlockState() + protected BlockStateContainer createBlockState() { - return new BlockState(this, new IProperty[] { + return new BlockStateContainer(this, new IProperty[] { Properties.FACING, Properties.ADVANCED, Properties.STATE diff --git a/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputerBase.java b/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputerBase.java index 358467072..4c4a099f9 100644 --- a/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputerBase.java +++ b/src/main/java/dan200/computercraft/shared/computer/blocks/BlockComputerBase.java @@ -13,7 +13,7 @@ import net.minecraft.block.state.IBlockState; import net.minecraft.item.Item; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; diff --git a/src/main/java/dan200/computercraft/shared/computer/blocks/TileCommandComputer.java b/src/main/java/dan200/computercraft/shared/computer/blocks/TileCommandComputer.java index 8bbb2fca3..045be5934 100644 --- a/src/main/java/dan200/computercraft/shared/computer/blocks/TileCommandComputer.java +++ b/src/main/java/dan200/computercraft/shared/computer/blocks/TileCommandComputer.java @@ -12,19 +12,22 @@ import dan200.computercraft.shared.computer.core.ServerComputer; import io.netty.buffer.ByteBuf; import net.minecraft.block.state.IBlockState; -import net.minecraft.command.server.CommandBlockLogic; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.server.MinecraftServer; +import net.minecraft.tileentity.CommandBlockBaseLogic; +import net.minecraft.util.math.*; +import net.minecraft.util.text.*; import net.minecraft.util.*; import net.minecraft.world.World; +import javax.annotation.Nullable; import java.util.HashMap; import java.util.Map; public class TileCommandComputer extends TileComputer { - public class CommandSender extends CommandBlockLogic + public class CommandSender extends CommandBlockBaseLogic { private Map m_outputTable; @@ -51,7 +54,7 @@ public Map copyOutput() // ICommandSender @Override - public IChatComponent getDisplayName() + public ITextComponent getDisplayName() { IComputer computer = TileCommandComputer.this.getComputer(); if( computer != null ) @@ -59,14 +62,14 @@ public IChatComponent getDisplayName() String label = computer.getLabel(); if( label != null ) { - return new ChatComponentText( computer.getLabel() ); + return new TextComponentString( computer.getLabel() ); } } - return new ChatComponentText( "@" ); + return new TextComponentString( "@" ); } @Override - public void addChatMessage( IChatComponent chatComponent ) + public void addChatMessage( ITextComponent chatComponent ) { m_outputTable.put( m_outputTable.size() + 1, chatComponent.getUnformattedText() ); } @@ -84,16 +87,22 @@ public BlockPos getPosition() } @Override - public Vec3 getPositionVector() + public Vec3d getPositionVector() { BlockPos pos = getPosition(); - return new Vec3( pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5 ); + return new Vec3d( pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5 ); } @Override public World getEntityWorld() { - return TileCommandComputer.this.worldObj; + return TileCommandComputer.this.getWorld(); + } + + @Override + public MinecraftServer getServer() + { + return TileCommandComputer.this.getWorld().getMinecraftServer(); } @Override @@ -111,13 +120,13 @@ public void updateCommand() } @Override - public int func_145751_f() + public int getCommandBlockType() { return 0; } @Override - public void func_145757_a( ByteBuf p_145757_1_ ) + public void fillInInfo( ByteBuf buf ) { } } @@ -163,10 +172,10 @@ protected ServerComputer createComputer( int instanceID, int id ) @Override public boolean isUsable( EntityPlayer player, boolean ignoreRange ) { - MinecraftServer server = MinecraftServer.getServer(); + MinecraftServer server = player.getServer(); if( server == null || !server.isCommandBlockEnabled() ) { - player.addChatMessage( new ChatComponentTranslation( "advMode.notEnabled" ) ); + player.addChatMessage( new TextComponentTranslation( "advMode.notEnabled" ) ); return false; } else if( ComputerCraft.canPlayerUseCommands( player ) && player.capabilities.isCreativeMode ) @@ -175,7 +184,7 @@ else if( ComputerCraft.canPlayerUseCommands( player ) && player.capabilities.isC } else { - player.addChatMessage( new ChatComponentTranslation( "advMode.notAllowed" ) ); + player.addChatMessage( new TextComponentTranslation( "advMode.notAllowed" ) ); return false; } } diff --git a/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputer.java b/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputer.java index 9df410f56..79bc52606 100644 --- a/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputer.java +++ b/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputer.java @@ -47,7 +47,7 @@ protected ServerComputer createComputer( int instanceID, int id ) } @Override - public void getDroppedItems( List drops, int fortune, boolean creative, boolean silkTouch ) + public void getDroppedItems( List drops, boolean creative ) { IComputer computer = getComputer(); if( !creative || (computer != null && computer.getLabel() != null) ) diff --git a/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputerBase.java b/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputerBase.java index 6ab4efe42..2da5f2a43 100644 --- a/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputerBase.java +++ b/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputerBase.java @@ -22,8 +22,9 @@ import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumHand; import net.minecraft.util.ITickable; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; public abstract class TileComputerBase extends TileGeneric @@ -113,8 +114,8 @@ protected boolean onDefaultComputerInteract( EntityPlayer player ) @Override public boolean onActivate( EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ ) { - ItemStack currentItem = player.getCurrentEquippedItem(); - if( currentItem != null && currentItem.getItem() == Items.name_tag && canNameWithTag( player ) ) + ItemStack currentItem = player.getHeldItem( EnumHand.MAIN_HAND ); + if( currentItem != null && currentItem.getItem() == Items.NAME_TAG && canNameWithTag( player ) ) { // Label to rename computer if( !worldObj.isRemote ) @@ -232,9 +233,9 @@ public void update() } @Override - public void writeToNBT( NBTTagCompound nbttagcompound ) + public NBTTagCompound writeToNBT( NBTTagCompound nbttagcompound ) { - super.writeToNBT( nbttagcompound ); + nbttagcompound = super.writeToNBT( nbttagcompound ); // Save ID, label and power state if( m_computerID >= 0 ) @@ -246,6 +247,7 @@ public void writeToNBT( NBTTagCompound nbttagcompound ) nbttagcompound.setString( "label", m_label ); } nbttagcompound.setBoolean( "on", m_on ); + return nbttagcompound; } @Override diff --git a/src/main/java/dan200/computercraft/shared/computer/core/ServerComputer.java b/src/main/java/dan200/computercraft/shared/computer/core/ServerComputer.java index 0e0eff95c..5f1c0ba17 100644 --- a/src/main/java/dan200/computercraft/shared/computer/core/ServerComputer.java +++ b/src/main/java/dan200/computercraft/shared/computer/core/ServerComputer.java @@ -21,7 +21,7 @@ import dan200.computercraft.shared.util.NBTUtil; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.fml.common.Loader; diff --git a/src/main/java/dan200/computercraft/shared/computer/items/ItemComputer.java b/src/main/java/dan200/computercraft/shared/computer/items/ItemComputer.java index 42b0056ab..2552ece3e 100644 --- a/src/main/java/dan200/computercraft/shared/computer/items/ItemComputer.java +++ b/src/main/java/dan200/computercraft/shared/computer/items/ItemComputer.java @@ -17,7 +17,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; diff --git a/src/main/java/dan200/computercraft/shared/computer/items/ItemComputerBase.java b/src/main/java/dan200/computercraft/shared/computer/items/ItemComputerBase.java index fef975efc..b3ce17fd5 100644 --- a/src/main/java/dan200/computercraft/shared/computer/items/ItemComputerBase.java +++ b/src/main/java/dan200/computercraft/shared/computer/items/ItemComputerBase.java @@ -15,6 +15,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; +import net.minecraft.util.SoundEvent; import net.minecraft.world.World; import java.util.List; @@ -92,7 +93,7 @@ public String getAudioTitle( ItemStack stack ) } @Override - public String getAudioRecordName( ItemStack stack ) + public SoundEvent getAudio( ItemStack stack ) { return null; } diff --git a/src/main/java/dan200/computercraft/shared/media/items/ItemDiskLegacy.java b/src/main/java/dan200/computercraft/shared/media/items/ItemDiskLegacy.java index 8af27f32d..b104fca91 100644 --- a/src/main/java/dan200/computercraft/shared/media/items/ItemDiskLegacy.java +++ b/src/main/java/dan200/computercraft/shared/media/items/ItemDiskLegacy.java @@ -15,7 +15,9 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; +import net.minecraft.util.SoundEvent; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import java.util.List; @@ -122,7 +124,7 @@ public String getAudioTitle( ItemStack stack ) } @Override - public String getAudioRecordName( ItemStack stack ) + public SoundEvent getAudio( ItemStack stack ) { return null; } @@ -139,19 +141,13 @@ public IMount createDataMount( ItemStack stack, World world ) return ComputerCraftAPI.createSaveDirMount( world, "computer/disk/" + diskID, ComputerCraft.floppySpaceLimit ); } - @Override - public int getColorFromItemStack( ItemStack stack, int layer ) - { - return layer == 0 ? 0xffffff : getColor(stack); - } - public int getColor( ItemStack stack ) { return Colour.Blue.getHex(); } @Override - public boolean doesSneakBypassUse( World world, BlockPos pos, EntityPlayer player ) + public boolean doesSneakBypassUse( ItemStack stack, IBlockAccess world, BlockPos pos, EntityPlayer player ) { return true; } diff --git a/src/main/java/dan200/computercraft/shared/media/items/ItemPrintout.java b/src/main/java/dan200/computercraft/shared/media/items/ItemPrintout.java index a0665a26b..d18ba6300 100644 --- a/src/main/java/dan200/computercraft/shared/media/items/ItemPrintout.java +++ b/src/main/java/dan200/computercraft/shared/media/items/ItemPrintout.java @@ -12,6 +12,9 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; import net.minecraft.world.World; import java.util.List; @@ -78,13 +81,14 @@ public String getUnlocalizedName( ItemStack stack ) } @Override - public ItemStack onItemRightClick( ItemStack stack, World world, EntityPlayer player ) + public ActionResult onItemRightClick( ItemStack stack, World world, EntityPlayer player, EnumHand hand ) { if( !world.isRemote ) { ComputerCraft.openPrintoutGUI( player ); + return new ActionResult( EnumActionResult.SUCCESS, stack ); } - return stack; + return new ActionResult( EnumActionResult.PASS, stack ); } private static ItemStack createFromTitleAndText( Type type, String title, String[] text, String[] colours ) diff --git a/src/main/java/dan200/computercraft/shared/media/items/ItemTreasureDisk.java b/src/main/java/dan200/computercraft/shared/media/items/ItemTreasureDisk.java index 90b4c8600..0f7a54f2c 100644 --- a/src/main/java/dan200/computercraft/shared/media/items/ItemTreasureDisk.java +++ b/src/main/java/dan200/computercraft/shared/media/items/ItemTreasureDisk.java @@ -16,10 +16,10 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.BlockPos; -import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.util.SoundEvent; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import net.minecraftforge.common.ChestGenHooks; import java.io.IOException; import java.util.ArrayList; @@ -30,8 +30,6 @@ public class ItemTreasureDisk extends Item implements IMedia { - private static ItemStack[] s_treasureItems = null; - public ItemTreasureDisk() { setMaxStackSize( 1 ); @@ -42,10 +40,6 @@ public ItemTreasureDisk() @Override public void getSubItems( Item itemID, CreativeTabs tabs, List list ) { - if( s_treasureItems != null ) - { - Collections.addAll( list, s_treasureItems ); - } } @Override @@ -57,15 +51,9 @@ public void addInformation( ItemStack stack, EntityPlayer player, List list, boo list.add( label ); } } - - @Override - public int getColorFromItemStack( ItemStack stack, int pass ) - { - return pass == 0 ? 0xffffff : getColour(stack); - } @Override - public boolean doesSneakBypassUse( World world, BlockPos pos, EntityPlayer player ) + public boolean doesSneakBypassUse( ItemStack stack, IBlockAccess world, BlockPos pos, EntityPlayer player ) { return true; } @@ -91,7 +79,7 @@ public String getAudioTitle( ItemStack stack ) } @Override - public String getAudioRecordName( ItemStack stack ) + public SoundEvent getAudio( ItemStack stack ) { return null; } @@ -145,91 +133,11 @@ public static ItemStack create( String subPath, int colourIndex ) return result; } - public static void registerDungeonLoot() - { - if( s_treasureItems == null ) - { - // Get the list of all programs - List paths = new ArrayList(); - try - { - IMount treasure = getTreasureMount(); - if( treasure != null ) - { - List authors = new ArrayList(); - treasure.list( "", authors ); - for( String author : authors ) - { - if( treasure.isDirectory( author ) && !author.equals( "deprecated" ) ) - { - List titles = new ArrayList(); - treasure.list( author, titles ); - for( String title : titles ) - { - String path = author + "/" + title; - if( treasure.isDirectory( path ) ) - { - paths.add( path ); - } - } - } - } - } - } - catch( java.io.IOException e ) - { - // no items for us - } - - // Build creative tab - List allTreasure = new ArrayList(); - for( String path : paths ) - { - ItemStack stack = create( path, 4 ); - allTreasure.add( stack ); - } - s_treasureItems = allTreasure.toArray( new ItemStack[ allTreasure.size() ] ); - - // Register the loot - int n=0; - Random random = new Random(); - WeightedRandomChestContent[] content = new WeightedRandomChestContent[ paths.size() * ComputerCraft.treasureDiskLootFrequency ]; - WeightedRandomChestContent[] commonContent = new WeightedRandomChestContent[ paths.size() * ComputerCraft.treasureDiskLootFrequency ]; - for( String path : paths ) - { - // Don't use all the random colours - // We don't want to overload the probability matrix - for( int i=0; i MODEM = PropertyEnum.create( "modem", BlockCableModemVariant.class ); public static final PropertyBool CABLE = PropertyBool.create( "cable" ); public static final PropertyBool NORTH = PropertyBool.create( "north" ); public static final PropertyBool SOUTH = PropertyBool.create( "south" ); @@ -74,9 +74,9 @@ public BlockCable() } @Override - protected BlockState createBlockState() + protected BlockStateContainer createBlockState() { - return new BlockState(this, new IProperty[] { + return new BlockStateContainer(this, new IProperty[] { Properties.MODEM, Properties.CABLE, Properties.NORTH, @@ -209,7 +209,7 @@ public IBlockState getActualState( IBlockState state, IBlockAccess world, BlockP } @Override - public boolean shouldSideBeRendered( IBlockAccess world, BlockPos pos, EnumFacing side ) + public boolean shouldSideBeRendered( IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side ) { return true; } diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheral.java index f5204cee8..d3f6bcc8c 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheral.java @@ -16,15 +16,15 @@ import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.properties.PropertyEnum; -import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; -import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.util.BlockRenderLayer; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; @@ -34,8 +34,8 @@ public class BlockPeripheral extends BlockPeripheralBase { public static class Properties { - public static final PropertyDirection FACING = PropertyDirection.create( "facing",EnumFacing.Plane.HORIZONTAL ); - public static final PropertyEnum VARIANT = PropertyEnum.create( "variant", BlockPeripheralVariant.class ); + public static final PropertyDirection FACING = PropertyDirection.create( "facing", EnumFacing.Plane.HORIZONTAL ); + public static final PropertyEnum VARIANT = PropertyEnum.create( "variant", BlockPeripheralVariant.class ); } public BlockPeripheral() @@ -50,15 +50,15 @@ public BlockPeripheral() } @SideOnly( Side.CLIENT) - public EnumWorldBlockLayer getBlockLayer() + public BlockRenderLayer getBlockLayer() { - return EnumWorldBlockLayer.CUTOUT; + return BlockRenderLayer.CUTOUT; } @Override - protected BlockState createBlockState() + protected BlockStateContainer createBlockState() { - return new BlockState(this, new IProperty[] { + return new BlockStateContainer(this, new IProperty[] { Properties.FACING, Properties.VARIANT }); diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheralBase.java b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheralBase.java index 8b93ac597..a96c3dc0a 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheralBase.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheralBase.java @@ -12,7 +12,7 @@ import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.item.Item; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; @@ -21,7 +21,7 @@ public abstract class BlockPeripheralBase extends BlockDirectional { public BlockPeripheralBase() { - super( Material.rock ); + super( Material.ROCK ); } protected abstract IBlockState getDefaultBlockState( PeripheralType type, EnumFacing placedSide ); @@ -30,13 +30,13 @@ public BlockPeripheralBase() protected abstract TilePeripheralBase createTile( PeripheralType type ); @Override - public final boolean isOpaqueCube() + public final boolean isOpaqueCube( IBlockState state ) { return false; } @Override - public final boolean isFullCube() + public final boolean isFullCube( IBlockState state ) { return false; } diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/DefaultPeripheralProvider.java b/src/main/java/dan200/computercraft/shared/peripheral/common/DefaultPeripheralProvider.java index 6937282d8..91f85a545 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/DefaultPeripheralProvider.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/DefaultPeripheralProvider.java @@ -12,7 +12,7 @@ import dan200.computercraft.shared.computer.blocks.TileComputerBase; import dan200.computercraft.shared.turtle.blocks.TileTurtle; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/ItemCable.java b/src/main/java/dan200/computercraft/shared/peripheral/common/ItemCable.java index 557212698..0606513b4 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/ItemCable.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/ItemCable.java @@ -17,7 +17,10 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; @@ -67,11 +70,11 @@ public void getSubItems( Item itemID, CreativeTabs tabs, List list ) } @Override - public boolean onItemUse( ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float fx, float fy, float fz ) + public EnumActionResult onItemUse( ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float fx, float fy, float fz ) { if( !canPlaceBlockOnSide( world, pos, side, player, stack ) ) { - return false; + return EnumActionResult.FAIL; } // Try to add a cable to a modem @@ -86,7 +89,7 @@ public boolean onItemUse( ItemStack stack, EntityPlayer player, World world, Blo if( stack.stackSize > 0 ) { world.setBlockState( pos, existingState.withProperty( BlockCable.Properties.CABLE, true ), 3 ); - world.playSoundEffect( pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, ComputerCraft.Blocks.cable.stepSound.getBreakSound(), (ComputerCraft.Blocks.cable.stepSound.getVolume() + 1.0F) / 2.0F, ComputerCraft.Blocks.cable.stepSound.getFrequency() * 0.8F); + world.playSound( null, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, ComputerCraft.Blocks.cable.getSoundType().getBreakSound(), SoundCategory.BLOCKS, (ComputerCraft.Blocks.cable.getSoundType().getVolume() + 1.0F ) / 2.0F, ComputerCraft.Blocks.cable.getSoundType().getPitch() * 0.8F); stack.stackSize--; TileEntity tile = world.getTileEntity( pos ); @@ -95,14 +98,14 @@ public boolean onItemUse( ItemStack stack, EntityPlayer player, World world, Blo TileCable cable = (TileCable)tile; cable.networkChanged(); } - return true; + return EnumActionResult.SUCCESS; } - return false; + return EnumActionResult.FAIL; } } // Try to add on the side of something - if( existing != Blocks.air && (type == PeripheralType.Cable || existing.isSideSolid( world, pos, side )) ) + if( !existing.isAir( existingState, world, pos ) && (type == PeripheralType.Cable || existing.isSideSolid( existingState, world, pos, side )) ) { BlockPos offset = pos.offset( side ); Block offsetExisting = world.getBlockState( offset ).getBlock(); @@ -116,7 +119,7 @@ public boolean onItemUse( ItemStack stack, EntityPlayer player, World world, Blo if( stack.stackSize > 0 ) { world.setBlockState( offset, offsetExistingState.withProperty( BlockCable.Properties.MODEM, BlockCableModemVariant.fromFacing( side.getOpposite() ) ), 3 ); - world.playSoundEffect( offset.getX() + 0.5, offset.getY() + 0.5, offset.getZ() + 0.5, ComputerCraft.Blocks.cable.stepSound.getBreakSound(), (ComputerCraft.Blocks.cable.stepSound.getVolume() + 1.0F) / 2.0F, ComputerCraft.Blocks.cable.stepSound.getFrequency() * 0.8F); + world.playSound( null, offset.getX() + 0.5, offset.getY() + 0.5, offset.getZ() + 0.5, ComputerCraft.Blocks.cable.getSoundType().getBreakSound(), SoundCategory.BLOCKS, (ComputerCraft.Blocks.cable.getSoundType().getVolume() + 1.0F ) / 2.0F, ComputerCraft.Blocks.cable.getSoundType().getPitch() * 0.8F); stack.stackSize--; TileEntity tile = world.getTileEntity( offset ); @@ -125,9 +128,9 @@ public boolean onItemUse( ItemStack stack, EntityPlayer player, World world, Blo TileCable cable = (TileCable)tile; cable.networkChanged(); } - return true; + return EnumActionResult.SUCCESS; } - return false; + return EnumActionResult.FAIL; } // Try to add a cable to a modem @@ -136,7 +139,7 @@ public boolean onItemUse( ItemStack stack, EntityPlayer player, World world, Blo if( stack.stackSize > 0 ) { world.setBlockState( offset, offsetExistingState.withProperty( BlockCable.Properties.CABLE, true ), 3 ); - world.playSoundEffect( offset.getX() + 0.5, offset.getY() + 0.5, offset.getZ() + 0.5, ComputerCraft.Blocks.cable.stepSound.getBreakSound(), (ComputerCraft.Blocks.cable.stepSound.getVolume() + 1.0F) / 2.0F, ComputerCraft.Blocks.cable.stepSound.getFrequency() * 0.8F); + world.playSound( null, offset.getX() + 0.5, offset.getY() + 0.5, offset.getZ() + 0.5, ComputerCraft.Blocks.cable.getSoundType().getBreakSound(), SoundCategory.BLOCKS, (ComputerCraft.Blocks.cable.getSoundType().getVolume() + 1.0F ) / 2.0F, ComputerCraft.Blocks.cable.getSoundType().getPitch() * 0.8F); stack.stackSize--; TileEntity tile = world.getTileEntity( offset ); @@ -145,14 +148,14 @@ public boolean onItemUse( ItemStack stack, EntityPlayer player, World world, Blo TileCable cable = (TileCable)tile; cable.networkChanged(); } - return true; + return EnumActionResult.SUCCESS; } - return false; + return EnumActionResult.FAIL; } } } - return super.onItemUse( stack, player, world, pos, side, fx, fy, fz ); + return super.onItemUse( stack, player, world, pos, hand, side, fx, fy, fz ); } @Override diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/ItemPeripheralBase.java b/src/main/java/dan200/computercraft/shared/peripheral/common/ItemPeripheralBase.java index 99fc52bce..640cebab3 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/ItemPeripheralBase.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/ItemPeripheralBase.java @@ -11,7 +11,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/TilePeripheralBase.java b/src/main/java/dan200/computercraft/shared/peripheral/common/TilePeripheralBase.java index 294e6bdb5..baf55ec30 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/TilePeripheralBase.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/TilePeripheralBase.java @@ -45,7 +45,7 @@ public BlockPeripheralBase getBlock() } @Override - public void getDroppedItems( List drops, int fortune, boolean creative, boolean silkTouch ) + public void getDroppedItems( List drops, boolean creative ) { if( !creative ) { @@ -150,16 +150,17 @@ public void readFromNBT( NBTTagCompound nbttagcompound ) } @Override - public void writeToNBT( NBTTagCompound nbttagcompound ) + public NBTTagCompound writeToNBT( NBTTagCompound nbttagcompound ) { // Write properties - super.writeToNBT( nbttagcompound ); + nbttagcompound = super.writeToNBT( nbttagcompound ); nbttagcompound.setInteger( "dir", m_dir.getIndex() ); nbttagcompound.setInteger( "anim", m_anim ); if( m_label != null ) { nbttagcompound.setString( "label", m_label ); } + return nbttagcompound; } @Override diff --git a/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/DiskDrivePeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/DiskDrivePeripheral.java index e48826a3b..d797ad5c0 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/DiskDrivePeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/DiskDrivePeripheral.java @@ -118,7 +118,7 @@ public Object[] callMethod( IComputerAccess computer, ILuaContext context, int m IMedia media = m_diskDrive.getDiskMedia(); if( media != null ) { - return new Object[] { media.getAudioRecordName( m_diskDrive.getDiskStack() ) != null }; + return new Object[] { media.getAudio( m_diskDrive.getDiskStack() ) != null }; } return new Object[] { false }; } diff --git a/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/TileDiskDrive.java b/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/TileDiskDrive.java index 96ca3d034..6b1c576f3 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/TileDiskDrive.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/TileDiskDrive.java @@ -17,6 +17,7 @@ import dan200.computercraft.shared.peripheral.common.TilePeripheralBase; import dan200.computercraft.shared.util.InventoryUtil; import net.minecraft.block.state.IBlockState; +import net.minecraft.client.audio.Sound; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; @@ -24,6 +25,8 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ITickable; import net.minecraft.util.*; +import net.minecraft.util.math.*; +import net.minecraft.util.text.*; import net.minecraft.world.World; import java.util.HashMap; @@ -89,13 +92,13 @@ public boolean onActivate( EntityPlayer player, EnumFacing side, float hitX, flo // Try to put a disk into the drive if( !worldObj.isRemote ) { - ItemStack disk = player.getCurrentEquippedItem(); + ItemStack disk = player.getHeldItem( EnumHand.MAIN_HAND ); if( disk != null && getStackInSlot(0) == null ) { if( ComputerCraft.getMedia( disk ) != null ) { setInventorySlotContents( 0, disk ); - player.destroyCurrentEquippedItem(); + player.setHeldItem( EnumHand.MAIN_HAND, null ); return true; } } @@ -143,15 +146,16 @@ public void readFromNBT(NBTTagCompound nbttagcompound) } @Override - public void writeToNBT(NBTTagCompound nbttagcompound) + public NBTTagCompound writeToNBT(NBTTagCompound nbttagcompound) { - super.writeToNBT(nbttagcompound); + nbttagcompound = super.writeToNBT(nbttagcompound); if( m_diskStack != null ) { NBTTagCompound item = new NBTTagCompound(); m_diskStack.writeToNBT( item ); nbttagcompound.setTag( "item", item ); } + return nbttagcompound; } @Override @@ -178,7 +182,7 @@ public void update() if( m_recordQueued ) { IMedia contents = getDiskMedia(); - String record = (contents != null) ? contents.getAudioRecordName( m_diskStack ) : null; + SoundEvent record = (contents != null) ? contents.getAudio( m_diskStack ) : null; if( record != null ) { m_recordPlaying = true; @@ -331,15 +335,15 @@ public String getName() } @Override - public IChatComponent getDisplayName() + public ITextComponent getDisplayName() { if( hasCustomName() ) { - return new ChatComponentText( getName() ); + return new TextComponentString( getName() ); } else { - return new ChatComponentTranslation( getName() ); + return new TextComponentTranslation( getName() ); } } @@ -603,7 +607,7 @@ private synchronized void ejectContents( boolean destroyed ) worldObj.spawnEntityInWorld(entityitem); if( !destroyed ) { - worldObj.playAuxSFX(1000, getPos(), 0); + worldObj.playBroadcastSound(1000, getPos(), 0); } } } @@ -665,7 +669,7 @@ public boolean shouldRefresh( World world, BlockPos pos, IBlockState oldState, I private void playRecord() { IMedia contents = getDiskMedia(); - String record = (contents != null) ? contents.getAudioRecordName( m_diskStack ) : null; + SoundEvent record = (contents != null) ? contents.getAudio( m_diskStack ) : null; if( record != null ) { ComputerCraft.playRecord( record, contents.getAudioTitle( m_diskStack ), worldObj, getPos() ); diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/BlockAdvancedModem.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/BlockAdvancedModem.java index e13c1a32d..f5b4dcce9 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/BlockAdvancedModem.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/BlockAdvancedModem.java @@ -13,12 +13,12 @@ import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.properties.PropertyDirection; -import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; @@ -43,9 +43,9 @@ public BlockAdvancedModem() } @Override - protected BlockState createBlockState() + protected BlockStateContainer createBlockState() { - return new BlockState(this, new IProperty[] { + return new BlockStateContainer(this, new IProperty[] { Properties.FACING, Properties.ON }); diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/INetwork.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/INetwork.java index 983edf787..267477b8d 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/INetwork.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/INetwork.java @@ -6,13 +6,13 @@ package dan200.computercraft.shared.peripheral.modem; -import net.minecraft.util.Vec3; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; public interface INetwork { public void addReceiver( IReceiver receiver ); public void removeReceiver( IReceiver receiver ); - public void transmit( int channel, int replyChannel, Object payload, World world, Vec3 pos, double range, boolean interdimensional, Object senderObject ); + public void transmit( int channel, int replyChannel, Object payload, World world, Vec3d pos, double range, boolean interdimensional, Object senderObject ); public boolean isWireless(); } diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/IReceiver.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/IReceiver.java index b7eab1287..7e3fce65f 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/IReceiver.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/IReceiver.java @@ -5,14 +5,14 @@ */ package dan200.computercraft.shared.peripheral.modem; -import net.minecraft.util.Vec3; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; public interface IReceiver { public int getChannel(); public World getWorld(); - public Vec3 getWorldPosition(); + public Vec3d getWorldPosition(); public boolean isInterdimensional(); public double getReceiveRange(); public void receiveSameDimension( int replyChannel, Object payload, double distance, Object senderObject ); diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/ModemPeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/ModemPeripheral.java index d8220f463..a16a5de02 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/ModemPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/ModemPeripheral.java @@ -10,7 +10,7 @@ import dan200.computercraft.api.lua.LuaException; import dan200.computercraft.api.peripheral.IComputerAccess; import dan200.computercraft.api.peripheral.IPeripheral; -import net.minecraft.util.Vec3; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; import java.util.HashMap; @@ -46,7 +46,7 @@ public World getWorld() } @Override - public Vec3 getWorldPosition() + public Vec3d getWorldPosition() { return m_owner.getWorldPosition(); } @@ -135,7 +135,7 @@ protected void switchNetwork() protected abstract World getWorld(); - protected abstract Vec3 getPosition(); + protected abstract Vec3d getPosition(); public synchronized void destroy() { @@ -163,7 +163,7 @@ public synchronized boolean isActive() return (m_computer != null) && m_open; } - public synchronized Vec3 getWorldPosition() + public synchronized Vec3d getWorldPosition() { return getPosition(); } @@ -338,7 +338,7 @@ public Object[] callMethod( IComputerAccess computer, ILuaContext context, int m synchronized( this ) { World world = getWorld(); - Vec3 position = getPosition(); + Vec3d position = getPosition(); if( world != null && position != null && m_network != null) { m_network.transmit( channel, replyChannel, payload, world, position, getTransmitRange(), isInterdimensional(), this ); diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/TileAdvancedModem.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/TileAdvancedModem.java index 37879407c..4ff2186a3 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/TileAdvancedModem.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/TileAdvancedModem.java @@ -9,9 +9,9 @@ import dan200.computercraft.api.peripheral.IPeripheral; import dan200.computercraft.shared.peripheral.common.BlockPeripheral; import net.minecraft.block.state.IBlockState; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; -import net.minecraft.util.Vec3; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; public class TileAdvancedModem extends TileModemBase @@ -35,10 +35,10 @@ public World getWorld() } @Override - protected Vec3 getPosition() + protected Vec3d getPosition() { BlockPos pos = m_entity.getPos().offset( m_entity.getDirection() ); - return new Vec3( (double)pos.getX(), (double)pos.getY(), (double)pos.getZ() ); + return new Vec3d( (double)pos.getX(), (double)pos.getY(), (double)pos.getZ() ); } @Override @@ -64,7 +64,7 @@ public EnumFacing getDirection() { // Wireless Modem IBlockState state = getBlockState(); - return (EnumFacing)state.getValue( BlockPeripheral.Properties.FACING ); + return (EnumFacing)state.getValue( BlockAdvancedModem.Properties.FACING ); } @Override @@ -72,7 +72,7 @@ public void setDirection( EnumFacing dir ) { // Wireless Modem setBlockState( getBlockState() - .withProperty( BlockPeripheral.Properties.FACING, dir ) + .withProperty( BlockAdvancedModem.Properties.FACING, dir ) ); } diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/TileCable.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/TileCable.java index c60849606..808762b07 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/TileCable.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/TileCable.java @@ -27,6 +27,8 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.*; +import net.minecraft.util.math.*; +import net.minecraft.util.text.*; import net.minecraft.world.World; import java.io.File; @@ -71,11 +73,11 @@ protected World getWorld() } @Override - protected Vec3 getPosition() + protected Vec3d getPosition() { EnumFacing direction = m_entity.getDirection(); BlockPos pos = m_entity.getPos().offset( direction ); - return new Vec3( (double)pos.getX() + 0.5, (double)pos.getY() + 0.5, (double)pos.getZ() + 0.5 ); + return new Vec3d( (double)pos.getX() + 0.5, (double)pos.getY() + 0.5, (double)pos.getZ() + 0.5 ); } @Override @@ -287,7 +289,7 @@ public void setDirection( EnumFacing dir ) } @Override - public void getDroppedItems( List drops, int fortune, boolean creative, boolean silkTouch ) + public void getDroppedItems( List drops, boolean creative ) { if( !creative ) { @@ -337,7 +339,7 @@ public void onNeighbourChange() case WiredModem: { // Drop everything and remove block - ((BlockGeneric)getBlockType()).dropAllItems( worldObj, getPos(), 0, false, false ); + ((BlockGeneric)getBlockType()).dropAllItems( worldObj, getPos(), false ); worldObj.setBlockToAir( getPos() ); break; } @@ -456,13 +458,13 @@ public boolean onActivate( EntityPlayer player, EnumFacing side, float hitX, flo if( oldPeriphName != null ) { player.addChatMessage( - new ChatComponentTranslation( "gui.computercraft:wired_modem.peripheral_disconnected", oldPeriphName ) + new TextComponentTranslation( "gui.computercraft:wired_modem.peripheral_disconnected", oldPeriphName ) ); } if( periphName != null ) { player.addChatMessage( - new ChatComponentTranslation( "gui.computercraft:wired_modem.peripheral_connected", periphName ) + new TextComponentTranslation( "gui.computercraft:wired_modem.peripheral_connected", periphName ) ); } return true; @@ -488,12 +490,13 @@ public void readFromNBT(NBTTagCompound nbttagcompound) } @Override - public void writeToNBT(NBTTagCompound nbttagcompound) + public NBTTagCompound writeToNBT(NBTTagCompound nbttagcompound) { // Write properties - super.writeToNBT(nbttagcompound); + nbttagcompound = super.writeToNBT(nbttagcompound); nbttagcompound.setBoolean( "peripheralAccess", m_peripheralAccessAllowed ); nbttagcompound.setInteger( "peripheralID", m_attachedPeripheralID ); + return nbttagcompound; } @Override @@ -590,7 +593,7 @@ public void removeReceiver( IReceiver receiver ) } @Override - public void transmit( int channel, int replyChannel, Object payload, World world, Vec3 pos, double range, boolean interdimensional, Object senderObject ) + public void transmit( int channel, int replyChannel, Object payload, World world, Vec3d pos, double range, boolean interdimensional, Object senderObject ) { Packet p = new Packet(); p.channel = channel; diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/TileModemBase.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/TileModemBase.java index 45d79fc86..e56d4c30b 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/TileModemBase.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/TileModemBase.java @@ -10,7 +10,7 @@ import dan200.computercraft.shared.common.BlockGeneric; import dan200.computercraft.shared.peripheral.common.TilePeripheralBase; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.EnumFacing; public abstract class TileModemBase extends TilePeripheralBase @@ -50,7 +50,7 @@ public void onNeighbourChange() ) ) { // Drop everything and remove block - ((BlockGeneric)getBlockType()).dropAllItems( worldObj, getPos(), 0, false, false ); + ((BlockGeneric)getBlockType()).dropAllItems( worldObj, getPos(), false ); worldObj.setBlockToAir( getPos() ); } } diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/TileWirelessModem.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/TileWirelessModem.java index c585e928b..58958c3d0 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/TileWirelessModem.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/TileWirelessModem.java @@ -12,9 +12,9 @@ import dan200.computercraft.shared.peripheral.common.BlockPeripheral; import dan200.computercraft.shared.peripheral.common.BlockPeripheralVariant; import net.minecraft.block.state.IBlockState; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; -import net.minecraft.util.Vec3; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; public class TileWirelessModem extends TileModemBase @@ -38,10 +38,10 @@ protected World getWorld() } @Override - protected Vec3 getPosition() + protected Vec3d getPosition() { BlockPos pos = m_entity.getPos().offset( m_entity.getDirection() ); - return new Vec3( (double)pos.getX(), (double)pos.getY(), (double)pos.getZ() ); + return new Vec3d( (double)pos.getX(), (double)pos.getY(), (double)pos.getZ() ); } @Override diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/WirelessModemPeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/WirelessModemPeripheral.java index 2d55aaca6..eef732ec5 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/WirelessModemPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/WirelessModemPeripheral.java @@ -7,7 +7,7 @@ package dan200.computercraft.shared.peripheral.modem; import dan200.computercraft.ComputerCraft; -import net.minecraft.util.Vec3; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; public abstract class WirelessModemPeripheral extends ModemPeripheral @@ -37,7 +37,7 @@ protected double getTransmitRange() World world = getWorld(); if( world != null ) { - Vec3 position = getPosition(); + Vec3d position = getPosition(); double minRange = (double) ComputerCraft.modem_range; double maxRange = (double) ComputerCraft.modem_highAltitudeRange; if( world.isRaining() && world.isThundering() ) diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/WirelessNetwork.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/WirelessNetwork.java index 997b8b2a6..51429fd3a 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/WirelessNetwork.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/WirelessNetwork.java @@ -6,7 +6,7 @@ package dan200.computercraft.shared.peripheral.modem; -import net.minecraft.util.Vec3; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; import java.util.*; @@ -61,7 +61,7 @@ public synchronized void removeReceiver( IReceiver receiver ) } @Override - public synchronized void transmit( int channel, int replyChannel, Object payload, World world, Vec3 pos, double range, boolean interdimensional, Object senderObject ) + public synchronized void transmit( int channel, int replyChannel, Object payload, World world, Vec3d pos, double range, boolean interdimensional, Object senderObject ) { Set receivers = m_receivers.get( channel ); if( receivers != null ) @@ -75,11 +75,11 @@ public synchronized void transmit( int channel, int replyChannel, Object payload } } - private void tryTransmit( IReceiver receiver, int replyChannel, Object payload, World world, Vec3 pos, double range, boolean interdimensional, Object senderObject ) + private void tryTransmit( IReceiver receiver, int replyChannel, Object payload, World world, Vec3d pos, double range, boolean interdimensional, Object senderObject ) { if( receiver.getWorld() == world ) { - Vec3 position = receiver.getWorldPosition(); + Vec3d position = receiver.getWorldPosition(); double receiveRange = Math.max( range, receiver.getReceiveRange() ); // Ensure range is symmetrical double distanceSq = position.squareDistanceTo( pos ); if( interdimensional || receiver.isInterdimensional() || distanceSq <= ( receiveRange * receiveRange ) ) diff --git a/src/main/java/dan200/computercraft/shared/peripheral/monitor/TileMonitor.java b/src/main/java/dan200/computercraft/shared/peripheral/monitor/TileMonitor.java index 23139ea0c..a77dd6daf 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/monitor/TileMonitor.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/monitor/TileMonitor.java @@ -20,8 +20,8 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; @@ -112,14 +112,15 @@ public boolean onActivate( EntityPlayer player, EnumFacing side, float hitX, flo } @Override - public void writeToNBT( NBTTagCompound nbttagcompound ) + public NBTTagCompound writeToNBT( NBTTagCompound nbttagcompound ) { - super.writeToNBT(nbttagcompound); + nbttagcompound = super.writeToNBT( nbttagcompound); nbttagcompound.setInteger( "xIndex", m_xIndex ); nbttagcompound.setInteger( "yIndex", m_yIndex ); nbttagcompound.setInteger( "width", m_width ); nbttagcompound.setInteger( "height", m_height ); nbttagcompound.setInteger( "dir", m_dir ); + return nbttagcompound; } @Override diff --git a/src/main/java/dan200/computercraft/shared/peripheral/printer/ContainerPrinter.java b/src/main/java/dan200/computercraft/shared/peripheral/printer/ContainerPrinter.java index 49c58ccdf..ded747cf7 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/printer/ContainerPrinter.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/printer/ContainerPrinter.java @@ -9,7 +9,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.inventory.Container; -import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.IContainerListener; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; @@ -61,10 +61,10 @@ public boolean isPrinting() } @Override - public void onCraftGuiOpened( ICrafting crafting ) + public void addListener( IContainerListener crafting ) { - super.onCraftGuiOpened( crafting ); - crafting.sendProgressBarUpdate( this, 0, m_printer.isPrinting() ? 1 : 0 ); + super.addListener( crafting ); + crafting.sendProgressBarUpdate( this, 0, m_printer.isPrinting() ? 1 : 0 ); } @Override @@ -75,9 +75,9 @@ public void detectAndSendChanges() if( !m_printer.getWorld().isRemote ) { boolean printing = m_printer.isPrinting(); - for (int i=0; i onItemRightClick( ItemStack stack, World world, EntityPlayer player, EnumHand hand ) { if( !world.isRemote ) { @@ -166,8 +170,9 @@ public ItemStack onItemRightClick( ItemStack stack, World world, EntityPlayer pl computer.turnOn(); } ComputerCraft.openPocketComputerGUI( player ); + return new ActionResult( EnumActionResult.SUCCESS, stack ); } - return stack; + return new ActionResult( EnumActionResult.PASS, stack ); } @Override @@ -194,14 +199,14 @@ public String getItemStackDisplayName( ItemStack stack ) boolean modem = getHasModem( stack ); if( modem ) { - return StatCollector.translateToLocalFormatted( + return I18n.translateToLocalFormatted( baseString + ".upgraded.name", - StatCollector.translateToLocal( "upgrade.computercraft:wireless_modem.adjective" ) + I18n.translateToLocal( "upgrade.computercraft:wireless_modem.adjective" ) ); } else { - return StatCollector.translateToLocal( baseString + ".name" ); + return I18n.translateToLocal( baseString + ".name" ); } } @@ -370,7 +375,7 @@ public String getAudioTitle( ItemStack stack ) } @Override - public String getAudioRecordName( ItemStack stack ) + public SoundEvent getAudio( ItemStack stack ) { return null; } diff --git a/src/main/java/dan200/computercraft/shared/pocket/peripherals/PocketModemPeripheral.java b/src/main/java/dan200/computercraft/shared/pocket/peripherals/PocketModemPeripheral.java index 9f1bfcff2..07371dc93 100644 --- a/src/main/java/dan200/computercraft/shared/pocket/peripherals/PocketModemPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/pocket/peripherals/PocketModemPeripheral.java @@ -2,7 +2,7 @@ import dan200.computercraft.api.peripheral.IPeripheral; import dan200.computercraft.shared.peripheral.modem.WirelessModemPeripheral; -import net.minecraft.util.Vec3; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; /** @@ -14,18 +14,18 @@ public class PocketModemPeripheral extends WirelessModemPeripheral { private World m_world; - private Vec3 m_position; + private Vec3d m_position; public PocketModemPeripheral( boolean advanced ) { super( advanced ); m_world = null; - m_position = new Vec3( 0.0, 0.0, 0.0 ); + m_position = new Vec3d( 0.0, 0.0, 0.0 ); } public void setLocation( World world, double x, double y, double z ) { - m_position = new Vec3( x, y, z ); + m_position = new Vec3d( x, y, z ); if( m_world != world ) { m_world = world; @@ -40,7 +40,7 @@ protected World getWorld() } @Override - protected Vec3 getPosition() + protected Vec3d getPosition() { if( m_world != null ) { diff --git a/src/main/java/dan200/computercraft/shared/proxy/CCTurtleProxyCommon.java b/src/main/java/dan200/computercraft/shared/proxy/CCTurtleProxyCommon.java index 93a9ebc72..45135cc40 100644 --- a/src/main/java/dan200/computercraft/shared/proxy/CCTurtleProxyCommon.java +++ b/src/main/java/dan200/computercraft/shared/proxy/CCTurtleProxyCommon.java @@ -342,37 +342,37 @@ private void registerItems() // Recipes // Turtle GameRegistry.addRecipe( new TurtleRecipe( new Item[] { - Items.iron_ingot, Items.iron_ingot, Items.iron_ingot, - Items.iron_ingot, Item.getItemFromBlock( ComputerCraft.Blocks.computer ), Items.iron_ingot, - Items.iron_ingot, Item.getItemFromBlock( Blocks.chest ), Items.iron_ingot, + Items.IRON_INGOT, Items.IRON_INGOT, Items.IRON_INGOT, + Items.IRON_INGOT, Item.getItemFromBlock( ComputerCraft.Blocks.computer ), Items.IRON_INGOT, + Items.IRON_INGOT, Item.getItemFromBlock( Blocks.CHEST ), Items.IRON_INGOT, }, ComputerFamily.Normal ) ); GameRegistry.addRecipe( new TurtleUpgradeRecipe() ); // Impostor Turtle recipe (to fool NEI) - ItemStack iron = new ItemStack( Items.iron_ingot, 1 ); + ItemStack iron = new ItemStack( Items.IRON_INGOT, 1 ); GameRegistry.addRecipe( new ImpostorRecipe( 3, 3, new ItemStack[] { iron, iron, iron, iron, ComputerItemFactory.create( -1, null, ComputerFamily.Normal ), iron, - iron, new ItemStack( Blocks.chest, 1 ), iron, + iron, new ItemStack( Blocks.CHEST, 1 ), iron, }, TurtleItemFactory.create( -1, null, null, ComputerFamily.Normal, null, null, 0, null ) ) ); // Advanced Turtle GameRegistry.addRecipe( new TurtleRecipe( new Item[] { - Items.gold_ingot, Items.gold_ingot, Items.gold_ingot, - Items.gold_ingot, Item.getItemFromBlock( ComputerCraft.Blocks.computer ), Items.gold_ingot, - Items.gold_ingot, Item.getItemFromBlock( Blocks.chest ), Items.gold_ingot, + Items.GOLD_INGOT, Items.GOLD_INGOT, Items.GOLD_INGOT, + Items.GOLD_INGOT, Item.getItemFromBlock( ComputerCraft.Blocks.computer ), Items.GOLD_INGOT, + Items.GOLD_INGOT, Item.getItemFromBlock( Blocks.CHEST ), Items.GOLD_INGOT, }, ComputerFamily.Advanced ) ); // Impostor Advanced Turtle recipe (to fool NEI) - ItemStack gold = new ItemStack( Items.gold_ingot, 1 ); + ItemStack gold = new ItemStack( Items.GOLD_INGOT, 1 ); GameRegistry.addRecipe( new ImpostorRecipe( 3, 3, new ItemStack[] { gold, gold, gold, gold, ComputerItemFactory.create( -1, null, ComputerFamily.Advanced ), gold, - gold, new ItemStack( Blocks.chest, 1 ), gold, + gold, new ItemStack( Blocks.CHEST, 1 ), gold, }, TurtleItemFactory.create( -1, null, null, ComputerFamily.Advanced, null, null, 0, null ) ) ); @@ -384,19 +384,19 @@ gold, new ItemStack( Blocks.chest, 1 ), gold, ComputerCraft.Upgrades.craftingTable = new TurtleCraftingTable( 2 ); registerTurtleUpgradeInternal( ComputerCraft.Upgrades.craftingTable ); - ComputerCraft.Upgrades.diamondSword = new TurtleSword( new ResourceLocation( "minecraft", "diamond_sword" ), 3, "upgrade.minecraft:diamond_sword.adjective", Items.diamond_sword ); + ComputerCraft.Upgrades.diamondSword = new TurtleSword( new ResourceLocation( "minecraft", "diamond_sword" ), 3, "upgrade.minecraft:diamond_sword.adjective", Items.DIAMOND_SWORD ); registerTurtleUpgradeInternal( ComputerCraft.Upgrades.diamondSword ); - ComputerCraft.Upgrades.diamondShovel = new TurtleShovel( new ResourceLocation( "minecraft", "diamond_shovel" ), 4, "upgrade.minecraft:diamond_shovel.adjective", Items.diamond_shovel ); + ComputerCraft.Upgrades.diamondShovel = new TurtleShovel( new ResourceLocation( "minecraft", "diamond_shovel" ), 4, "upgrade.minecraft:diamond_shovel.adjective", Items.DIAMOND_SHOVEL ); registerTurtleUpgradeInternal( ComputerCraft.Upgrades.diamondShovel ); - ComputerCraft.Upgrades.diamondPickaxe = new TurtleTool( new ResourceLocation( "minecraft", "diamond_pickaxe" ), 5, "upgrade.minecraft:diamond_pickaxe.adjective", Items.diamond_pickaxe ); + ComputerCraft.Upgrades.diamondPickaxe = new TurtleTool( new ResourceLocation( "minecraft", "diamond_pickaxe" ), 5, "upgrade.minecraft:diamond_pickaxe.adjective", Items.DIAMOND_PICKAXE ); registerTurtleUpgradeInternal( ComputerCraft.Upgrades.diamondPickaxe ); - ComputerCraft.Upgrades.diamondAxe = new TurtleAxe( new ResourceLocation( "minecraft", "diamond_axe" ), 6, "upgrade.minecraft:diamond_axe.adjective", Items.diamond_axe ); + ComputerCraft.Upgrades.diamondAxe = new TurtleAxe( new ResourceLocation( "minecraft", "diamond_axe" ), 6, "upgrade.minecraft:diamond_axe.adjective", Items.DIAMOND_AXE ); registerTurtleUpgradeInternal( ComputerCraft.Upgrades.diamondAxe ); - ComputerCraft.Upgrades.diamondHoe = new TurtleHoe( new ResourceLocation( "minecraft", "diamond_hoe" ), 7, "upgrade.minecraft:diamond_hoe.adjective", Items.diamond_hoe ); + ComputerCraft.Upgrades.diamondHoe = new TurtleHoe( new ResourceLocation( "minecraft", "diamond_hoe" ), 7, "upgrade.minecraft:diamond_hoe.adjective", Items.DIAMOND_HOE ); registerTurtleUpgradeInternal( ComputerCraft.Upgrades.diamondHoe ); ComputerCraft.Upgrades.advancedModem = new TurtleModem( true, new ResourceLocation( "computercraft", "advanced_modem" ), -1 ); @@ -427,7 +427,7 @@ private ForgeHandlers() @SubscribeEvent public void onEntityLivingDrops( LivingDropsEvent event ) { - dispatchEntityDrops( event.entity, event.drops ); + dispatchEntityDrops( event.getEntity(), event.getDrops() ); } } diff --git a/src/main/java/dan200/computercraft/shared/proxy/ComputerCraftProxyCommon.java b/src/main/java/dan200/computercraft/shared/proxy/ComputerCraftProxyCommon.java index 1292a8b66..67322c506 100644 --- a/src/main/java/dan200/computercraft/shared/proxy/ComputerCraftProxyCommon.java +++ b/src/main/java/dan200/computercraft/shared/proxy/ComputerCraftProxyCommon.java @@ -65,7 +65,8 @@ import net.minecraft.network.Packet; import net.minecraft.server.MinecraftServer; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; +import net.minecraft.util.SoundEvent; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.IThreadListener; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; @@ -127,18 +128,13 @@ public String getRecordInfo( ItemStack recordStack ) if( item instanceof ItemRecord ) { ItemRecord record = (ItemRecord)item; - if( (( ResourceLocation)Item.itemRegistry.getNameForObject( record )).getResourceDomain().equals( "minecraft" ) ) - { - return "C418 - " + record.recordName; - } - // TODO: determine descriptions for mod items (ie: Portal gun mod) - return record.recordName; + return record.getRecordNameLocal(); } return null; } @Override - public abstract void playRecord( String record, String recordInfo, World world, BlockPos pos ); + public abstract void playRecord( SoundEvent record, String recordInfo, World world, BlockPos pos ); @Override public abstract Object getDiskDriveGUI( InventoryPlayer inventory, TileDiskDrive drive ); @@ -163,7 +159,7 @@ public String getRecordInfo( ItemStack recordStack ) @Override public void handlePacket( final ComputerCraftPacket packet, final EntityPlayer player ) { - IThreadListener listener = MinecraftServer.getServer(); + IThreadListener listener = player.getServer(); if( listener != null ) { if( listener.isCallingFromMinecraftThread() ) @@ -217,10 +213,10 @@ private void processPacket( ComputerCraftPacket packet, EntityPlayer player ) if( tileEntity != null && tileEntity instanceof TileGeneric ) { TileGeneric generic = (TileGeneric)tileEntity; - Packet description = generic.getDescriptionPacket(); + Packet description = generic.getUpdatePacket(); if( description != null ) { - ((EntityPlayerMP)player).playerNetServerHandler.sendPacket( description ); + ((EntityPlayerMP)player).connection.sendPacket( description ); } } break; @@ -286,107 +282,107 @@ private void registerItems() ItemStack computer = ComputerItemFactory.create( -1, null, ComputerFamily.Normal ); GameRegistry.addRecipe( computer, "XXX", "XYX", "XZX", - 'X', Blocks.stone, - 'Y', Items.redstone, - 'Z', Blocks.glass_pane + 'X', Blocks.STONE, + 'Y', Items.REDSTONE, + 'Z', Blocks.GLASS_PANE ); // Advanced Computer ItemStack advancedComputer = ComputerItemFactory.create( -1, null, ComputerFamily.Advanced ); GameRegistry.addRecipe( advancedComputer, "XXX", "XYX", "XZX", - 'X', Items.gold_ingot, - 'Y', Items.redstone, - 'Z', Blocks.glass_pane + 'X', Items.GOLD_INGOT, + 'Y', Items.REDSTONE, + 'Z', Blocks.GLASS_PANE ); // Disk Drive ItemStack diskDrive = PeripheralItemFactory.create( PeripheralType.DiskDrive, null, 1 ); GameRegistry.addRecipe( diskDrive, "XXX", "XYX", "XYX", - 'X', Blocks.stone, - 'Y', Items.redstone + 'X', Blocks.STONE, + 'Y', Items.REDSTONE ); // Wireless Modem ItemStack wirelessModem = PeripheralItemFactory.create( PeripheralType.WirelessModem, null, 1 ); GameRegistry.addRecipe( wirelessModem, "XXX", "XYX", "XXX", - 'X', Blocks.stone, - 'Y', Items.ender_pearl + 'X', Blocks.STONE, + 'Y', Items.ENDER_PEARL ); // Monitor ItemStack monitor = PeripheralItemFactory.create( PeripheralType.Monitor, null, 1 ); GameRegistry.addRecipe( monitor, "XXX", "XYX", "XXX", - 'X', Blocks.stone, - 'Y', Blocks.glass_pane + 'X', Blocks.STONE, + 'Y', Blocks.GLASS_PANE ); // PrinterEmpty ItemStack printer = PeripheralItemFactory.create( PeripheralType.Printer, null, 1 ); GameRegistry.addRecipe( printer, "XXX", "XYX", "XZX", - 'X', Blocks.stone, - 'Y', Items.redstone, - 'Z', new ItemStack( Items.dye, 1, 0 ) // 0 = Black + 'X', Blocks.STONE, + 'Y', Items.REDSTONE, + 'Z', new ItemStack( Items.DYE, 1, 0 ) // 0 = Black ); // Advanced Monitor ItemStack advancedMonitors = PeripheralItemFactory.create( PeripheralType.AdvancedMonitor, null, 4 ); GameRegistry.addRecipe( advancedMonitors, "XXX", "XYX", "XXX", - 'X', Items.gold_ingot, - 'Y', Blocks.glass_pane + 'X', Items.GOLD_INGOT, + 'Y', Blocks.GLASS_PANE ); // Networking Cable ItemStack cable = PeripheralItemFactory.create( PeripheralType.Cable, null, 6 ); GameRegistry.addRecipe( cable, " X ", "XYX", " X ", - 'X', Blocks.stone, - 'Y', Items.redstone + 'X', Blocks.STONE, + 'Y', Items.REDSTONE ); // Wired Modem ItemStack wiredModem = PeripheralItemFactory.create( PeripheralType.WiredModem, null, 1 ); GameRegistry.addRecipe( wiredModem, "XXX", "XYX", "XXX", - 'X', Blocks.stone, - 'Y', Items.redstone + 'X', Blocks.STONE, + 'Y', Items.REDSTONE ); // Computer ItemStack commandComputer = ComputerItemFactory.create( -1, null, ComputerFamily.Command ); GameRegistry.addRecipe( commandComputer, "XXX", "XYX", "XZX", - 'X', Blocks.stone, - 'Y', Blocks.command_block, - 'Z', Blocks.glass_pane + 'X', Blocks.STONE, + 'Y', Blocks.COMMAND_BLOCK, + 'Z', Blocks.GLASS_PANE ); // Advanced Modem ItemStack advancedModem = PeripheralItemFactory.create( PeripheralType.AdvancedModem, null, 1 ); GameRegistry.addRecipe( advancedModem, "XXX", "XYX", "XXX", - 'X', Items.gold_ingot, - 'Y', Items.ender_eye + 'X', Items.GOLD_INGOT, + 'Y', Items.ENDER_EYE ); // Disk GameRegistry.addRecipe( new DiskRecipe() ); // Impostor Disk recipes (to fool NEI) - ItemStack paper = new ItemStack( Items.paper, 1 ); - ItemStack redstone = new ItemStack( Items.redstone, 1 ); + ItemStack paper = new ItemStack( Items.PAPER, 1 ); + ItemStack redstone = new ItemStack( Items.REDSTONE, 1 ); ItemStack basicDisk = ItemDiskLegacy.createFromIDAndColour( -1, null, Colour.Blue.getHex() ); GameRegistry.addRecipe( new ImpostorShapelessRecipe( basicDisk, new Object[] { redstone, paper } ) ); for( int colour=0; colour<16; ++colour ) { ItemStack disk = ItemDiskLegacy.createFromIDAndColour( -1, null, Colour.values()[ colour ].getHex() ); - ItemStack dye = new ItemStack( Items.dye, 1, colour ); + ItemStack dye = new ItemStack( Items.DYE, 1, colour ); for( int otherColour=0; otherColour<16; ++otherColour ) { if( colour != otherColour ) @@ -410,28 +406,28 @@ private void registerItems() ItemStack bookPrintout = ItemPrintout.createBookFromTitleAndText( null, null, null ); // Impostor Printout recipes (to fool NEI) - ItemStack string = new ItemStack( Items.string, 1, 0 ); + ItemStack string = new ItemStack( Items.STRING, 1, 0 ); GameRegistry.addRecipe( new ImpostorShapelessRecipe( multiplePrintout, new Object[] { singlePrintout, singlePrintout, string } ) ); - ItemStack leather = new ItemStack( Items.leather, 1, 0 ); + ItemStack leather = new ItemStack( Items.LEATHER, 1, 0 ); GameRegistry.addRecipe( new ImpostorShapelessRecipe( bookPrintout, new Object[] { leather, singlePrintout, string } ) ); // Pocket Computer ItemStack pocketComputer = PocketComputerItemFactory.create( -1, null, ComputerFamily.Normal, false ); GameRegistry.addRecipe( pocketComputer, "XXX", "XYX", "XZX", - 'X', Blocks.stone, - 'Y', Items.golden_apple, - 'Z', Blocks.glass_pane + 'X', Blocks.STONE, + 'Y', Items.GOLDEN_APPLE, + 'Z', Blocks.GLASS_PANE ); // Advanced Pocket Computer ItemStack advancedPocketComputer = PocketComputerItemFactory.create( -1, null, ComputerFamily.Advanced, false ); GameRegistry.addRecipe( advancedPocketComputer, "XXX", "XYX", "XZX", - 'X', Items.gold_ingot, - 'Y', Items.golden_apple, - 'Z', Blocks.glass_pane + 'X', Items.GOLD_INGOT, + 'Y', Items.GOLDEN_APPLE, + 'Z', Blocks.GLASS_PANE ); // Wireless Pocket Computer @@ -449,16 +445,16 @@ private void registerItems() // Dan NBTTagCompound tag = new NBTTagCompound(); tag.setString( "SkullOwner", "dan200" ); - ItemStack danHead = new ItemStack( Items.skull, 1, 3 ); + ItemStack danHead = new ItemStack( Items.SKULL, 1, 3 ); danHead.setTagCompound( tag ); - GameRegistry.addShapelessRecipe( danHead, computer, new ItemStack( Items.skull, 1, 1 ) ); + GameRegistry.addShapelessRecipe( danHead, computer, new ItemStack( Items.SKULL, 1, 1 ) ); // Cloudy tag = new NBTTagCompound(); tag.setString( "SkullOwner", "Cloudhunter" ); - ItemStack cloudyHead = new ItemStack( Items.skull, 1, 3 ); + ItemStack cloudyHead = new ItemStack( Items.SKULL, 1, 3 ); cloudyHead.setTagCompound( tag ); - GameRegistry.addShapelessRecipe( cloudyHead, monitor, new ItemStack( Items.skull, 1, 1 ) ); + GameRegistry.addShapelessRecipe( cloudyHead, monitor, new ItemStack( Items.SKULL, 1, 1 ) ); } private void registerTileEntities() diff --git a/src/main/java/dan200/computercraft/shared/proxy/IComputerCraftProxy.java b/src/main/java/dan200/computercraft/shared/proxy/IComputerCraftProxy.java index 52d935c22..a2ac6aa4b 100644 --- a/src/main/java/dan200/computercraft/shared/proxy/IComputerCraftProxy.java +++ b/src/main/java/dan200/computercraft/shared/proxy/IComputerCraftProxy.java @@ -14,7 +14,8 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; +import net.minecraft.util.SoundEvent; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import java.io.File; @@ -31,7 +32,7 @@ public interface IComputerCraftProxy public Object getFixedWidthFontRenderer(); public String getRecordInfo( ItemStack item ); - public void playRecord( String record, String recordInfo, World world, BlockPos pos ); + public void playRecord( SoundEvent record, String recordInfo, World world, BlockPos pos ); public Object getDiskDriveGUI( InventoryPlayer inventory, TileDiskDrive drive ); public Object getComputerGUI( TileComputer computer ); diff --git a/src/main/java/dan200/computercraft/shared/turtle/apis/TurtleAPI.java b/src/main/java/dan200/computercraft/shared/turtle/apis/TurtleAPI.java index 84f9985ca..910937adf 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/apis/TurtleAPI.java +++ b/src/main/java/dan200/computercraft/shared/turtle/apis/TurtleAPI.java @@ -478,7 +478,7 @@ public Object[] callMethod( ILuaContext context, int method, Object[] args ) thr if( stack != null && stack.stackSize > 0 ) { Item item = stack.getItem(); - String name = ((ResourceLocation)Item.itemRegistry.getNameForObject( item )).toString(); + String name = ((ResourceLocation)Item.REGISTRY.getNameForObject( item )).toString(); int damage = stack.getItemDamage(); int count = stack.stackSize; diff --git a/src/main/java/dan200/computercraft/shared/turtle/blocks/BlockTurtle.java b/src/main/java/dan200/computercraft/shared/turtle/blocks/BlockTurtle.java index 009b61a59..78ed5c72d 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/blocks/BlockTurtle.java +++ b/src/main/java/dan200/computercraft/shared/turtle/blocks/BlockTurtle.java @@ -16,12 +16,13 @@ import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.properties.PropertyEnum; -import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; @@ -33,7 +34,7 @@ public class BlockTurtle extends BlockComputerBase public static class Properties { public static final PropertyDirection FACING = PropertyDirection.create( "facing", EnumFacing.Plane.HORIZONTAL ); - public static final PropertyEnum DYE = PropertyEnum.create( "dye", BlockTurtleDyeVariant.class ); + public static final PropertyEnum DYE = PropertyEnum.create( "dye", BlockTurtleDyeVariant.class ); } public static BlockTurtle createTurtleBlock() @@ -45,7 +46,7 @@ public static BlockTurtle createTurtleBlock() public BlockTurtle() { - super( Material.iron ); + super( Material.IRON ); setHardness( 2.5f ); setUnlocalizedName( "computercraft:turtle" ); setCreativeTab( ComputerCraft.mainCreativeTab ); @@ -56,27 +57,27 @@ public BlockTurtle() } @Override - public int getRenderType() + public EnumBlockRenderType getRenderType( IBlockState state ) { - return -1; + return EnumBlockRenderType.INVISIBLE; } @Override - public boolean isOpaqueCube() + public boolean isOpaqueCube( IBlockState state ) { return false; } @Override - public boolean isFullCube() + public boolean isFullCube( IBlockState state ) { return false; } @Override - protected BlockState createBlockState() + protected BlockStateContainer createBlockState() { - return new BlockState(this, new IProperty[] { + return new BlockStateContainer(this, new IProperty[] { Properties.FACING, Properties.DYE }); diff --git a/src/main/java/dan200/computercraft/shared/turtle/blocks/ITurtleTile.java b/src/main/java/dan200/computercraft/shared/turtle/blocks/ITurtleTile.java index 1956861d2..2f7907d48 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/blocks/ITurtleTile.java +++ b/src/main/java/dan200/computercraft/shared/turtle/blocks/ITurtleTile.java @@ -13,7 +13,7 @@ import dan200.computercraft.shared.computer.blocks.IComputerTile; import dan200.computercraft.shared.util.Colour; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.Vec3; +import net.minecraft.util.math.Vec3d; public interface ITurtleTile extends IComputerTile, IDirectionalTile { @@ -22,7 +22,7 @@ public interface ITurtleTile extends IComputerTile, IDirectionalTile public ITurtleUpgrade getUpgrade( TurtleSide side ); public ITurtleAccess getAccess(); - public Vec3 getRenderOffset( float f ); + public Vec3d getRenderOffset( float f ); public float getRenderYaw( float f ); public float getToolRenderAngle( TurtleSide side, float f ); } diff --git a/src/main/java/dan200/computercraft/shared/turtle/blocks/TileTurtle.java b/src/main/java/dan200/computercraft/shared/turtle/blocks/TileTurtle.java index 06f4d2861..72eaf5277 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/blocks/TileTurtle.java +++ b/src/main/java/dan200/computercraft/shared/turtle/blocks/TileTurtle.java @@ -30,6 +30,8 @@ import net.minecraft.nbt.NBTTagList; import net.minecraft.util.ITickable; import net.minecraft.util.*; +import net.minecraft.util.math.*; +import net.minecraft.util.text.*; import net.minecraftforge.common.util.Constants; import java.util.List; @@ -135,7 +137,7 @@ protected void unload() } @Override - public void getDroppedItems( List drops, int fortune, boolean creative, boolean silkTouch ) + public void getDroppedItems( List drops, boolean creative ) { IComputer computer = getComputer(); if( !creative || (computer != null && computer.getLabel() != null) ) @@ -157,10 +159,10 @@ public boolean onActivate( EntityPlayer player, EnumFacing side, float hitX, flo requestTileEntityUpdate(); // Apply dye - ItemStack currentItem = player.getCurrentEquippedItem(); + ItemStack currentItem = player.getHeldItem( EnumHand.MAIN_HAND ); if( currentItem != null ) { - if( currentItem.getItem() == Items.dye ) + if( currentItem.getItem() == Items.DYE ) { // Dye to change turtle colour if( !worldObj.isRemote ) @@ -177,7 +179,7 @@ public boolean onActivate( EntityPlayer player, EnumFacing side, float hitX, flo } return true; } - else if( currentItem.getItem() == Items.water_bucket && m_brain.getDyeColour() != -1 ) + else if( currentItem.getItem() == Items.WATER_BUCKET && m_brain.getDyeColour() != -1 ) { // Water to remove turtle colour if( !worldObj.isRemote ) @@ -187,7 +189,7 @@ else if( currentItem.getItem() == Items.water_bucket && m_brain.getDyeColour() ! m_brain.setDyeColour( -1 ); if( !player.capabilities.isCreativeMode ) { - currentItem.setItem( Items.bucket ); + currentItem.setItem( Items.BUCKET ); } } } @@ -237,7 +239,7 @@ public boolean isImmuneToExplosion( Entity exploder ) @Override public AxisAlignedBB getBounds() { - Vec3 offset = getRenderOffset( 1.0f ); + Vec3d offset = getRenderOffset( 1.0f ); return new AxisAlignedBB( offset.xCoord + 0.125, offset.yCoord + 0.125, offset.zCoord + 0.125, offset.xCoord + 0.875, offset.yCoord + 0.875, offset.zCoord + 0.875 @@ -299,9 +301,9 @@ public void readFromNBT( NBTTagCompound nbttagcompound ) } @Override - public void writeToNBT( NBTTagCompound nbttagcompound ) + public NBTTagCompound writeToNBT( NBTTagCompound nbttagcompound ) { - super.writeToNBT( nbttagcompound ); + nbttagcompound = super.writeToNBT( nbttagcompound ); // Write inventory NBTTagList nbttaglist = new NBTTagList(); @@ -318,7 +320,9 @@ public void writeToNBT( NBTTagCompound nbttagcompound ) nbttagcompound.setTag( "Items", nbttaglist ); // Write brain - m_brain.writeToNBT( nbttagcompound ); + nbttagcompound = m_brain.writeToNBT( nbttagcompound ); + + return nbttagcompound; } @Override @@ -379,7 +383,7 @@ public ITurtleAccess getAccess() } @Override - public Vec3 getRenderOffset( float f ) + public Vec3d getRenderOffset( float f ) { return m_brain.getRenderOffset( f ); } @@ -524,15 +528,15 @@ public boolean hasCustomName() } @Override - public IChatComponent getDisplayName() + public ITextComponent getDisplayName() { if( hasCustomName() ) { - return new ChatComponentText( getName() ); + return new TextComponentString( getName() ); } else { - return new ChatComponentTranslation( getName() ); + return new TextComponentTranslation( getName() ); } } diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleBrain.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleBrain.java index 2a61f145d..3ce166657 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleBrain.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleBrain.java @@ -27,6 +27,8 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.*; +import net.minecraft.util.math.*; +import net.minecraft.util.text.*; import net.minecraft.world.World; import net.minecraftforge.common.util.Constants; @@ -297,7 +299,7 @@ public void readFromNBT( NBTTagCompound nbttagcompound ) } } - public void writeToNBT( NBTTagCompound nbttagcompound ) + public NBTTagCompound writeToNBT( NBTTagCompound nbttagcompound ) { // Write state nbttagcompound.setInteger( "dir", m_direction.getIndex() ); @@ -338,6 +340,8 @@ public void writeToNBT( NBTTagCompound nbttagcompound ) { nbttagcompound.setTag( "rightUpgradeNBT", (NBTTagCompound) getUpgradeNBTData( TurtleSide.Right ).copy() ); } + + return nbttagcompound; } private String getUpgradeID( ITurtleUpgrade upgrade ) @@ -535,11 +539,11 @@ public boolean teleportTo( World world, BlockPos pos ) } @Override - public Vec3 getVisualPosition( float f ) + public Vec3d getVisualPosition( float f ) { - Vec3 offset = getRenderOffset( f ); + Vec3d offset = getRenderOffset( f ); BlockPos pos = m_owner.getPos(); - return new Vec3( + return new Vec3d( pos.getX() + 0.5 + offset.xCoord, pos.getY() + 0.5 + offset.yCoord, pos.getZ() + 0.5 + offset.zCoord @@ -856,7 +860,7 @@ public boolean saveBlockChange( BlockPos coordinates, IBlockState previousState return false; } - public Vec3 getRenderOffset( float f ) + public Vec3d getRenderOffset( float f ) { switch( m_animation ) { @@ -893,7 +897,7 @@ public Vec3 getRenderOffset( float f ) } double distance = -1.0 + (double)getAnimationFraction( f ); - return new Vec3( + return new Vec3d( distance * (double)dir.getFrontOffsetX(), distance * (double)dir.getFrontOffsetY(), distance * (double)dir.getFrontOffsetZ() @@ -901,7 +905,7 @@ public Vec3 getRenderOffset( float f ) } default: { - return new Vec3( 0.0, 0.0, 0.0 ); + return new Vec3d( 0.0, 0.0, 0.0 ); } } } @@ -1140,7 +1144,7 @@ private void updateAnimation() Holiday currentHoliday = HolidayUtil.getCurrentHoliday(); if( currentHoliday == Holiday.Valentines ) { - Vec3 position = getVisualPosition( 1.0f ); + Vec3d position = getVisualPosition( 1.0f ); if( position != null ) { double x = position.xCoord + world.rand.nextGaussian() * 0.1; diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCompareCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCompareCommand.java index 0c00a6a64..a68b66600 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCompareCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCompareCommand.java @@ -14,7 +14,7 @@ import net.minecraft.block.state.IBlockState; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.ReflectionHelper; @@ -50,11 +50,11 @@ public TurtleCommandResult execute( ITurtleAccess turtle ) { if( !world.isAirBlock( newPosition ) ) { - Block lookAtBlock = world.getBlockState( newPosition ).getBlock(); - if( lookAtBlock != null && !lookAtBlock.isAir( world, newPosition ) ) + IBlockState lookAtState = world.getBlockState( newPosition ); + Block lookAtBlock = lookAtState.getBlock(); + if( !lookAtBlock.isAir( lookAtState, world, newPosition ) ) { // Try createStackedBlock first - IBlockState lookAtState = world.getBlockState( newPosition ); if( !lookAtBlock.hasTileEntity( lookAtState ) ) { try diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCraftCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCraftCommand.java index aa3cd8c52..8c5928f24 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCraftCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleCraftCommand.java @@ -14,7 +14,7 @@ import dan200.computercraft.shared.util.InventoryUtil; import dan200.computercraft.shared.util.WorldUtil; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import java.util.ArrayList; diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleDetectCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleDetectCommand.java index 2ac7d260d..e94028988 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleDetectCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleDetectCommand.java @@ -10,7 +10,7 @@ import dan200.computercraft.api.turtle.ITurtleCommand; import dan200.computercraft.api.turtle.TurtleCommandResult; import dan200.computercraft.shared.util.WorldUtil; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleDropCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleDropCommand.java index e240baa6c..796413a93 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleDropCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleDropCommand.java @@ -12,9 +12,12 @@ import dan200.computercraft.api.turtle.TurtleCommandResult; import dan200.computercraft.shared.util.InventoryUtil; import dan200.computercraft.shared.util.WorldUtil; +import net.minecraft.init.SoundEvents; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.SoundEvent; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; @@ -81,7 +84,7 @@ public TurtleCommandResult execute( ITurtleAccess turtle ) { // Drop the item into the world WorldUtil.dropItemStack( stack, world, oldPosition, direction ); - world.playSoundEffect( newPosition.getX() + 0.5, newPosition.getY() + 0.5, newPosition.getZ() + 0.5, "random.pop", 0.2f, ((world.rand.nextFloat() - world.rand.nextFloat()) * 0.7f + 1.0f) * 2.0f ); + world.playBroadcastSound( 1000, newPosition, 0 ); turtle.playAnimation( TurtleAnimation.Wait ); return TurtleCommandResult.success(); } diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleEquipCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleEquipCommand.java index f479ea7ea..d539ed347 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleEquipCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleEquipCommand.java @@ -13,7 +13,7 @@ import dan200.computercraft.shared.util.WorldUtil; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; public class TurtleEquipCommand implements ITurtleCommand { diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleInspectCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleInspectCommand.java index dc129509d..0562f91f1 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleInspectCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleInspectCommand.java @@ -14,7 +14,7 @@ import net.minecraft.block.Block; import net.minecraft.block.properties.IProperty; import net.minecraft.block.state.IBlockState; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; @@ -49,7 +49,7 @@ public TurtleCommandResult execute( ITurtleAccess turtle ) { IBlockState state = world.getBlockState( newPosition ); Block block = state.getBlock(); - String name = ((ResourceLocation)Block.blockRegistry.getNameForObject( block )).toString(); + String name = ((ResourceLocation)Block.REGISTRY.getNameForObject( block )).toString(); int metadata = block.getMetaFromState( state ); Map table = new HashMap(); diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleMoveCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleMoveCommand.java index b4e1e8a0c..6d790fc49 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleMoveCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleMoveCommand.java @@ -14,8 +14,8 @@ import dan200.computercraft.shared.util.WorldUtil; import net.minecraft.block.Block; import net.minecraft.entity.Entity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; @@ -88,7 +88,7 @@ public TurtleCommandResult execute( ITurtleAccess turtle ) (double) direction.getFrontOffsetY(), (double) direction.getFrontOffsetZ() ); - if( !oldWorld.func_147461_a( pushedBB ).isEmpty() ) // getCollidingBlockBoundingBoxes + if( !oldWorld.getCollisionBoxes( pushedBB ).isEmpty() ) { return TurtleCommandResult.failure( "Movement obstructed" ); } diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlaceCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlaceCommand.java index e87a8bc98..fc8005e4a 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlaceCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlaceCommand.java @@ -22,10 +22,13 @@ import net.minecraft.item.*; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntitySign; -import net.minecraft.util.BlockPos; -import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.TextComponentString; import net.minecraft.util.EnumFacing; -import net.minecraft.util.Vec3; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; import net.minecraft.world.WorldServer; import org.apache.commons.lang3.tuple.Pair; @@ -200,10 +203,10 @@ private static ItemStack deployOnEntity( ItemStack stack, final ITurtleAccess tu // See if there is an entity present final World world = turtle.getWorld(); final BlockPos position = turtle.getPosition(); - Vec3 turtlePos = new Vec3( turtlePlayer.posX, turtlePlayer.posY, turtlePlayer.posZ ); - Vec3 rayDir = turtlePlayer.getLook( 1.0f ); - Vec3 rayStart = turtlePos; - Pair hit = WorldUtil.rayTraceEntities( world, rayStart, rayDir, 1.5 ); + Vec3d turtlePos = new Vec3d( turtlePlayer.posX, turtlePlayer.posY, turtlePlayer.posZ ); + Vec3d rayDir = turtlePlayer.getLook( 1.0f ); + Vec3d rayStart = turtlePos; + Pair hit = WorldUtil.rayTraceEntities( world, rayStart, rayDir, 1.5 ); if( hit == null ) { return stack; @@ -216,7 +219,7 @@ private static ItemStack deployOnEntity( ItemStack stack, final ITurtleAccess tu // Start claiming entity drops Entity hitEntity = hit.getKey(); - Vec3 hitPos = hit.getValue(); + Vec3d hitPos = hit.getValue(); ComputerCraft.setEntityDropConsumer( hitEntity, new IEntityDropConsumer() { @Override @@ -232,21 +235,18 @@ public void consumeDrop( Entity entity, ItemStack drop ) // Place on the entity boolean placed = false; - if( hitEntity.interactFirst( turtlePlayer ) ) + if( hitEntity.applyPlayerInteraction( turtlePlayer, hitPos, stackCopy, EnumHand.MAIN_HAND ) == EnumActionResult.SUCCESS ) { placed = true; + turtlePlayer.loadInventory( stackCopy ); } else if( hitEntity instanceof EntityLivingBase ) { - placed = item.itemInteractionForEntity( stackCopy, turtlePlayer, (EntityLivingBase)hitEntity ); + placed = item.itemInteractionForEntity( stackCopy, turtlePlayer, (EntityLivingBase)hitEntity, EnumHand.MAIN_HAND ); if( placed ) { turtlePlayer.loadInventory( stackCopy ); } - else if( hitEntity.interactAt( turtlePlayer, hitPos ) ) // interact - { - placed = true; - } } // Stop claiming drops @@ -346,19 +346,23 @@ private static ItemStack deployOnBlock( ItemStack stack, ITurtleAccess turtle, T // Do the deploying (put everything in the players inventory) boolean placed = false; - if( item.onItemUseFirst( stackCopy, turtlePlayer, turtle.getWorld(), position, side, hitX, hitY, hitZ ) || - item.onItemUse( stackCopy, turtlePlayer, turtle.getWorld(), position, side, hitX, hitY, hitZ ) ) + if( item.onItemUseFirst( stackCopy, turtlePlayer, turtle.getWorld(), position, side, hitX, hitY, hitZ, EnumHand.MAIN_HAND ) == EnumActionResult.SUCCESS ) + { + placed = true; + turtlePlayer.loadInventory( stackCopy ); + } + else if( item.onItemUse( stackCopy, turtlePlayer, turtle.getWorld(), position, EnumHand.MAIN_HAND, side, hitX, hitY, hitZ ) == EnumActionResult.SUCCESS ) { placed = true; turtlePlayer.loadInventory( stackCopy ); } else if( item instanceof ItemBucket || item instanceof ItemBoat || item instanceof ItemLilyPad || item instanceof ItemGlassBottle ) { - ItemStack result = item.onItemRightClick( stackCopy, turtle.getWorld(), turtlePlayer ); - if( !ItemStack.areItemStacksEqual( stack, result ) ) + ActionResult result = item.onItemRightClick( stackCopy, turtle.getWorld(), turtlePlayer, EnumHand.MAIN_HAND ); + if( result.getType() == EnumActionResult.SUCCESS && !ItemStack.areItemStacksEqual( stack, result.getResult() ) ) { placed = true; - turtlePlayer.loadInventory( result ); + turtlePlayer.loadInventory( result.getResult() ); } } @@ -386,20 +390,20 @@ else if( item instanceof ItemBucket || item instanceof ItemBoat || item instance { if( split[ i - firstLine ].length() > 15 ) { - signTile.signText[ i ] = new ChatComponentText( split[ i - firstLine ].substring( 0, 15 ) ); + signTile.signText[ i ] = new TextComponentString( split[ i - firstLine ].substring( 0, 15 ) ); } else { - signTile.signText[ i ] = new ChatComponentText( split[ i - firstLine ] ); + signTile.signText[ i ] = new TextComponentString( split[ i - firstLine ] ); } } else { - signTile.signText[i] = new ChatComponentText( "" ); + signTile.signText[i] = new TextComponentString( "" ); } } signTile.markDirty(); - world.markBlockForUpdate( signTile.getPos() ); + world.markBlockRangeForRenderUpdate( signTile.getPos(), signTile.getPos() ); } } } diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlayer.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlayer.java index a41534f61..4911c5388 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlayer.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlayer.java @@ -13,7 +13,7 @@ import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntitySign; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.WorldServer; import net.minecraftforge.common.util.FakePlayer; @@ -78,7 +78,7 @@ public float getDefaultEyeHeight() } @Override - public void mountEntity( Entity entity ) + public void mountEntityAndWakeUp() { } diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleSuckCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleSuckCommand.java index 0b67381a5..e2d14061f 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtleSuckCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtleSuckCommand.java @@ -16,8 +16,8 @@ import net.minecraft.entity.item.EntityItem; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; @@ -145,7 +145,7 @@ else if( leaveStack == null ) if( storedItems ) { // Play fx - world.playSoundEffect( oldPosition.getX() + 0.5, oldPosition.getY() + 0.5, oldPosition.getZ() + 0.5, "random.pop", 0.2f, ((world.rand.nextFloat() - world.rand.nextFloat()) * 0.7f + 1.0f) * 2.0f ); + world.playBroadcastSound( 1000, oldPosition, 0 ); turtle.playAnimation( TurtleAnimation.Wait ); return TurtleCommandResult.success(); } diff --git a/src/main/java/dan200/computercraft/shared/turtle/entity/TurtleVisionCamera.java b/src/main/java/dan200/computercraft/shared/turtle/entity/TurtleVisionCamera.java index 228f155c9..47c8a3944 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/entity/TurtleVisionCamera.java +++ b/src/main/java/dan200/computercraft/shared/turtle/entity/TurtleVisionCamera.java @@ -9,20 +9,25 @@ import dan200.computercraft.api.turtle.ITurtleAccess; import dan200.computercraft.shared.turtle.core.TurtleBrain; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemStack; -import net.minecraft.util.Vec3; +import net.minecraft.util.EnumHand; +import net.minecraft.util.EnumHandSide; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; +import java.util.ArrayList; + public class TurtleVisionCamera extends EntityLivingBase { private ITurtleAccess m_turtle; - private ItemStack[] m_inventory; + private ArrayList m_armor; public TurtleVisionCamera( World world, ITurtleAccess turtle ) { super( world ); m_turtle = turtle; - m_inventory = new ItemStack[0]; + m_armor = new ArrayList(); applyPos(); } @@ -37,6 +42,12 @@ public float getEyeHeight() return 0.0f; } + @Override + public EnumHandSide getPrimaryHand() + { + return EnumHandSide.RIGHT; + } + @Override public void onUpdate() { @@ -46,7 +57,7 @@ public void onUpdate() private void applyPos() { - Vec3 prevPos = m_turtle.getVisualPosition( 0.0f ); + Vec3d prevPos = m_turtle.getVisualPosition( 0.0f ); this.lastTickPosX = this.prevPosX = prevPos.xCoord; this.lastTickPosY = this.prevPosY = prevPos.yCoord; this.lastTickPosZ = this.prevPosZ = prevPos.zCoord; @@ -54,7 +65,7 @@ private void applyPos() this.prevRotationYaw = m_turtle.getVisualYaw( 0.0f ); this.prevCameraPitch = 0.0f; - Vec3 pos = m_turtle.getVisualPosition( 1.0f ); + Vec3d pos = m_turtle.getVisualPosition( 1.0f ); this.posX = pos.xCoord; this.posY = pos.yCoord; this.posZ = pos.zCoord; @@ -76,31 +87,25 @@ else if( yawDifference < -180.0f ) // EntityLivingBase overrides: @Override - public ItemStack getHeldItem() + public ItemStack getHeldItem( EnumHand hand ) { return null; } @Override - public ItemStack getEquipmentInSlot( int slot ) + public void setItemStackToSlot(EntityEquipmentSlot slot, ItemStack stack) + { + } + + @Override + public ItemStack getItemStackFromSlot(EntityEquipmentSlot slot) { return null; } @Override - public ItemStack getCurrentArmor( int slotIn ) + public Iterable getArmorInventoryList() { - return null; - } - - @Override - public void setCurrentItemOrArmor( int slot, ItemStack stack ) - { - } - - @Override - public ItemStack[] getInventory() - { - return m_inventory; + return m_armor; } } diff --git a/src/main/java/dan200/computercraft/shared/turtle/inventory/ContainerTurtle.java b/src/main/java/dan200/computercraft/shared/turtle/inventory/ContainerTurtle.java index f78401b9c..b3899ac06 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/inventory/ContainerTurtle.java +++ b/src/main/java/dan200/computercraft/shared/turtle/inventory/ContainerTurtle.java @@ -11,7 +11,7 @@ import dan200.computercraft.shared.turtle.core.TurtleBrain; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; -import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.IContainerListener; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; @@ -76,16 +76,16 @@ public int getSelectedSlot() return m_selectedSlot; } - private void sendStateToPlayer( ICrafting icrafting ) + private void sendStateToPlayer( IContainerListener icrafting ) { int selectedSlot = m_turtle.getSelectedSlot(); icrafting.sendProgressBarUpdate( this, PROGRESS_ID_SELECTED_SLOT, selectedSlot ); } @Override - public void onCraftGuiOpened( ICrafting crafting ) + public void addListener( IContainerListener crafting ) { - super.onCraftGuiOpened( crafting ); + super.addListener( crafting ); sendStateToPlayer( crafting ); } @@ -95,9 +95,9 @@ public void detectAndSendChanges() super.detectAndSendChanges(); int selectedSlot = m_turtle.getSelectedSlot(); - for( int i=0; i doCrafting( World world, int maxCount ) results.add( result ); // Consume resources from the inventory - ItemStack[] remainingItems = CraftingManager.getInstance().func_180303_b( this, world ); // getRemainingItems + ItemStack[] remainingItems = CraftingManager.getInstance().getRemainingItems( this, world ); for( int n=0; n hit = WorldUtil.rayTraceEntities( world, rayStart, rayDir, 1.5 ); + Vec3d turtlePos = new Vec3d( turtlePlayer.posX, turtlePlayer.posY, turtlePlayer.posZ ); + Vec3d rayDir = turtlePlayer.getLook( 1.0f ); + Vec3d rayStart = turtlePos; + Pair hit = WorldUtil.rayTraceEntities( world, rayStart, rayDir, 1.5 ); if( hit != null ) { // Load up the turtle's inventory @@ -188,9 +191,9 @@ public void consumeDrop( Entity entity, ItemStack drop ) // Place on the entity boolean placed = false; - if( hitEntity.canAttackWithItem() && !hitEntity.hitByEntity( turtlePlayer ) ) + if( hitEntity.canBeAttackedWithItem() && !hitEntity.hitByEntity( turtlePlayer ) ) { - float damage = (float)turtlePlayer.getEntityAttribute( SharedMonsterAttributes.attackDamage ).getAttributeValue(); + float damage = (float)turtlePlayer.getEntityAttribute( SharedMonsterAttributes.ATTACK_DAMAGE ).getAttributeValue(); damage *= getDamageMultiplier(); if( damage > 0.0f ) { @@ -277,16 +280,13 @@ private TurtleCommandResult dig( ITurtleAccess turtle, EnumFacing direction ) } // Destroy the block - Block previousBlock = world.getBlockState( newPosition ).getBlock(); IBlockState previousState = world.getBlockState( newPosition ); - if( previousBlock != null ) - { - world.playSoundEffect( newPosition.getX() + 0.5, newPosition.getY() + 0.5, newPosition.getZ() + 0.5, previousBlock.stepSound.getBreakSound(), (previousBlock.stepSound.getVolume() + 1.0F) / 2.0F, previousBlock.stepSound.getFrequency() * 0.8F); - } + Block previousBlock = previousState.getBlock(); + world.playSound( null, newPosition, previousBlock.getSoundType().getBreakSound(), SoundCategory.BLOCKS, (previousBlock.getSoundType().getVolume() + 1.0F) / 2.0F, previousBlock.getSoundType().getPitch() * 0.8F ); world.setBlockToAir( newPosition ); // Remember the previous block - if( turtle instanceof TurtleBrain && previousBlock != null ) + if( turtle instanceof TurtleBrain ) { TurtleBrain brain = (TurtleBrain)turtle; brain.saveBlockChange( newPosition, previousState ); diff --git a/src/main/java/dan200/computercraft/shared/util/DirectionUtil.java b/src/main/java/dan200/computercraft/shared/util/DirectionUtil.java index 7d439aeef..318acba53 100644 --- a/src/main/java/dan200/computercraft/shared/util/DirectionUtil.java +++ b/src/main/java/dan200/computercraft/shared/util/DirectionUtil.java @@ -9,7 +9,7 @@ import dan200.computercraft.shared.common.IDirectionalTile; import net.minecraft.entity.EntityLivingBase; import net.minecraft.util.EnumFacing; -import net.minecraft.util.MathHelper; +import net.minecraft.util.math.MathHelper; public class DirectionUtil { diff --git a/src/main/java/dan200/computercraft/shared/util/InventoryUtil.java b/src/main/java/dan200/computercraft/shared/util/InventoryUtil.java index 77d231365..be4614cb3 100644 --- a/src/main/java/dan200/computercraft/shared/util/InventoryUtil.java +++ b/src/main/java/dan200/computercraft/shared/util/InventoryUtil.java @@ -14,9 +14,9 @@ import net.minecraft.inventory.InventoryLargeChest; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; -import net.minecraft.util.Vec3; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.ILockableContainer; import net.minecraft.world.World; import org.apache.commons.lang3.tuple.Pair; @@ -80,7 +80,7 @@ public static IInventory getInventory( World world, BlockPos pos, EnumFacing sid { // Special case code for double chests Block block = world.getBlockState( pos ).getBlock(); - if( block == Blocks.chest || block == Blocks.trapped_chest ) + if( block == Blocks.CHEST || block == Blocks.TRAPPED_CHEST ) { // Check if it's a double chest, and return a combined inventory if so if( world.getBlockState( pos.west() ).getBlock() == block ) @@ -107,16 +107,16 @@ public static IInventory getInventory( World world, BlockPos pos, EnumFacing sid } // Look for entity with inventory - Vec3 vecStart = new Vec3( + Vec3d vecStart = new Vec3d( pos.getX() + 0.5 + 0.6 * side.getFrontOffsetX(), pos.getY() + 0.5 + 0.6 * side.getFrontOffsetY(), pos.getZ() + 0.5 + 0.6 * side.getFrontOffsetZ() ); EnumFacing dir = side.getOpposite(); - Vec3 vecDir = new Vec3( + Vec3d vecDir = new Vec3d( dir.getFrontOffsetX(), dir.getFrontOffsetY(), dir.getFrontOffsetZ() ); - Pair hit = WorldUtil.rayTraceEntities( world, vecStart, vecDir, 1.1 ); + Pair hit = WorldUtil.rayTraceEntities( world, vecStart, vecDir, 1.1 ); if( hit != null ) { Entity entity = hit.getKey(); diff --git a/src/main/java/dan200/computercraft/shared/util/PeripheralUtil.java b/src/main/java/dan200/computercraft/shared/util/PeripheralUtil.java index 81d251bfc..ae970a87c 100644 --- a/src/main/java/dan200/computercraft/shared/util/PeripheralUtil.java +++ b/src/main/java/dan200/computercraft/shared/util/PeripheralUtil.java @@ -2,7 +2,7 @@ import dan200.computercraft.ComputerCraft; import dan200.computercraft.api.peripheral.IPeripheral; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; diff --git a/src/main/java/dan200/computercraft/shared/util/RedstoneUtil.java b/src/main/java/dan200/computercraft/shared/util/RedstoneUtil.java index a89e82cb5..1b09d4dd2 100644 --- a/src/main/java/dan200/computercraft/shared/util/RedstoneUtil.java +++ b/src/main/java/dan200/computercraft/shared/util/RedstoneUtil.java @@ -9,8 +9,9 @@ import dan200.computercraft.ComputerCraft; import net.minecraft.block.Block; import net.minecraft.block.BlockRedstoneWire; +import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; @@ -30,24 +31,25 @@ public static int getRedstoneOutput( World world, BlockPos pos, EnumFacing side { int power = 0; Block block = getBlock( world, pos ); - if( block != null && block != Blocks.air ) + if( block != null && block != Blocks.AIR ) { - if( block == Blocks.redstone_wire ) + IBlockState state = world.getBlockState( pos ); + if( block == Blocks.REDSTONE_WIRE ) { if( side != EnumFacing.UP ) { - power = ((Integer)world.getBlockState( pos ).getValue( BlockRedstoneWire.POWER )).intValue(); + power = ((Integer)state.getValue( BlockRedstoneWire.POWER )).intValue(); } else { power = 0; } } - else if( block.canProvidePower() ) + else if( block.canProvidePower( state ) ) { - power = block.getWeakPower( world, pos, world.getBlockState( pos ), side.getOpposite() ); + power = block.getWeakPower( state, world, pos, side.getOpposite() ); } - if( block.isNormalCube( world, pos ) ) + if( block.isNormalCube( state, world, pos ) ) { for( EnumFacing testSide : EnumFacing.VALUES ) { @@ -55,9 +57,9 @@ else if( block.canProvidePower() ) { BlockPos testPos = pos.offset( testSide ); Block neighbour = getBlock( world, testPos ); - if( neighbour != null && neighbour.canProvidePower() ) + if( neighbour != null && neighbour.canProvidePower( state ) ) { - power = Math.max( power, neighbour.getStrongPower( world, testPos, world.getBlockState( testPos ), testSide.getOpposite() ) ); + power = Math.max( power, neighbour.getStrongPower( state, world, testPos, testSide.getOpposite() ) ); } } } @@ -82,10 +84,10 @@ public static void propogateRedstoneOutput( World world, BlockPos pos, EnumFacin Block block = getBlock( world, pos ); BlockPos neighbourPos = pos.offset( side ); Block neighbour = getBlock( world, neighbourPos ); - if( neighbour != null && neighbour != Blocks.air ) + if( neighbour != null && neighbour != Blocks.AIR ) { world.notifyBlockOfStateChange( neighbourPos, block ); - if( neighbour.isNormalCube( world, neighbourPos ) ) + if( neighbour.isNormalCube( world.getBlockState( neighbourPos ), world, neighbourPos ) ) { world.notifyNeighborsOfStateExcept( neighbourPos, neighbour, side.getOpposite() ); } diff --git a/src/main/java/dan200/computercraft/shared/util/WorldUtil.java b/src/main/java/dan200/computercraft/shared/util/WorldUtil.java index 2f9a4bd92..56df94c61 100644 --- a/src/main/java/dan200/computercraft/shared/util/WorldUtil.java +++ b/src/main/java/dan200/computercraft/shared/util/WorldUtil.java @@ -7,10 +7,12 @@ package dan200.computercraft.shared.util; import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.item.ItemStack; import net.minecraft.util.*; +import net.minecraft.util.math.*; import net.minecraft.world.World; import org.apache.commons.lang3.tuple.Pair; @@ -27,10 +29,11 @@ public static boolean isLiquidBlock( World world, BlockPos pos ) { if( isBlockInWorld( world, pos ) ) { - Block block = world.getBlockState( pos ).getBlock(); + IBlockState state = world.getBlockState( pos ); + Block block = state.getBlock(); if( block != null ) { - return block.getMaterial().isLiquid(); + return block.getMaterial( state ).isLiquid(); } } return false; @@ -41,13 +44,13 @@ public static BlockPos moveCoords( BlockPos pos, EnumFacing dir ) return pos.offset( dir ); } - public static Pair rayTraceEntities( World world, Vec3 vecStart, Vec3 vecDir, double distance ) + public static Pair rayTraceEntities( World world, Vec3d vecStart, Vec3d vecDir, double distance ) { - Vec3 vecEnd = vecStart.addVector( vecDir.xCoord * distance, vecDir.yCoord * distance, vecDir.zCoord * distance ); + Vec3d vecEnd = vecStart.addVector( vecDir.xCoord * distance, vecDir.yCoord * distance, vecDir.zCoord * distance ); // Raycast for blocks - MovingObjectPosition result = world.rayTraceBlocks( vecStart.addVector(0.0,0.0,0.0), vecEnd.addVector(0.0,0.0,0.0) ); - if( result != null && result.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK ) + RayTraceResult result = world.rayTraceBlocks( vecStart.addVector(0.0,0.0,0.0), vecEnd.addVector(0.0,0.0,0.0) ); + if( result != null && result.typeOfHit == RayTraceResult.Type.BLOCK ) { distance = vecStart.distanceTo( result.hitVec ); vecEnd = vecStart.addVector( vecDir.xCoord * distance, vecDir.yCoord * distance, vecDir.zCoord * distance ); @@ -94,7 +97,7 @@ public static Pair rayTraceEntities( World world, Vec3 vecStart, V continue; } - MovingObjectPosition littleBoxResult = littleBox.calculateIntercept( vecStart, vecEnd ); + RayTraceResult littleBoxResult = littleBox.calculateIntercept( vecStart, vecEnd ); if( littleBoxResult != null ) { double dist = vecStart.distanceTo( littleBoxResult.hitVec ); @@ -115,7 +118,7 @@ else if( littleBox.intersectsWith( bigBox ) ) } if( closest != null && closestDist <= distance ) { - Vec3 closestPos = vecStart.addVector( vecDir.xCoord * closestDist, vecDir.yCoord * closestDist, vecDir.zCoord * closestDist ); + Vec3d closestPos = vecStart.addVector( vecDir.xCoord * closestDist, vecDir.yCoord * closestDist, vecDir.zCoord * closestDist ); return Pair.of( closest, closestPos ); } return null; diff --git a/src/main/resources/assets/computercraft/models/block/cable_arm.json b/src/main/resources/assets/computercraft/models/block/cable_arm.json index 8b90234b9..a8deb3b9a 100644 --- a/src/main/resources/assets/computercraft/models/block/cable_arm.json +++ b/src/main/resources/assets/computercraft/models/block/cable_arm.json @@ -1,4 +1,5 @@ { + "parent": "block/block", "textures": { "particle": "computercraft:blocks/cableCore", "side": "computercraft:blocks/cableSide" diff --git a/src/main/resources/assets/computercraft/models/block/cable_core.json b/src/main/resources/assets/computercraft/models/block/cable_core.json index 5c5d1b390..444ac0a9e 100644 --- a/src/main/resources/assets/computercraft/models/block/cable_core.json +++ b/src/main/resources/assets/computercraft/models/block/cable_core.json @@ -1,4 +1,5 @@ { + "parent": "block/block", "textures": { "particle": "computercraft:blocks/cableCore", "side": "computercraft:blocks/cableSide", diff --git a/src/main/resources/assets/computercraft/models/block/cable_item.json b/src/main/resources/assets/computercraft/models/block/cable_item.json index 56402f75e..65506c7df 100644 --- a/src/main/resources/assets/computercraft/models/block/cable_item.json +++ b/src/main/resources/assets/computercraft/models/block/cable_item.json @@ -1,4 +1,5 @@ { + "parent": "block/block", "textures": { "particle": "computercraft:blocks/cableCore", "side": "computercraft:blocks/cableSide", diff --git a/src/main/resources/assets/computercraft/models/block/modem.json b/src/main/resources/assets/computercraft/models/block/modem.json index ecfc3d488..552b746fc 100644 --- a/src/main/resources/assets/computercraft/models/block/modem.json +++ b/src/main/resources/assets/computercraft/models/block/modem.json @@ -1,4 +1,5 @@ { + "parent": "block/block", "textures": { "particle": "#front" }, diff --git a/src/main/resources/assets/computercraft/models/block/turtle_base.json b/src/main/resources/assets/computercraft/models/block/turtle_base.json index 0806a29f6..09f24a8db 100644 --- a/src/main/resources/assets/computercraft/models/block/turtle_base.json +++ b/src/main/resources/assets/computercraft/models/block/turtle_base.json @@ -1,4 +1,5 @@ { + "parent": "block/block", "textures": { "particle": "#texture" }, diff --git a/src/main/resources/assets/computercraft/models/block/turtle_overlay.json b/src/main/resources/assets/computercraft/models/block/turtle_overlay.json index 3d5f52851..4d21b7e70 100644 --- a/src/main/resources/assets/computercraft/models/block/turtle_overlay.json +++ b/src/main/resources/assets/computercraft/models/block/turtle_overlay.json @@ -1,4 +1,5 @@ { + "parent": "block/block", "textures": { "particle": "#texture" }, diff --git a/src/main/resources/assets/computercraft/models/block/turtle_upgrade_base_left.json b/src/main/resources/assets/computercraft/models/block/turtle_upgrade_base_left.json index 7880d2f30..691f2fa37 100644 --- a/src/main/resources/assets/computercraft/models/block/turtle_upgrade_base_left.json +++ b/src/main/resources/assets/computercraft/models/block/turtle_upgrade_base_left.json @@ -1,4 +1,5 @@ { + "parent": "block/block", "textures": { "particle": "#texture" }, diff --git a/src/main/resources/assets/computercraft/models/block/turtle_upgrade_base_right.json b/src/main/resources/assets/computercraft/models/block/turtle_upgrade_base_right.json index fa16f8110..bd3aec9ef 100644 --- a/src/main/resources/assets/computercraft/models/block/turtle_upgrade_base_right.json +++ b/src/main/resources/assets/computercraft/models/block/turtle_upgrade_base_right.json @@ -1,4 +1,5 @@ { + "parent": "block/block", "textures": { "particle": "#texture" }, diff --git a/src/main/resources/assets/computercraft/models/item/CC-Cable.json b/src/main/resources/assets/computercraft/models/item/CC-Cable.json index 95f0c5bb6..73a08933c 100644 --- a/src/main/resources/assets/computercraft/models/item/CC-Cable.json +++ b/src/main/resources/assets/computercraft/models/item/CC-Cable.json @@ -1,14 +1,3 @@ { - "parent": "computercraft:block/cable_item", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "gui": { - "rotation": [ 0, 270, 0 ], - "scale" : [ 1.33, 1.33, 1.33 ] - } - } + "parent": "computercraft:block/cable_item" } diff --git a/src/main/resources/assets/computercraft/models/item/CC-Computer.json b/src/main/resources/assets/computercraft/models/item/CC-Computer.json index a11d07766..3f7b10291 100644 --- a/src/main/resources/assets/computercraft/models/item/CC-Computer.json +++ b/src/main/resources/assets/computercraft/models/item/CC-Computer.json @@ -1,13 +1,3 @@ { - "parent": "computercraft:block/computer_blinking", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "gui": { - "rotation": [ 0, 270, 0 ] - } - } + "parent": "computercraft:block/computer_blinking" } diff --git a/src/main/resources/assets/computercraft/models/item/CC-Peripheral.json b/src/main/resources/assets/computercraft/models/item/CC-Peripheral.json index 6ea7b50e7..b8858529b 100644 --- a/src/main/resources/assets/computercraft/models/item/CC-Peripheral.json +++ b/src/main/resources/assets/computercraft/models/item/CC-Peripheral.json @@ -1,13 +1,3 @@ { - "parent": "computercraft:block/disk_drive_empty", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "gui": { - "rotation": [ 0, 270, 0 ] - } - } + "parent": "computercraft:block/disk_drive_empty" } diff --git a/src/main/resources/assets/computercraft/models/item/CC-Turtle.json b/src/main/resources/assets/computercraft/models/item/CC-Turtle.json index 4485468d9..386400a5b 100644 --- a/src/main/resources/assets/computercraft/models/item/CC-Turtle.json +++ b/src/main/resources/assets/computercraft/models/item/CC-Turtle.json @@ -1,14 +1,3 @@ { - "parent": "computercraft:block/turtle", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "gui": { - "rotation": [ 0, 270, 0 ], - "scale": [ 1.14, 1.14, 1.14 ] - } - } + "parent": "computercraft:block/turtle" } diff --git a/src/main/resources/assets/computercraft/models/item/CC-TurtleAdvanced.json b/src/main/resources/assets/computercraft/models/item/CC-TurtleAdvanced.json index b939de606..210644ea1 100644 --- a/src/main/resources/assets/computercraft/models/item/CC-TurtleAdvanced.json +++ b/src/main/resources/assets/computercraft/models/item/CC-TurtleAdvanced.json @@ -1,14 +1,3 @@ { - "parent": "computercraft:block/advanced_turtle", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "gui": { - "rotation": [ 0, 270, 0 ], - "scale": [ 1.14, 1.14, 1.14 ] - } - } + "parent": "computercraft:block/advanced_turtle" } diff --git a/src/main/resources/assets/computercraft/models/item/CC-TurtleExpanded.json b/src/main/resources/assets/computercraft/models/item/CC-TurtleExpanded.json index 4485468d9..386400a5b 100644 --- a/src/main/resources/assets/computercraft/models/item/CC-TurtleExpanded.json +++ b/src/main/resources/assets/computercraft/models/item/CC-TurtleExpanded.json @@ -1,14 +1,3 @@ { - "parent": "computercraft:block/turtle", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "gui": { - "rotation": [ 0, 270, 0 ], - "scale": [ 1.14, 1.14, 1.14 ] - } - } + "parent": "computercraft:block/turtle" } diff --git a/src/main/resources/assets/computercraft/models/item/advanced_computer.json b/src/main/resources/assets/computercraft/models/item/advanced_computer.json index dd39ab06e..3a444bc0b 100644 --- a/src/main/resources/assets/computercraft/models/item/advanced_computer.json +++ b/src/main/resources/assets/computercraft/models/item/advanced_computer.json @@ -1,13 +1,3 @@ { "parent": "computercraft:block/advanced_computer_blinking", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "gui": { - "rotation": [ 0, 270, 0 ] - } - } } diff --git a/src/main/resources/assets/computercraft/models/item/advanced_modem.json b/src/main/resources/assets/computercraft/models/item/advanced_modem.json index d6ac16afa..e17df8bc9 100644 --- a/src/main/resources/assets/computercraft/models/item/advanced_modem.json +++ b/src/main/resources/assets/computercraft/models/item/advanced_modem.json @@ -1,20 +1,3 @@ { - "parent": "computercraft:block/advanced_modem_off", - "display": { - "thirdperson": { - "rotation": [ -10, 180, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "firstperson": { - "rotation": [ 0, 0, 0 ], - "translation": [ 3.2, 0, 0 ], - "scale" : [ 1.33, 1.33, 1.33 ] - }, - "gui": { - "rotation": [ 0, 90, 0 ], - "translation": [ 3.2, 0, 0 ], - "scale" : [ 1.33, 1.33, 1.33 ] - } - } + "parent": "computercraft:block/advanced_modem_off" } diff --git a/src/main/resources/assets/computercraft/models/item/advanced_monitor.json b/src/main/resources/assets/computercraft/models/item/advanced_monitor.json index 45c79c6ec..3d97e1393 100644 --- a/src/main/resources/assets/computercraft/models/item/advanced_monitor.json +++ b/src/main/resources/assets/computercraft/models/item/advanced_monitor.json @@ -1,13 +1,3 @@ { - "parent": "computercraft:block/advanced_monitor_item", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "gui": { - "rotation": [ 0, 270, 0 ] - } - } + "parent": "computercraft:block/advanced_monitor_item" } diff --git a/src/main/resources/assets/computercraft/models/item/advanced_pocket_computer_blinking.json b/src/main/resources/assets/computercraft/models/item/advanced_pocket_computer_blinking.json index 88ed3c15d..252819731 100644 --- a/src/main/resources/assets/computercraft/models/item/advanced_pocket_computer_blinking.json +++ b/src/main/resources/assets/computercraft/models/item/advanced_pocket_computer_blinking.json @@ -2,17 +2,5 @@ "parent": "builtin/generated", "textures": { "layer0": "computercraft:items/pocketComputerBlinkAdvanced" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/computercraft/models/item/advanced_pocket_computer_blinking_modem_on.json b/src/main/resources/assets/computercraft/models/item/advanced_pocket_computer_blinking_modem_on.json index 6805779f4..4ec4087a2 100644 --- a/src/main/resources/assets/computercraft/models/item/advanced_pocket_computer_blinking_modem_on.json +++ b/src/main/resources/assets/computercraft/models/item/advanced_pocket_computer_blinking_modem_on.json @@ -3,17 +3,5 @@ "textures": { "layer0": "computercraft:items/pocketComputerBlinkAdvanced", "layer1": "computercraft:items/pocketComputerModemLight" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/computercraft/models/item/advanced_pocket_computer_off.json b/src/main/resources/assets/computercraft/models/item/advanced_pocket_computer_off.json index ceb3ff8f0..89e50ed27 100644 --- a/src/main/resources/assets/computercraft/models/item/advanced_pocket_computer_off.json +++ b/src/main/resources/assets/computercraft/models/item/advanced_pocket_computer_off.json @@ -2,17 +2,5 @@ "parent": "builtin/generated", "textures": { "layer0": "computercraft:items/pocketComputerAdvanced" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/computercraft/models/item/advanced_pocket_computer_on.json b/src/main/resources/assets/computercraft/models/item/advanced_pocket_computer_on.json index 7e18538e5..a780c1341 100644 --- a/src/main/resources/assets/computercraft/models/item/advanced_pocket_computer_on.json +++ b/src/main/resources/assets/computercraft/models/item/advanced_pocket_computer_on.json @@ -2,17 +2,5 @@ "parent": "builtin/generated", "textures": { "layer0": "computercraft:items/pocketComputerOnAdvanced" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/computercraft/models/item/advanced_pocket_computer_on_modem_on.json b/src/main/resources/assets/computercraft/models/item/advanced_pocket_computer_on_modem_on.json index e7c5093c1..36c773dee 100644 --- a/src/main/resources/assets/computercraft/models/item/advanced_pocket_computer_on_modem_on.json +++ b/src/main/resources/assets/computercraft/models/item/advanced_pocket_computer_on_modem_on.json @@ -3,17 +3,5 @@ "textures": { "layer0": "computercraft:items/pocketComputerOnAdvanced", "layer1": "computercraft:items/pocketComputerModemLight" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/computercraft/models/item/book.json b/src/main/resources/assets/computercraft/models/item/book.json index 153af56e9..cdd2a3443 100644 --- a/src/main/resources/assets/computercraft/models/item/book.json +++ b/src/main/resources/assets/computercraft/models/item/book.json @@ -2,17 +2,5 @@ "parent": "builtin/generated", "textures": { "layer0": "computercraft:items/book" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/computercraft/models/item/command_computer.json b/src/main/resources/assets/computercraft/models/item/command_computer.json index 34dcbb071..ce5f442d1 100644 --- a/src/main/resources/assets/computercraft/models/item/command_computer.json +++ b/src/main/resources/assets/computercraft/models/item/command_computer.json @@ -1,13 +1,3 @@ { - "parent": "computercraft:block/command_computer_blinking", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "gui": { - "rotation": [ 0, 270, 0 ] - } - } + "parent": "computercraft:block/command_computer_blinking" } diff --git a/src/main/resources/assets/computercraft/models/item/disk.json b/src/main/resources/assets/computercraft/models/item/disk.json index 122f4117d..6ec1c6e27 100644 --- a/src/main/resources/assets/computercraft/models/item/disk.json +++ b/src/main/resources/assets/computercraft/models/item/disk.json @@ -3,17 +3,5 @@ "textures": { "layer0": "computercraft:items/diskFrame", "layer1": "computercraft:items/diskColour" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/computercraft/models/item/diskExpanded.json b/src/main/resources/assets/computercraft/models/item/diskExpanded.json index 122f4117d..6ec1c6e27 100644 --- a/src/main/resources/assets/computercraft/models/item/diskExpanded.json +++ b/src/main/resources/assets/computercraft/models/item/diskExpanded.json @@ -3,17 +3,5 @@ "textures": { "layer0": "computercraft:items/diskFrame", "layer1": "computercraft:items/diskColour" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/computercraft/models/item/monitor.json b/src/main/resources/assets/computercraft/models/item/monitor.json index 2292e5e68..1a2a92a4e 100644 --- a/src/main/resources/assets/computercraft/models/item/monitor.json +++ b/src/main/resources/assets/computercraft/models/item/monitor.json @@ -1,13 +1,3 @@ { - "parent": "computercraft:block/monitor_item", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "gui": { - "rotation": [ 0, 270, 0 ] - } - } + "parent": "computercraft:block/monitor_item" } diff --git a/src/main/resources/assets/computercraft/models/item/pages.json b/src/main/resources/assets/computercraft/models/item/pages.json index 4dd6fb18f..8f5ad1bd3 100644 --- a/src/main/resources/assets/computercraft/models/item/pages.json +++ b/src/main/resources/assets/computercraft/models/item/pages.json @@ -2,17 +2,5 @@ "parent": "builtin/generated", "textures": { "layer0": "computercraft:items/pageBundle" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/computercraft/models/item/pocketComputer.json b/src/main/resources/assets/computercraft/models/item/pocketComputer.json index b6b5ada95..a6d6af9e9 100644 --- a/src/main/resources/assets/computercraft/models/item/pocketComputer.json +++ b/src/main/resources/assets/computercraft/models/item/pocketComputer.json @@ -2,17 +2,5 @@ "parent": "builtin/generated", "textures": { "layer0": "computercraft:items/pocketComputer" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/computercraft/models/item/pocket_computer_blinking.json b/src/main/resources/assets/computercraft/models/item/pocket_computer_blinking.json index b4ad32af5..4beee93d1 100644 --- a/src/main/resources/assets/computercraft/models/item/pocket_computer_blinking.json +++ b/src/main/resources/assets/computercraft/models/item/pocket_computer_blinking.json @@ -2,17 +2,5 @@ "parent": "builtin/generated", "textures": { "layer0": "computercraft:items/pocketComputerBlink" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/computercraft/models/item/pocket_computer_blinking_modem_on.json b/src/main/resources/assets/computercraft/models/item/pocket_computer_blinking_modem_on.json index 4eed00f41..811a959be 100644 --- a/src/main/resources/assets/computercraft/models/item/pocket_computer_blinking_modem_on.json +++ b/src/main/resources/assets/computercraft/models/item/pocket_computer_blinking_modem_on.json @@ -3,17 +3,5 @@ "textures": { "layer0": "computercraft:items/pocketComputerBlink", "layer1": "computercraft:items/pocketComputerModemLight" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/computercraft/models/item/pocket_computer_on.json b/src/main/resources/assets/computercraft/models/item/pocket_computer_on.json index 6fc014eef..462ace6c0 100644 --- a/src/main/resources/assets/computercraft/models/item/pocket_computer_on.json +++ b/src/main/resources/assets/computercraft/models/item/pocket_computer_on.json @@ -2,17 +2,5 @@ "parent": "builtin/generated", "textures": { "layer0": "computercraft:items/pocketComputerOn" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/computercraft/models/item/pocket_computer_on_modem_on.json b/src/main/resources/assets/computercraft/models/item/pocket_computer_on_modem_on.json index b60d8ad73..fa22de8bb 100644 --- a/src/main/resources/assets/computercraft/models/item/pocket_computer_on_modem_on.json +++ b/src/main/resources/assets/computercraft/models/item/pocket_computer_on_modem_on.json @@ -3,17 +3,5 @@ "textures": { "layer0": "computercraft:items/pocketComputerOn", "layer1": "computercraft:items/pocketComputerModemLight" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/computercraft/models/item/printer.json b/src/main/resources/assets/computercraft/models/item/printer.json index e0a75113a..546626411 100644 --- a/src/main/resources/assets/computercraft/models/item/printer.json +++ b/src/main/resources/assets/computercraft/models/item/printer.json @@ -1,13 +1,3 @@ { - "parent": "computercraft:block/printer_empty", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "gui": { - "rotation": [ 0, 270, 0 ] - } - } + "parent": "computercraft:block/printer_empty" } diff --git a/src/main/resources/assets/computercraft/models/item/printout.json b/src/main/resources/assets/computercraft/models/item/printout.json index d3fdfbd40..cf7bd84ed 100644 --- a/src/main/resources/assets/computercraft/models/item/printout.json +++ b/src/main/resources/assets/computercraft/models/item/printout.json @@ -2,17 +2,5 @@ "parent": "builtin/generated", "textures": { "layer0": "computercraft:items/page" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/computercraft/models/item/treasureDisk.json b/src/main/resources/assets/computercraft/models/item/treasureDisk.json index 122f4117d..6ec1c6e27 100644 --- a/src/main/resources/assets/computercraft/models/item/treasureDisk.json +++ b/src/main/resources/assets/computercraft/models/item/treasureDisk.json @@ -3,17 +3,5 @@ "textures": { "layer0": "computercraft:items/diskFrame", "layer1": "computercraft:items/diskColour" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/computercraft/models/item/turtle_black.json b/src/main/resources/assets/computercraft/models/item/turtle_black.json index 20415dfe8..8fd9a96e6 100644 --- a/src/main/resources/assets/computercraft/models/item/turtle_black.json +++ b/src/main/resources/assets/computercraft/models/item/turtle_black.json @@ -1,14 +1,3 @@ { - "parent": "computercraft:block/turtle_black", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "gui": { - "rotation": [ 0, 270, 0 ], - "scale": [ 1.14, 1.14, 1.14 ] - } - } + "parent": "computercraft:block/turtle_black" } diff --git a/src/main/resources/assets/computercraft/models/item/turtle_blue.json b/src/main/resources/assets/computercraft/models/item/turtle_blue.json index 9feae2e61..b04c5762d 100644 --- a/src/main/resources/assets/computercraft/models/item/turtle_blue.json +++ b/src/main/resources/assets/computercraft/models/item/turtle_blue.json @@ -1,14 +1,3 @@ { - "parent": "computercraft:block/turtle_blue", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "gui": { - "rotation": [ 0, 270, 0 ], - "scale": [ 1.14, 1.14, 1.14 ] - } - } + "parent": "computercraft:block/turtle_blue" } diff --git a/src/main/resources/assets/computercraft/models/item/turtle_brown.json b/src/main/resources/assets/computercraft/models/item/turtle_brown.json index 979e6845f..0dc38b4cb 100644 --- a/src/main/resources/assets/computercraft/models/item/turtle_brown.json +++ b/src/main/resources/assets/computercraft/models/item/turtle_brown.json @@ -1,14 +1,3 @@ { - "parent": "computercraft:block/turtle_brown", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "gui": { - "rotation": [ 0, 270, 0 ], - "scale": [ 1.14, 1.14, 1.14 ] - } - } + "parent": "computercraft:block/turtle_brown" } diff --git a/src/main/resources/assets/computercraft/models/item/turtle_cyan.json b/src/main/resources/assets/computercraft/models/item/turtle_cyan.json index 4df971e88..a17379382 100644 --- a/src/main/resources/assets/computercraft/models/item/turtle_cyan.json +++ b/src/main/resources/assets/computercraft/models/item/turtle_cyan.json @@ -1,14 +1,3 @@ { - "parent": "computercraft:block/turtle_cyan", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "gui": { - "rotation": [ 0, 270, 0 ], - "scale": [ 1.14, 1.14, 1.14 ] - } - } + "parent": "computercraft:block/turtle_cyan" } diff --git a/src/main/resources/assets/computercraft/models/item/turtle_elf_overlay.json b/src/main/resources/assets/computercraft/models/item/turtle_elf_overlay.json index 1d3f3c775..414309448 100644 --- a/src/main/resources/assets/computercraft/models/item/turtle_elf_overlay.json +++ b/src/main/resources/assets/computercraft/models/item/turtle_elf_overlay.json @@ -1,14 +1,3 @@ { - "parent": "computercraft:block/turtle_elf_overlay", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "gui": { - "rotation": [ 0, 270, 0 ], - "scale": [ 1.14, 1.14, 1.14 ] - } - } + "parent": "computercraft:block/turtle_elf_overlay" } diff --git a/src/main/resources/assets/computercraft/models/item/turtle_green.json b/src/main/resources/assets/computercraft/models/item/turtle_green.json index ce01272e0..5490b9f43 100644 --- a/src/main/resources/assets/computercraft/models/item/turtle_green.json +++ b/src/main/resources/assets/computercraft/models/item/turtle_green.json @@ -1,14 +1,3 @@ { - "parent": "computercraft:block/turtle_green", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "gui": { - "rotation": [ 0, 270, 0 ], - "scale": [ 1.14, 1.14, 1.14 ] - } - } + "parent": "computercraft:block/turtle_green" } diff --git a/src/main/resources/assets/computercraft/models/item/turtle_grey.json b/src/main/resources/assets/computercraft/models/item/turtle_grey.json index 1ca438981..c8afc49d8 100644 --- a/src/main/resources/assets/computercraft/models/item/turtle_grey.json +++ b/src/main/resources/assets/computercraft/models/item/turtle_grey.json @@ -1,14 +1,3 @@ { - "parent": "computercraft:block/turtle_grey", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "gui": { - "rotation": [ 0, 270, 0 ], - "scale": [ 1.14, 1.14, 1.14 ] - } - } + "parent": "computercraft:block/turtle_grey" } diff --git a/src/main/resources/assets/computercraft/models/item/turtle_lightBlue.json b/src/main/resources/assets/computercraft/models/item/turtle_lightBlue.json index 3526386b0..2585e8d91 100644 --- a/src/main/resources/assets/computercraft/models/item/turtle_lightBlue.json +++ b/src/main/resources/assets/computercraft/models/item/turtle_lightBlue.json @@ -1,14 +1,3 @@ { - "parent": "computercraft:block/turtle_lightBlue", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "gui": { - "rotation": [ 0, 270, 0 ], - "scale": [ 1.14, 1.14, 1.14 ] - } - } + "parent": "computercraft:block/turtle_lightBlue" } diff --git a/src/main/resources/assets/computercraft/models/item/turtle_lightGrey.json b/src/main/resources/assets/computercraft/models/item/turtle_lightGrey.json index 7f7de52d3..ba665d7c3 100644 --- a/src/main/resources/assets/computercraft/models/item/turtle_lightGrey.json +++ b/src/main/resources/assets/computercraft/models/item/turtle_lightGrey.json @@ -1,14 +1,3 @@ { - "parent": "computercraft:block/turtle_lightGrey", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "gui": { - "rotation": [ 0, 270, 0 ], - "scale": [ 1.14, 1.14, 1.14 ] - } - } + "parent": "computercraft:block/turtle_lightGrey" } diff --git a/src/main/resources/assets/computercraft/models/item/turtle_lime.json b/src/main/resources/assets/computercraft/models/item/turtle_lime.json index 77205b141..4eb0e10c8 100644 --- a/src/main/resources/assets/computercraft/models/item/turtle_lime.json +++ b/src/main/resources/assets/computercraft/models/item/turtle_lime.json @@ -1,14 +1,3 @@ { - "parent": "computercraft:block/turtle_lime", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "gui": { - "rotation": [ 0, 270, 0 ], - "scale": [ 1.14, 1.14, 1.14 ] - } - } + "parent": "computercraft:block/turtle_lime" } diff --git a/src/main/resources/assets/computercraft/models/item/turtle_magenta.json b/src/main/resources/assets/computercraft/models/item/turtle_magenta.json index 2ea6cda97..04b13f3d3 100644 --- a/src/main/resources/assets/computercraft/models/item/turtle_magenta.json +++ b/src/main/resources/assets/computercraft/models/item/turtle_magenta.json @@ -1,14 +1,3 @@ { - "parent": "computercraft:block/turtle_magenta", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "gui": { - "rotation": [ 0, 270, 0 ], - "scale": [ 1.14, 1.14, 1.14 ] - } - } + "parent": "computercraft:block/turtle_magenta" } diff --git a/src/main/resources/assets/computercraft/models/item/turtle_orange.json b/src/main/resources/assets/computercraft/models/item/turtle_orange.json index b5e8b60dc..c3f22dbf5 100644 --- a/src/main/resources/assets/computercraft/models/item/turtle_orange.json +++ b/src/main/resources/assets/computercraft/models/item/turtle_orange.json @@ -1,14 +1,3 @@ { - "parent": "computercraft:block/turtle_orange", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "gui": { - "rotation": [ 0, 270, 0 ], - "scale": [ 1.14, 1.14, 1.14 ] - } - } + "parent": "computercraft:block/turtle_orange" } diff --git a/src/main/resources/assets/computercraft/models/item/turtle_pink.json b/src/main/resources/assets/computercraft/models/item/turtle_pink.json index c1530495d..c9718af0d 100644 --- a/src/main/resources/assets/computercraft/models/item/turtle_pink.json +++ b/src/main/resources/assets/computercraft/models/item/turtle_pink.json @@ -1,14 +1,3 @@ { - "parent": "computercraft:block/turtle_pink", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "gui": { - "rotation": [ 0, 270, 0 ], - "scale": [ 1.14, 1.14, 1.14 ] - } - } + "parent": "computercraft:block/turtle_pink" } diff --git a/src/main/resources/assets/computercraft/models/item/turtle_purple.json b/src/main/resources/assets/computercraft/models/item/turtle_purple.json index fbf89e80a..dfab19f29 100644 --- a/src/main/resources/assets/computercraft/models/item/turtle_purple.json +++ b/src/main/resources/assets/computercraft/models/item/turtle_purple.json @@ -1,14 +1,3 @@ { - "parent": "computercraft:block/turtle_purple", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "gui": { - "rotation": [ 0, 270, 0 ], - "scale": [ 1.14, 1.14, 1.14 ] - } - } + "parent": "computercraft:block/turtle_purple" } diff --git a/src/main/resources/assets/computercraft/models/item/turtle_red.json b/src/main/resources/assets/computercraft/models/item/turtle_red.json index a68cfafb3..f2bf67d04 100644 --- a/src/main/resources/assets/computercraft/models/item/turtle_red.json +++ b/src/main/resources/assets/computercraft/models/item/turtle_red.json @@ -1,14 +1,3 @@ { - "parent": "computercraft:block/turtle_red", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "gui": { - "rotation": [ 0, 270, 0 ], - "scale": [ 1.14, 1.14, 1.14 ] - } - } + "parent": "computercraft:block/turtle_red" } diff --git a/src/main/resources/assets/computercraft/models/item/turtle_white.json b/src/main/resources/assets/computercraft/models/item/turtle_white.json index ccef31777..46b31459c 100644 --- a/src/main/resources/assets/computercraft/models/item/turtle_white.json +++ b/src/main/resources/assets/computercraft/models/item/turtle_white.json @@ -1,14 +1,3 @@ { - "parent": "computercraft:block/turtle_white", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "gui": { - "rotation": [ 0, 270, 0 ], - "scale": [ 1.14, 1.14, 1.14 ] - } - } + "parent": "computercraft:block/turtle_white" } diff --git a/src/main/resources/assets/computercraft/models/item/turtle_yellow.json b/src/main/resources/assets/computercraft/models/item/turtle_yellow.json index a83e2c0b5..0ff610b00 100644 --- a/src/main/resources/assets/computercraft/models/item/turtle_yellow.json +++ b/src/main/resources/assets/computercraft/models/item/turtle_yellow.json @@ -1,14 +1,3 @@ { - "parent": "computercraft:block/turtle_yellow", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "gui": { - "rotation": [ 0, 270, 0 ], - "scale": [ 1.14, 1.14, 1.14 ] - } - } + "parent": "computercraft:block/turtle_yellow" } diff --git a/src/main/resources/assets/computercraft/models/item/wired_modem.json b/src/main/resources/assets/computercraft/models/item/wired_modem.json index ff0007218..e012bb41e 100644 --- a/src/main/resources/assets/computercraft/models/item/wired_modem.json +++ b/src/main/resources/assets/computercraft/models/item/wired_modem.json @@ -1,20 +1,3 @@ { - "parent": "computercraft:block/wired_modem_off", - "display": { - "thirdperson": { - "rotation": [ -10, 180, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "firstperson": { - "rotation": [ 0, 0, 0 ], - "translation": [ 3.2, 0, 0 ], - "scale" : [ 1.33, 1.33, 1.33 ] - }, - "gui": { - "rotation": [ 0, 90, 0 ], - "translation": [ 3.2, 0, 0 ], - "scale" : [ 1.33, 1.33, 1.33 ] - } - } + "parent": "computercraft:block/wired_modem_off" } diff --git a/src/main/resources/assets/computercraft/models/item/wireless_modem.json b/src/main/resources/assets/computercraft/models/item/wireless_modem.json index a31518361..2cc3f692d 100644 --- a/src/main/resources/assets/computercraft/models/item/wireless_modem.json +++ b/src/main/resources/assets/computercraft/models/item/wireless_modem.json @@ -1,20 +1,3 @@ { - "parent": "computercraft:block/wireless_modem_off", - "display": { - "thirdperson": { - "rotation": [ -10, 180, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "firstperson": { - "rotation": [ 0, 0, 0 ], - "translation": [ 3.2, 0, 0 ], - "scale" : [ 1.33, 1.33, 1.33 ] - }, - "gui": { - "rotation": [ 0, 90, 0 ], - "translation": [ 3.2, 0, 0 ], - "scale" : [ 1.33, 1.33, 1.33 ] - } - } + "parent": "computercraft:block/wireless_modem_off" }