From 84b0dd171eda65f0534b20739a7d19e8d3700d3e Mon Sep 17 00:00:00 2001 From: Enyby Date: Sat, 9 Mar 2019 23:35:22 +0200 Subject: [PATCH] Fix error messages for pass tests. --- src/core/org/luaj/vm2/LuaValue.java | 1614 +++++++++++++-------------- 1 file changed, 806 insertions(+), 808 deletions(-) diff --git a/src/core/org/luaj/vm2/LuaValue.java b/src/core/org/luaj/vm2/LuaValue.java index 953adbab..9d3af18d 100644 --- a/src/core/org/luaj/vm2/LuaValue.java +++ b/src/core/org/luaj/vm2/LuaValue.java @@ -21,33 +21,31 @@ ******************************************************************************/ package org.luaj.vm2; -import org.luaj.vm2.Varargs; - /** - * Base class for all concrete lua type values. + * 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 {@link LuaValue}. *

- * Constructors are provided as static methods for common Java types, such as - * {@link LuaValue#valueOf(int)} or {@link LuaValue#valueOf(String)} - * to allow for instance pooling. - *

- * Constants are defined for the lua values - * {@link #NIL}, {@link #TRUE}, and {@link #FALSE}. + * Constructors are provided as static methods for common Java types, such as + * {@link LuaValue#valueOf(int)} or {@link LuaValue#valueOf(String)} + * to allow for instance pooling. + *

+ * Constants are defined for the lua values + * {@link #NIL}, {@link #TRUE}, and {@link #FALSE}. * A constant {@link #NONE} is defined which is a {@link Varargs} list having no values. - *

- * Operations are performed on values directly via their Java methods. + *

+ * Operations are performed on values directly via their Java methods. * For example, the following code divides two numbers: *

 {@code
  * LuaValue a = LuaValue.valueOf( 5 );
  * LuaValue b = LuaValue.valueOf( 4 );
  * LuaValue c = a.div(b);
  * } 
- * Note that in this example, c will be a {@link LuaDouble}, but would be a {@link LuaInteger} - * if the value of a were changed to 8, say. + * Note that in this example, c will be a {@link LuaDouble}, but would be a {@link 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. + * as well as any metatable/metatag processing that occurs. *

* Field access and function calls are similar, with common overloads to simplify Java usage: *

 {@code
@@ -58,7 +56,7 @@ import org.luaj.vm2.Varargs;
  * print.call( LuaValue.valueOf("sqrt(5):"), a );
  * } 
*

- * To supply variable arguments or get multiple return values, use + * To supply variable arguments or get multiple return values, use * {@link #invoke(Varargs)} or {@link #invokemethod(LuaValue, Varargs)} methods: *

 {@code
  * LuaValue modf = globals.get("math").get("modf");
@@ -71,18 +69,18 @@ import org.luaj.vm2.Varargs;
  * LoadState.load( new FileInputStream("main.lua"), "main.lua", globals ).call();
  * } 
*

- * although {@code require} could also be used: + * although {@code require} could also be used: *

 {@code
  * 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 {@link org.luaj.vm2.lib.jse.JsePlatform} and {@link org.luaj.vm2.lib.jme.JmePlatform} for details. + * For this to work the file must be in the current directory, or in the class path, + * dependening on the platform. + * See {@link org.luaj.vm2.lib.jse.JsePlatform} and {@link org.luaj.vm2.lib.jme.JmePlatform} for details. *

- * In general a {@link 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. + * In general a {@link 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 - * {@link #TNIL}, {@link #TBOOLEAN}, {@link #TLIGHTUSERDATA}, {@link #TNUMBER}, {@link #TSTRING}, + *

+ * Predefined constants exist for the standard lua type constants + * {@link #TNIL}, {@link #TBOOLEAN}, {@link #TLIGHTUSERDATA}, {@link #TNUMBER}, {@link #TSTRING}, * {@link #TTABLE}, {@link #TFUNCTION}, {@link #TUSERDATA}, {@link #TTHREAD}, - * and extended lua type constants + * and extended lua type constants * {@link #TINT}, {@link #TNONE}, {@link #TVALUE} - *

- * Predefined constants exist for all strings used as metatags: - * {@link #INDEX}, {@link #NEWINDEX}, {@link #CALL}, {@link #MODE}, {@link #METATABLE}, - * {@link #ADD}, {@link #SUB}, {@link #DIV}, {@link #MUL}, {@link #POW}, - * {@link #MOD}, {@link #UNM}, {@link #LEN}, {@link #EQ}, {@link #LT}, + *

+ * Predefined constants exist for all strings used as metatags: + * {@link #INDEX}, {@link #NEWINDEX}, {@link #CALL}, {@link #MODE}, {@link #METATABLE}, + * {@link #ADD}, {@link #SUB}, {@link #DIV}, {@link #MUL}, {@link #POW}, + * {@link #MOD}, {@link #UNM}, {@link #LEN}, {@link #EQ}, {@link #LT}, * {@link #LE}, {@link #TOSTRING}, and {@link #CONCAT}. * * @see org.luaj.vm2.lib.jse.JsePlatform * @see org.luaj.vm2.lib.jme.JmePlatform - * @see LoadState + * @see LoadState * @see Varargs */ abstract @@ -149,10 +147,10 @@ public class LuaValue extends Varargs { /** String array constant containing names of each of the lua value types * @see #type() - * @see #typename() + * @see #typename() */ public static final String[] TYPE_NAMES = { - "nil", + "nil", "boolean", "lightuserdata", "number", @@ -251,10 +249,10 @@ public class LuaValue extends Varargs { /** Limit on lua stack size */ private static int MAXSTACK = 250; - /** Array of {@link #NIL} values to optimize filling stacks using System.arraycopy(). - * Must not be modified. + /** Array of {@link #NIL} values to optimize filling stacks using System.arraycopy(). + * Must not be modified. */ - public static final LuaValue[] NILS = new LuaValue[MAXSTACK]; + public static final LuaValue[] NILS = new LuaValue[MAXSTACK]; static { for ( int i=0; i * * @return name from type name list {@link #TYPE_NAMES} - * corresponding to the type of this value: + * corresponding to the type of this value: * "nil", "boolean", "number", "string", - * "table", "function", "userdata", "thread" + * "table", "function", "userdata", "thread" * @see #type() */ abstract public String typename(); - /** Check if {@code this} is a {@code boolean} + /** Check if {@code this} is a {@code boolean} * @return true if this is a {@code boolean}, otherwise false * @see #isboolean() * @see #toboolean() @@ -296,7 +294,7 @@ public class LuaValue extends Varargs { */ public boolean isboolean() { return false; } - /** Check if {@code this} is a {@code function} that is a closure, + /** Check if {@code this} is a {@code function} that is a closure, * meaning interprets lua bytecode for its execution * @return true if this is a {@code closure}, otherwise false * @see #isfunction() @@ -315,12 +313,12 @@ public class LuaValue extends Varargs { */ public boolean isfunction() { return false; } - /** Check if {@code this} is a {@code number} and is representable by java int + /** Check if {@code this} is a {@code number} and is representable by java int * without rounding or truncation - * @return true if this is a {@code number} - * meaning derives from {@link LuaNumber} + * @return true if this is a {@code number} + * meaning derives from {@link LuaNumber} * or derives from {@link LuaString} and is convertible to a number, - * and can be represented by int, + * and can be represented by int, * otherwise false * @see #isinttype() * @see #islong() @@ -333,8 +331,8 @@ public class LuaValue extends Varargs { /** Check if {@code this} is a {@link LuaInteger} *

- * No attempt to convert from string will be made by this call. - * @return true if this is a {@code LuaInteger}, + * No attempt to convert from string will be made by this call. + * @return true if this is a {@code LuaInteger}, * otherwise false * @see #isint() * @see #isnumber() @@ -343,12 +341,12 @@ public class LuaValue extends Varargs { */ public boolean isinttype() { return false; } - /** Check if {@code this} is a {@code number} and is representable by java long + /** Check if {@code this} is a {@code number} and is representable by java long * without rounding or truncation - * @return true if this is a {@code number} - * meaning derives from {@link LuaNumber} + * @return true if this is a {@code number} + * meaning derives from {@link LuaNumber} * or derives from {@link LuaString} and is convertible to a number, - * and can be represented by long, + * and can be represented by long, * otherwise false * @see #tonumber() * @see #checklong() @@ -370,9 +368,9 @@ public class LuaValue extends Varargs { public boolean isnil() { return false; } /** Check if {@code this} is a {@code number} - * @return true if this is a {@code number}, - * meaning derives from {@link LuaNumber} - * or derives from {@link LuaString} and is convertible to a number, + * @return true if this is a {@code number}, + * meaning derives from {@link LuaNumber} + * or derives from {@link LuaString} and is convertible to a number, * otherwise false * @see #tonumber() * @see #checknumber() @@ -382,8 +380,8 @@ public class LuaValue extends Varargs { public boolean isnumber() { return false; } // may convert from string /** Check if {@code this} is a {@code string} - * @return true if this is a {@code string}, - * meaning derives from {@link LuaString} or {@link LuaNumber}, + * @return true if this is a {@code string}, + * meaning derives from {@link LuaString} or {@link LuaNumber}, * otherwise false * @see #tostring() * @see #checkstring() @@ -420,8 +418,8 @@ public class LuaValue extends Varargs { /** Check if {@code this} is a {@code userdata} of type {@code c} * @param c Class to test instance against - * @return true if this is a {@code userdata} - * and the instance is assignable to {@code c}, + * @return true if this is a {@code userdata} + * and the instance is assignable to {@code c}, * otherwise false * @see #isuserdata() * @see #touserdata(Class) @@ -434,14 +432,14 @@ public class LuaValue extends Varargs { /** Convert to boolean false if {@link #NIL} or {@link #FALSE}, true if anything else * @return Value cast to byte if number or string convertible to number, otherwise 0 * @see #optboolean(boolean) - * @see #checkboolean() + * @see #checkboolean() * @see #isboolean() * @see #TBOOLEAN */ public boolean toboolean() { return true; } /** Convert to byte if numeric, or 0 if not. - * @return Value cast to byte if number or string convertible to number, otherwise 0 + * @return Value cast to byte if number or string convertible to number, otherwise 0 * @see #toint() * @see #todouble() * @see #checknumber() @@ -451,7 +449,7 @@ public class LuaValue extends Varargs { public byte tobyte() { return 0; } /** Convert to char if numeric, or 0 if not. - * @return Value cast to char if number or string convertible to number, otherwise 0 + * @return Value cast to char if number or string convertible to number, otherwise 0 * @see #toint() * @see #todouble() * @see #checknumber() @@ -461,7 +459,7 @@ public class LuaValue extends Varargs { public char tochar() { return 0; } /** Convert to double if numeric, or 0 if not. - * @return Value cast to double if number or string convertible to number, otherwise 0 + * @return Value cast to double if number or string convertible to number, otherwise 0 * @see #toint() * @see #tobyte() * @see #tochar() @@ -476,7 +474,7 @@ public class LuaValue extends Varargs { public double todouble() { return 0; } /** Convert to float if numeric, or 0 if not. - * @return Value cast to float if number or string convertible to number, otherwise 0 + * @return Value cast to float if number or string convertible to number, otherwise 0 * @see #toint() * @see #todouble() * @see #checknumber() @@ -486,7 +484,7 @@ public class LuaValue extends Varargs { public float tofloat() { return 0; } /** Convert to int if numeric, or 0 if not. - * @return Value cast to int if number or string convertible to number, otherwise 0 + * @return Value cast to int if number or string convertible to number, otherwise 0 * @see #tobyte() * @see #tochar() * @see #toshort() @@ -501,7 +499,7 @@ public class LuaValue extends Varargs { public int toint() { return 0; } /** Convert to long if numeric, or 0 if not. - * @return Value cast to long if number or string convertible to number, otherwise 0 + * @return Value cast to long if number or string convertible to number, otherwise 0 * @see #isint() * @see #isinttype() * @see #toint() @@ -514,7 +512,7 @@ public class LuaValue extends Varargs { public long tolong() { return 0; } /** Convert to short if numeric, or 0 if not. - * @return Value cast to short if number or string convertible to number, otherwise 0 + * @return Value cast to short if number or string convertible to number, otherwise 0 * @see #toint() * @see #todouble() * @see #checknumber() @@ -524,7 +522,7 @@ public class LuaValue extends Varargs { public short toshort() { return 0; } /** Convert to human readable String for any type. - * @return String for use by human readers based on type. + * @return String for use by human readers based on type. * @see #tostring() * @see #optjstring(String) * @see #checkjstring() @@ -543,7 +541,7 @@ public class LuaValue extends Varargs { public Object touserdata() { return null; } /** Convert to userdata instance if specific type, or null. - * @return userdata instance if is a userdata whose instance derives from {@code c}, + * @return userdata instance if is a userdata whose instance derives from {@code c}, * or null if not {@link LuaUserdata} * @see #optuserdata(Class,Object) * @see #checkuserdata(Class) @@ -552,61 +550,61 @@ public class LuaValue extends Varargs { */ public Object touserdata(Class c) { return null; } - /** + /** * Convert the value to a human readable string using {@link #tojstring()} * @return String value intended to be human readible. * @see #tostring() * @see #tojstring() * @see #optstring(LuaString) * @see #checkstring() - * @see #toString() + * @see #toString() */ public String toString() { return tojstring(); } /** 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 {@link LuaValue} {@code this} if it is a number - * or a string convertible to a number, - * and {@link #NIL} for all other cases. + *

+ * In lua all numbers are strings, but not all strings are numbers. + * This function will return + * the {@link LuaValue} {@code this} if it is a number + * or a string convertible to a number, + * and {@link #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. + * the penalty of throwing exceptions, + * nor the cost of converting the type and creating storage for it. * @return {@code this} if it is a {@link LuaNumber} - * or {@link LuaString} that can be converted to a number, + * or {@link LuaString} that can be converted to a number, * otherwise {@link #NIL} * @see #tostring() * @see #optnumber(LuaNumber) * @see #checknumber() * @see #toint() * @see #todouble() - */ + */ public LuaValue tonumber() { return NIL; } /** Conditionally convert to lua string without throwing errors. - *

- * In lua all numbers are strings, so this function will return - * the {@link LuaValue} {@code this} if it is a string or number, - * and {@link #NIL} for all other cases. + *

+ * In lua all numbers are strings, so this function will return + * the {@link LuaValue} {@code this} if it is a string or number, + * and {@link #NIL} for all other cases. *

* This allows values to be tested for their "string-ness" without - * the penalty of throwing exceptions. - * @return {@code this} if it is a {@link LuaString} or {@link LuaNumber}, - * otherwise {@link #NIL} + * the penalty of throwing exceptions. + * @return {@code this} if it is a {@link LuaString} or {@link LuaNumber}, + * otherwise {@link #NIL} * @see #tonumber() * @see #tojstring() * @see #optstring(LuaString) * @see #checkstring() - * @see #toString() - */ + * @see #toString() + */ public LuaValue tostring() { return NIL; } /** Check that optional argument is a boolean and return its boolean value * @param defval boolean value to return if {@code this} is nil or none - * @return {@code this} cast to boolean if a {@link LuaBoolean}, - * {@code defval} if nil or none, + * @return {@code this} cast to boolean if a {@link LuaBoolean}, + * {@code defval} if nil or none, * throws {@link LuaError} otherwise * @throws LuaError if was not a boolean or nil or none. * @see #checkboolean() @@ -617,10 +615,10 @@ public class LuaValue extends Varargs { /** Check that optional argument is a closure and return as {@link LuaClosure} *

- * A {@link LuaClosure} is a {@link LuaFunction} that executes lua byteccode. + * A {@link LuaClosure} is a {@link LuaFunction} that executes lua byteccode. * @param defval {@link LuaClosure} to return if {@code this} is nil or none - * @return {@code this} cast to {@link LuaClosure} if a function, - * {@code defval} if nil or none, + * @return {@code this} cast to {@link LuaClosure} if a function, + * {@code defval} if nil or none, * throws {@link LuaError} otherwise * @throws LuaError if was not a closure or nil or none. * @see #checkclosure() @@ -631,8 +629,8 @@ public class LuaValue extends Varargs { /** Check that optional argument is a number or string convertible to number and return as double * @param defval double to return if {@code this} is nil or none - * @return {@code this} cast to double if numeric, - * {@code defval} if nil or none, + * @return {@code this} cast to double if numeric, + * {@code defval} if nil or none, * throws {@link LuaError} otherwise * @throws LuaError if was not numeric or nil or none. * @see #optint(int) @@ -647,12 +645,12 @@ public class LuaValue extends Varargs { /** Check that optional argument is a function and return as {@link LuaFunction} *

- * A {@link LuaFunction} may either be a Java function that implements - * functionality directly in Java, or a {@link LuaClosure} - * which is a {@link LuaFunction} that executes lua bytecode. + * A {@link LuaFunction} may either be a Java function that implements + * functionality directly in Java, or a {@link LuaClosure} + * which is a {@link LuaFunction} that executes lua bytecode. * @param defval {@link LuaFunction} to return if {@code this} is nil or none - * @return {@code this} cast to {@link LuaFunction} if a function, - * {@code defval} if nil or none, + * @return {@code this} cast to {@link LuaFunction} if a function, + * {@code defval} if nil or none, * throws {@link LuaError} otherwise * @throws LuaError if was not a function or nil or none. * @see #checkfunction() @@ -663,8 +661,8 @@ public class LuaValue extends Varargs { /** Check that optional argument is a number or string convertible to number and return as int * @param defval int to return if {@code this} is nil or none - * @return {@code this} cast to int if numeric, - * {@code defval} if nil or none, + * @return {@code this} cast to int if numeric, + * {@code defval} if nil or none, * throws {@link LuaError} otherwise * @throws LuaError if was not numeric or nil or none. * @see #optdouble(double) @@ -680,8 +678,8 @@ public class LuaValue extends Varargs { /** Check that optional argument is a number or string convertible to number and return as {@link LuaInteger} * @param defval {@link LuaInteger} to return if {@code this} is nil or none - * @return {@code this} converted and wrapped in {@link LuaInteger} if numeric, - * {@code defval} if nil or none, + * @return {@code this} converted and wrapped in {@link LuaInteger} if numeric, + * {@code defval} if nil or none, * throws {@link LuaError} otherwise * @throws LuaError if was not numeric or nil or none. * @see #optdouble(double) @@ -696,8 +694,8 @@ public class LuaValue extends Varargs { /** Check that optional argument is a number or string convertible to number and return as long * @param defval long to return if {@code this} is nil or none - * @return {@code this} cast to long if numeric, - * {@code defval} if nil or none, + * @return {@code this} cast to long if numeric, + * {@code defval} if nil or none, * throws {@link LuaError} otherwise * @throws LuaError if was not numeric or nil or none. * @see #optdouble(double) @@ -712,8 +710,8 @@ public class LuaValue extends Varargs { /** Check that optional argument is a number or string convertible to number and return as {@link LuaNumber} * @param defval {@link LuaNumber} to return if {@code this} is nil or none - * @return {@code this} cast to {@link LuaNumber} if numeric, - * {@code defval} if nil or none, + * @return {@code this} cast to {@link LuaNumber} if numeric, + * {@code defval} if nil or none, * throws {@link LuaError} otherwise * @throws LuaError if was not numeric or nil or none. * @see #optdouble(double) @@ -729,36 +727,36 @@ public class LuaValue extends Varargs { /** Check that optional argument is a string or number and return as Java String * @param defval {@link LuaString} to return if {@code this} is nil or none - * @return {@code this} converted to String if a string or number, - * {@code defval} if nil or none, + * @return {@code this} converted to String if a string or number, + * {@code defval} if nil or none, * throws {@link LuaError} if some other type * @throws LuaError if was not a string or number or nil or none. * @see #tojstring() * @see #optstring(LuaString) * @see #checkjstring() - * @see #toString() + * @see #toString() * @see #TSTRING */ public String optjstring(String defval) { argerror("String"); return null; } /** Check that optional argument is a string or number and return as {@link LuaString} * @param defval {@link LuaString} to return if {@code this} is nil or none - * @return {@code this} converted to {@link LuaString} if a string or number, - * {@code defval} if nil or none, + * @return {@code this} converted to {@link LuaString} if a string or number, + * {@code defval} if nil or none, * throws {@link LuaError} if some other type * @throws LuaError if was not a string or number or nil or none. * @see #tojstring() * @see #optjstring(String) * @see #checkstring() - * @see #toString() + * @see #toString() * @see #TSTRING */ public LuaString optstring(LuaString defval) { argerror("string"); return null; } /** Check that optional argument is a table and return as {@link LuaTable} * @param defval {@link LuaTable} to return if {@code this} is nil or none - * @return {@code this} cast to {@link LuaTable} if a table, - * {@code defval} if nil or none, + * @return {@code this} cast to {@link LuaTable} if a table, + * {@code defval} if nil or none, * throws {@link LuaError} if some other type * @throws LuaError if was not a table or nil or none. * @see #checktable() @@ -769,8 +767,8 @@ public class LuaValue extends Varargs { /** Check that optional argument is a thread and return as {@link LuaThread} * @param defval {@link LuaThread} to return if {@code this} is nil or none - * @return {@code this} cast to {@link LuaTable} if a thread, - * {@code defval} if nil or none, + * @return {@code this} cast to {@link LuaTable} if a thread, + * {@code defval} if nil or none, * throws {@link LuaError} if some other type * @throws LuaError if was not a thread or nil or none. * @see #checkthread() @@ -781,8 +779,8 @@ public class LuaValue extends Varargs { /** Check that optional argument is a userdata and return the Object instance * @param defval Object to return if {@code this} is nil or none - * @return Object instance of the userdata if a {@link LuaUserdata}, - * {@code defval} if nil or none, + * @return Object instance of the userdata if a {@link LuaUserdata}, + * {@code defval} if nil or none, * throws {@link LuaError} if some other type * @throws LuaError if was not a userdata or nil or none. * @see #checkuserdata() @@ -796,8 +794,8 @@ public class LuaValue extends Varargs { * and return the Object instance * @param c Class to test userdata instance against * @param defval Object to return if {@code this} is nil or none - * @return Object instance of the userdata if a {@link LuaUserdata} and instance is assignable to {@code c}, - * {@code defval} if nil or none, + * @return Object instance of the userdata if a {@link LuaUserdata} and instance is assignable to {@code c}, + * {@code defval} if nil or none, * throws {@link LuaError} if some other type * @throws LuaError if was not a userdata whose instance is assignable to {@code c} or nil or none. * @see #checkuserdata(Class) @@ -820,20 +818,20 @@ public class LuaValue extends Varargs { public LuaValue optvalue(LuaValue defval) { return this; } - /** Check that the value is a {@link LuaBoolean}, + /** Check that the value is a {@link LuaBoolean}, * or throw {@link LuaError} if not - * @return boolean value for {@code this} if it is a {@link LuaBoolean} + * @return boolean value for {@code this} if it is a {@link LuaBoolean} * @throws LuaError if not a {@link LuaBoolean} * @see #optboolean(boolean) * @see #TBOOLEAN */ public boolean checkboolean() { argerror("boolean"); return false; } - /** Check that the value is a {@link LuaClosure} , + /** Check that the value is a {@link LuaClosure} , * or throw {@link LuaError} if not *

- * {@link LuaClosure} is a subclass of {@link LuaFunction} that interprets lua bytecode. - * @return {@code this} cast as {@link LuaClosure} + * {@link LuaClosure} is a subclass of {@link LuaFunction} that interprets lua bytecode. + * @return {@code this} cast as {@link LuaClosure} * @throws LuaError if not a {@link LuaClosure} * @see #checkfunction() * @see #optclosure(LuaClosure) @@ -842,11 +840,11 @@ public class LuaValue extends Varargs { */ public LuaClosure checkclosure() { argerror("closure"); return null; } - /** Check that the value is numeric and return the value as a double, + /** Check that the value is numeric and return the value as a double, * or throw {@link LuaError} if not numeric *

- * Values that are {@link LuaNumber} and values that are {@link LuaString} - * that can be converted to a number will be converted to double. + * Values that are {@link LuaNumber} and values that are {@link LuaString} + * that can be converted to a number will be converted to double. * @return value cast to a double if numeric * @throws LuaError if not a {@link LuaNumber} or is a {@link LuaString} that can't be converted to number * @see #checkint() @@ -857,30 +855,30 @@ public class LuaValue extends Varargs { */ public double checkdouble() { argerror("number"); return 0; } - /** Check that the value is a function , or throw {@link LuaError} if not + /** Check that the value is a function , or throw {@link LuaError} if not *

- * A {@link LuaFunction} may either be a Java function that implements - * functionality directly in Java, or a {@link LuaClosure} - * which is a {@link LuaFunction} that executes lua bytecode. + * A {@link LuaFunction} may either be a Java function that implements + * functionality directly in Java, or a {@link LuaClosure} + * which is a {@link LuaFunction} that executes lua bytecode. * @return {@code this} if it is a lua function or closure - * @throws LuaError if not a function + * @throws LuaError if not a function * @see #checkclosure() */ - public LuaFunction checkfunction() { argerror("function"); return null; } + public LuaFunction checkfunction() { argerror("function"); return null; } - /** Check that the value is a Globals instance, or throw {@link LuaError} if not + /** Check that the value is a Globals instance, or throw {@link LuaError} if not *

- * {@link Globals} are a special {@link LuaTable} that establish the default global environment. + * {@link Globals} are a special {@link LuaTable} that establish the default global environment. * @return {@code this} if if an instance fof {@link Globals} - * @throws LuaError if not a {@link Globals} instance. + * @throws LuaError if not a {@link Globals} instance. */ public Globals checkglobals() { argerror("globals"); return null; } - /** Check that the value is numeric, and convert and cast value to int, or throw {@link LuaError} if not numeric + /** Check that the value is numeric, and convert and cast value to int, or throw {@link LuaError} if not numeric *

* Values that are {@link LuaNumber} will be cast to int and may lose precision. - * Values that are {@link LuaString} that can be converted to a number will be converted, + * Values that are {@link LuaString} that can be converted to a number will be converted, * then cast to int, so may also lose precision. * @return value cast to a int if numeric * @throws LuaError if not a {@link LuaNumber} or is a {@link LuaString} that can't be converted to number @@ -892,10 +890,10 @@ public class LuaValue extends Varargs { */ public int checkint() { argerror("int"); return 0; } - /** Check that the value is numeric, and convert and cast value to int, or throw {@link LuaError} if not numeric + /** Check that the value is numeric, and convert and cast value to int, or throw {@link LuaError} if not numeric *

* Values that are {@link LuaNumber} will be cast to int and may lose precision. - * Values that are {@link LuaString} that can be converted to a number will be converted, + * Values that are {@link LuaString} that can be converted to a number will be converted, * then cast to int, so may also lose precision. * @return value cast to a int and wrapped in {@link LuaInteger} if numeric * @throws LuaError if not a {@link LuaNumber} or is a {@link LuaString} that can't be converted to number @@ -907,10 +905,10 @@ public class LuaValue extends Varargs { */ public LuaInteger checkinteger() { argerror("integer"); return null; } - /** Check that the value is numeric, and convert and cast value to long, or throw {@link LuaError} if not numeric + /** Check that the value is numeric, and convert and cast value to long, or throw {@link LuaError} if not numeric *

* Values that are {@link LuaNumber} will be cast to long and may lose precision. - * Values that are {@link LuaString} that can be converted to a number will be converted, + * Values that are {@link LuaString} that can be converted to a number will be converted, * then cast to long, so may also lose precision. * @return value cast to a long if numeric * @throws LuaError if not a {@link LuaNumber} or is a {@link LuaString} that can't be converted to number @@ -922,9 +920,9 @@ public class LuaValue extends Varargs { */ public long checklong() { argerror("long"); return 0; } - /** Check that the value is numeric, and return as a LuaNumber if so, or throw {@link LuaError} + /** Check that the value is numeric, and return as a LuaNumber if so, or throw {@link LuaError} *

- * Values that are {@link LuaString} that can be converted to a number will be converted and returned. + * Values that are {@link LuaString} that can be converted to a number will be converted and returned. * @return value as a {@link LuaNumber} if numeric * @throws LuaError if not a {@link LuaNumber} or is a {@link LuaString} that can't be converted to number * @see #checkint() @@ -936,9 +934,9 @@ public class LuaValue extends Varargs { */ public LuaNumber checknumber() { argerror("number"); return null; } - /** Check that the value is numeric, and return as a LuaNumber if so, or throw {@link LuaError} + /** Check that the value is numeric, and return as a LuaNumber if so, or throw {@link LuaError} *

- * Values that are {@link LuaString} that can be converted to a number will be converted and returned. + * Values that are {@link LuaString} that can be converted to a number will be converted and returned. * @param msg String message to supply if conversion fails * @return value as a {@link LuaNumber} if numeric * @throws LuaError if not a {@link LuaNumber} or is a {@link LuaString} that can't be converted to number @@ -953,9 +951,9 @@ public class LuaValue extends Varargs { /** 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. + * 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. * @return String representation of the value * @see #checkstring() * @see #optjstring(String) @@ -967,9 +965,9 @@ public class LuaValue extends Varargs { /** Check that this is a lua string, or throw {@link LuaError} if it is not. *

- * In lua all numbers are strings, so this will succeed for - * anything that derives from {@link LuaString} or {@link LuaNumber}. - * Numbers will be converted to {@link LuaString}. + * In lua all numbers are strings, so this will succeed for + * anything that derives from {@link LuaString} or {@link LuaNumber}. + * Numbers will be converted to {@link LuaString}. * * @return {@link LuaString} representation of the value if it is a {@link LuaString} or {@link LuaNumber} * @throws LuaError if {@code this} is not a {@link LuaTable} @@ -988,7 +986,7 @@ public class LuaValue extends Varargs { * @see #opttable(LuaTable) * @see #TTABLE */ - public LuaTable checktable() { argerror("table"); return null; } + public LuaTable checktable() { argerror("table"); return null; } /** Check that this is a {@link LuaThread}, or throw {@link LuaError} if it is not * @return {@code this} if it is a {@link LuaThread} @@ -1033,14 +1031,14 @@ public class LuaValue extends Varargs { */ public boolean isvalidkey() { return true; } - /** + /** * Throw a {@link LuaError} with a particular message * @param message String providing message details * @throws LuaError in all cases */ public static LuaValue error(String message) { throw new LuaError(message); } - /** + /** * Assert a condition is true, or throw a {@link LuaError} if not * Returns no value when b is true, throws {@link #error(String)} with {@code msg} as argument * and does not return if b is false. @@ -1050,14 +1048,14 @@ public class LuaValue extends Varargs { */ public static void assert_(boolean b,String msg) { if(!b) throw new LuaError(msg); } - /** + /** * Throw a {@link LuaError} indicating an invalid argument was supplied to a function * @param expected String naming the type that was expected * @throws LuaError in all cases */ protected LuaValue argerror(String expected) { throw new LuaError("bad argument: "+expected+" expected, got "+typename()); } - /** + /** * Throw a {@link LuaError} indicating an invalid argument was supplied to a function * @param iarg index of the argument that was invalid, first index is 1 * @param msg String providing information about the invalid argument @@ -1065,41 +1063,41 @@ public class LuaValue extends Varargs { */ public static LuaValue argerror(int iarg,String msg) { throw new LuaError("bad argument #"+iarg+": "+msg); } - /** + /** * Throw a {@link LuaError} indicating an invalid type was supplied to a function * @param expected String naming the type that was expected * @throws LuaError in all cases */ protected LuaValue typerror(String expected) { throw new LuaError(expected+" expected, got "+typename()); } - /** - * Throw a {@link LuaError} indicating an operation is not implemented + /** + * Throw a {@link LuaError} indicating an operation is not implemented * @throws LuaError in all cases */ protected LuaValue unimplemented(String fun) { throw new LuaError("'"+fun+"' not implemented for "+typename()); } - /** - * Throw a {@link LuaError} indicating an illegal operation occurred, + /** + * Throw a {@link LuaError} indicating an illegal operation occurred, * typically involved in managing weak references * @throws LuaError in all cases */ protected LuaValue illegal(String op,String typename) { throw new LuaError("illegal operation '"+op+"' for "+typename); } - /** - * Throw a {@link LuaError} based on the len operator, + /** + * Throw a {@link LuaError} based on the len operator, * typically due to an invalid operand type * @throws LuaError in all cases */ protected LuaValue lenerror() { throw new LuaError("attempt to get length of "+typename()); } - /** - * Throw a {@link LuaError} based on an arithmetic error such as add, or pow, + /** + * Throw a {@link LuaError} based on an arithmetic error such as add, or pow, * typically due to an invalid operand type * @throws LuaError in all cases */ protected LuaValue aritherror() { throw new LuaError("attempt to perform arithmetic on "+typename()); } - /** + /** * Throw a {@link LuaError} based on an arithmetic error such as add, or pow, * typically due to an invalid operand type * @param fun String description of the function that was attempted @@ -1107,7 +1105,7 @@ public class LuaValue extends Varargs { */ protected LuaValue aritherror(String fun) { throw new LuaError("attempt to perform arithmetic '"+fun+"' on "+typename()); } - /** + /** * Throw a {@link LuaError} based on a comparison error such as greater-than or less-than, * typically due to an invalid operand type * @param rhs String description of what was on the right-hand-side of the comparison that resulted in the error. @@ -1115,7 +1113,7 @@ public class LuaValue extends Varargs { */ protected LuaValue compareerror(String rhs) { throw new LuaError("attempt to compare "+typename()+" with "+rhs); } - /** + /** * Throw a {@link LuaError} based on a comparison error such as greater-than or less-than, * typically due to an invalid operand type * @param rhs Right-hand-side of the comparison that resulted in the error. @@ -1127,8 +1125,8 @@ public class LuaValue extends Varargs { * @param key the key to look up, must not be {@link #NIL} or null * @return {@link LuaValue} for that key, or {@link #NIL} if not found and no metatag * @throws LuaError if {@code this} is not a table, - * or there is no {@link #INDEX} metatag, - * or key is {@link #NIL} + * or there is no {@link #INDEX} metatag, + * or key is {@link #NIL} * @see #get(int) * @see #get(String) * @see #rawget(LuaValue) @@ -1139,7 +1137,7 @@ public class LuaValue extends Varargs { * @param key the key to look up * @return {@link LuaValue} for that key, or {@link #NIL} if not found * @throws LuaError if {@code this} is not a table, - * or there is no {@link #INDEX} metatag + * or there is no {@link #INDEX} metatag * @see #get(LuaValue) * @see #rawget(int) */ @@ -1149,7 +1147,7 @@ public class LuaValue extends Varargs { * @param key the key to look up, must not be null * @return {@link LuaValue} for that key, or {@link #NIL} if not found * @throws LuaError if {@code this} is not a table, - * or there is no {@link #INDEX} metatag + * or there is no {@link #INDEX} metatag * @see #get(LuaValue) * @see #rawget(String) */ @@ -1158,57 +1156,57 @@ public class LuaValue extends Varargs { /** Set a value in a table without metatag processing using {@link #NEWINDEX}. * @param key the key to use, must not be {@link #NIL} or null * @param value the value to use, can be {@link #NIL}, must not be null - * @throws LuaError if {@code this} is not a table, + * @throws LuaError if {@code this} is not a table, * or key is {@link #NIL}, - * or there is no {@link #NEWINDEX} metatag + * or there is no {@link #NEWINDEX} metatag */ public void set( LuaValue key, LuaValue value ) { settable(this, key, value); } /** Set a value in a table without metatag processing using {@link #NEWINDEX}. * @param key the key to use * @param value the value to use, can be {@link #NIL}, must not be null - * @throws LuaError if {@code this} is not a table, - * or there is no {@link #NEWINDEX} metatag + * @throws LuaError if {@code this} is not a table, + * or there is no {@link #NEWINDEX} metatag */ public void set( int key, LuaValue value ) { set(LuaInteger.valueOf(key), value ); } /** Set a value in a table without metatag processing using {@link #NEWINDEX}. * @param key the key to use * @param value the value to use, must not be null - * @throws LuaError if {@code this} is not a table, - * or there is no {@link #NEWINDEX} metatag + * @throws LuaError if {@code this} is not a table, + * or there is no {@link #NEWINDEX} metatag */ public void set( int key, String value ) { set(key, valueOf(value) ); } /** Set a value in a table without metatag processing using {@link #NEWINDEX}. * @param key the key to use, must not be {@link #NIL} or null * @param value the value to use, can be {@link #NIL}, must not be null - * @throws LuaError if {@code this} is not a table, - * or there is no {@link #NEWINDEX} metatag + * @throws LuaError if {@code this} is not a table, + * or there is no {@link #NEWINDEX} metatag */ public void set( String key, LuaValue value ) { set(valueOf(key), value ); } /** Set a value in a table without metatag processing using {@link #NEWINDEX}. * @param key the key to use, must not be null * @param value the value to use - * @throws LuaError if {@code this} is not a table, - * or there is no {@link #NEWINDEX} metatag + * @throws LuaError if {@code this} is not a table, + * or there is no {@link #NEWINDEX} metatag */ public void set( String key, double value ) { set(valueOf(key), valueOf(value) ); } /** Set a value in a table without metatag processing using {@link #NEWINDEX}. * @param key the key to use, must not be null * @param value the value to use - * @throws LuaError if {@code this} is not a table, - * or there is no {@link #NEWINDEX} metatag + * @throws LuaError if {@code this} is not a table, + * or there is no {@link #NEWINDEX} metatag */ public void set( String key, int value ) { set(valueOf(key), valueOf(value) ); } /** Set a value in a table without metatag processing using {@link #NEWINDEX}. * @param key the key to use, must not be null * @param value the value to use, must not be null - * @throws LuaError if {@code this} is not a table, - * or there is no {@link #NEWINDEX} metatag + * @throws LuaError if {@code this} is not a table, + * or there is no {@link #NEWINDEX} metatag */ public void set( String key, String value ) { set(valueOf(key), valueOf(value) ); } @@ -1282,24 +1280,24 @@ public class LuaValue extends Varargs { */ public void rawset( String key, String value ) { rawset(valueOf(key),valueOf(value)); } - /** Set list values in a table without invoking metatag processing + /** Set list values in a table without invoking metatag processing *

- * Primarily used internally in response to a SETLIST bytecode. + * Primarily used internally in response to a SETLIST bytecode. * @param key0 the first key to set in the table * @param values the list of values to set - * @throws LuaError if this is not a table. + * @throws LuaError if this is not a table. */ public void rawsetlist( int key0, Varargs values ) { for ( int i=0, n=values.narg(); i - * Primarily used internally in response to a SETLIST bytecode. + * Primarily used internally in response to a SETLIST bytecode. * @param i the number of array slots to preallocate in the table. - * @throws LuaError if this is not a table. + * @throws LuaError if this is not a table. */ public void presize( int i) { typerror("table"); } - /** Find the next key,value pair if {@code this} is a table, + /** Find the next key,value pair if {@code this} is a table, * return {@link #NIL} if there are no more, or throw a {@link LuaError} if not a table. *

* To iterate over all key-value pairs in a table you can use @@ -1312,9 +1310,9 @@ public class LuaValue extends Varargs { * LuaValue v = n.arg(2) * process( k, v ) * }} - * @param index {@link LuaInteger} value identifying a key to start from, + * @param index {@link LuaInteger} value identifying a key to start from, * or {@link #NIL} to start at the beginning - * @return {@link Varargs} containing {key,value} for the next entry, + * @return {@link Varargs} containing {key,value} for the next entry, * or {@link #NIL} if there are no more. * @throws LuaError if {@code this} is not a table, or the supplied key is invalid. * @see LuaTable @@ -1326,7 +1324,7 @@ public class LuaValue extends Varargs { */ public Varargs next(LuaValue index) { return typerror("table"); } - /** Find the next integer-key,value pair if {@code this} is a table, + /** Find the next integer-key,value pair if {@code this} is a table, * return {@link #NIL} if there are no more, or throw a {@link LuaError} if not a table. *

* To iterate over integer keys in a table you can use @@ -1340,9 +1338,9 @@ public class LuaValue extends Varargs { * process( k, v ) * } * } - * @param index {@link LuaInteger} value identifying a key to start from, + * @param index {@link LuaInteger} value identifying a key to start from, * or {@link #NIL} to start at the beginning - * @return {@link Varargs} containing {@code (key,value)} for the next entry, + * @return {@link Varargs} containing {@code (key,value)} for the next entry, * or {@link #NONE} if there are no more. * @throws LuaError if {@code this} is not a table, or the supplied key is invalid. * @see LuaTable @@ -1354,10 +1352,10 @@ public class LuaValue extends Varargs { */ public Varargs inext(LuaValue index) { return typerror("table"); } - /** - * Load a library instance by calling it with and empty string as the modname, - * and this Globals as the environment. This is normally used to iniitalize the - * library instance and which may install itself into these globals. + /** + * Load a library instance by calling it with and empty string as the modname, + * and this Globals as the environment. This is normally used to iniitalize the + * library instance and which may install itself into these globals. * @param library The callable {@link LuaValue} to load into {@code this} * @return {@link LuaValue} returned by the initialization call. */ @@ -1368,12 +1366,12 @@ public class LuaValue extends Varargs { public int narg() { return 1; }; public LuaValue arg1() { return this; } - /** + /** * Get the metatable for this {@link LuaValue} *

- * For {@link LuaTable} and {@link LuaUserdata} instances, - * the metatable returned is this instance metatable. - * For all other types, the class metatable value will be returned. + * For {@link LuaTable} and {@link LuaUserdata} instances, + * the metatable returned is this instance metatable. + * For all other types, the class metatable value will be returned. * @return metatable, or null if it there is none * @see LuaBoolean#s_metatable * @see LuaNumber#s_metatable @@ -1383,11 +1381,11 @@ public class LuaValue extends Varargs { */ public LuaValue getmetatable() { return null; } - /** + /** * Set the metatable for this {@link LuaValue} *

- * For {@link LuaTable} and {@link LuaUserdata} instances, the metatable is per instance. - * For all other types, there is one metatable per type that can be set directly from java + * For {@link LuaTable} and {@link LuaUserdata} instances, the metatable is per instance. + * For all other types, there is one metatable per type that can be set directly from java * @param metatable {@link LuaValue} instance to serve as the metatable, or null to reset it. * @return {@code this} to allow chaining of Java function calls * @see LuaBoolean#s_metatable @@ -1398,21 +1396,21 @@ public class LuaValue extends Varargs { */ public LuaValue setmetatable(LuaValue metatable) { return argerror("table"); } - /** Call {@code this} with 0 arguments, including metatag processing, + /** Call {@code this} with 0 arguments, including metatag processing, * and return only the first return value. *

- * If {@code this} is a {@link LuaFunction}, call it, - * and return only its first return value, dropping any others. - * Otherwise, look for the {@link #CALL} metatag and call that. + * If {@code this} is a {@link LuaFunction}, call it, + * and return only its first return value, dropping any others. + * Otherwise, look for the {@link #CALL} metatag and call that. *

- * If the return value is a {@link Varargs}, only the 1st value will be returned. - * To get multiple values, use {@link #invoke()} instead. + * If the return value is a {@link Varargs}, only the 1st value will be returned. + * To get multiple values, use {@link #invoke()} instead. *

* To call {@code this} as a method call, use {@link #method(LuaValue)} instead. - * + * * @return First return value {@code (this())}, or {@link #NIL} if there were none. - * @throws LuaError if not a function and {@link #CALL} is not defined, - * or the invoked function throws a {@link LuaError} + * @throws LuaError if not a function and {@link #CALL} is not defined, + * or the invoked function throws a {@link LuaError} * or the invoked closure throw a lua {@code error} * @see #call(LuaValue) * @see #call(LuaValue,LuaValue) @@ -1423,22 +1421,22 @@ public class LuaValue extends Varargs { */ public LuaValue call() { return callmt().call(this); } - /** Call {@code this} with 1 argument, including metatag processing, + /** Call {@code this} with 1 argument, including metatag processing, * and return only the first return value. *

- * If {@code this} is a {@link LuaFunction}, call it, - * and return only its first return value, dropping any others. - * Otherwise, look for the {@link #CALL} metatag and call that. + * If {@code this} is a {@link LuaFunction}, call it, + * and return only its first return value, dropping any others. + * Otherwise, look for the {@link #CALL} metatag and call that. *

- * If the return value is a {@link Varargs}, only the 1st value will be returned. - * To get multiple values, use {@link #invoke()} instead. + * If the return value is a {@link Varargs}, only the 1st value will be returned. + * To get multiple values, use {@link #invoke()} instead. *

* To call {@code this} as a method call, use {@link #method(LuaValue)} instead. - * + * * @param arg First argument to supply to the called function * @return First return value {@code (this(arg))}, or {@link #NIL} if there were none. - * @throws LuaError if not a function and {@link #CALL} is not defined, - * or the invoked function throws a {@link LuaError} + * @throws LuaError if not a function and {@link #CALL} is not defined, + * or the invoked function throws a {@link LuaError} * or the invoked closure throw a lua {@code error} * @see #call() * @see #call(LuaValue,LuaValue) @@ -1449,30 +1447,30 @@ public class LuaValue extends Varargs { */ public LuaValue call(LuaValue arg) { return callmt().call(this,arg); } - /** Convenience function which calls a luavalue with a single, string argument. + /** Convenience function which calls a luavalue with a single, string argument. * @param arg String argument to the function. This will be converted to a LuaString. - * @return return value of the invocation. + * @return return value of the invocation. * @see #call(LuaValue) */ public LuaValue call(String arg) { return call(valueOf(arg)); } - /** Call {@code this} with 2 arguments, including metatag processing, + /** Call {@code this} with 2 arguments, including metatag processing, * and return only the first return value. *

- * If {@code this} is a {@link LuaFunction}, call it, - * and return only its first return value, dropping any others. - * Otherwise, look for the {@link #CALL} metatag and call that. + * If {@code this} is a {@link LuaFunction}, call it, + * and return only its first return value, dropping any others. + * Otherwise, look for the {@link #CALL} metatag and call that. *

- * If the return value is a {@link Varargs}, only the 1st value will be returned. - * To get multiple values, use {@link #invoke()} instead. + * If the return value is a {@link Varargs}, only the 1st value will be returned. + * To get multiple values, use {@link #invoke()} instead. *

* To call {@code this} as a method call, use {@link #method(LuaValue)} instead. - * + * * @param arg1 First argument to supply to the called function * @param arg2 Second argument to supply to the called function * @return First return value {@code (this(arg1,arg2))}, or {@link #NIL} if there were none. - * @throws LuaError if not a function and {@link #CALL} is not defined, - * or the invoked function throws a {@link LuaError} + * @throws LuaError if not a function and {@link #CALL} is not defined, + * or the invoked function throws a {@link LuaError} * or the invoked closure throw a lua {@code error} * @see #call() * @see #call(LuaValue) @@ -1483,24 +1481,24 @@ public class LuaValue extends Varargs { */ public LuaValue call(LuaValue arg1, LuaValue arg2) { return callmt().call(this,arg1,arg2); } - /** Call {@code this} with 3 arguments, including metatag processing, + /** Call {@code this} with 3 arguments, including metatag processing, * and return only the first return value. *

- * If {@code this} is a {@link LuaFunction}, call it, - * and return only its first return value, dropping any others. - * Otherwise, look for the {@link #CALL} metatag and call that. + * If {@code this} is a {@link LuaFunction}, call it, + * and return only its first return value, dropping any others. + * Otherwise, look for the {@link #CALL} metatag and call that. *

- * If the return value is a {@link Varargs}, only the 1st value will be returned. - * To get multiple values, use {@link #invoke()} instead. + * If the return value is a {@link Varargs}, only the 1st value will be returned. + * To get multiple values, use {@link #invoke()} instead. *

* To call {@code this} as a method call, use {@link #method(LuaValue)} instead. - * + * * @param arg1 First argument to supply to the called function * @param arg2 Second argument to supply to the called function * @param arg3 Second argument to supply to the called function * @return First return value {@code (this(arg1,arg2,arg3))}, or {@link #NIL} if there were none. - * @throws LuaError if not a function and {@link #CALL} is not defined, - * or the invoked function throws a {@link LuaError} + * @throws LuaError if not a function and {@link #CALL} is not defined, + * or the invoked function throws a {@link LuaError} * or the invoked closure throw a lua {@code error} * @see #call() * @see #call(LuaValue) @@ -1511,23 +1509,23 @@ public class LuaValue extends Varargs { */ public LuaValue call(LuaValue arg1, LuaValue arg2, LuaValue arg3) { return callmt().invoke(new LuaValue[]{this,arg1,arg2,arg3}).arg1(); } - /** Call named method on {@code this} with 0 arguments, including metatag processing, + /** Call named method on {@code this} with 0 arguments, including metatag processing, * and return only the first return value. *

- * Look up {@code this[name]} and if it is a {@link LuaFunction}, - * call it inserting {@code this} as an additional first argument. - * and return only its first return value, dropping any others. - * Otherwise, look for the {@link #CALL} metatag and call that. + * Look up {@code this[name]} and if it is a {@link LuaFunction}, + * call it inserting {@code this} as an additional first argument. + * and return only its first return value, dropping any others. + * Otherwise, look for the {@link #CALL} metatag and call that. *

- * If the return value is a {@link Varargs}, only the 1st value will be returned. - * To get multiple values, use {@link #invoke()} instead. + * If the return value is a {@link Varargs}, only the 1st value will be returned. + * To get multiple values, use {@link #invoke()} instead. *

* To call {@code this} as a plain call, use {@link #call()} instead. - * + * * @param name Name of the method to look up for invocation * @return All values returned from {@code this:name()} as a {@link Varargs} instance - * @throws LuaError if not a function and {@link #CALL} is not defined, - * or the invoked function throws a {@link LuaError} + * @throws LuaError if not a function and {@link #CALL} is not defined, + * or the invoked function throws a {@link LuaError} * or the invoked closure throw a lua {@code error} * @see #call() * @see #invoke() @@ -1537,23 +1535,23 @@ public class LuaValue extends Varargs { */ public LuaValue method(String name) { return this.get(name).call(this); } - /** Call named method on {@code this} with 0 arguments, including metatag processing, + /** Call named method on {@code this} with 0 arguments, including metatag processing, * and return only the first return value. *

- * Look up {@code this[name]} and if it is a {@link LuaFunction}, - * call it inserting {@code this} as an additional first argument, - * and return only its first return value, dropping any others. - * Otherwise, look for the {@link #CALL} metatag and call that. + * Look up {@code this[name]} and if it is a {@link LuaFunction}, + * call it inserting {@code this} as an additional first argument, + * and return only its first return value, dropping any others. + * Otherwise, look for the {@link #CALL} metatag and call that. *

- * If the return value is a {@link Varargs}, only the 1st value will be returned. - * To get multiple values, use {@link #invoke()} instead. + * If the return value is a {@link Varargs}, only the 1st value will be returned. + * To get multiple values, use {@link #invoke()} instead. *

* To call {@code this} as a plain call, use {@link #call()} instead. - * + * * @param name Name of the method to look up for invocation * @return All values returned from {@code this:name()} as a {@link Varargs} instance - * @throws LuaError if not a function and {@link #CALL} is not defined, - * or the invoked function throws a {@link LuaError} + * @throws LuaError if not a function and {@link #CALL} is not defined, + * or the invoked function throws a {@link LuaError} * or the invoked closure throw a lua {@code error} * @see #call() * @see #invoke() @@ -1563,24 +1561,24 @@ public class LuaValue extends Varargs { */ public LuaValue method(LuaValue name) { return this.get(name).call(this); } - /** Call named method on {@code this} with 1 argument, including metatag processing, + /** Call named method on {@code this} with 1 argument, including metatag processing, * and return only the first return value. *

- * Look up {@code this[name]} and if it is a {@link LuaFunction}, - * call it inserting {@code this} as an additional first argument, - * and return only its first return value, dropping any others. - * Otherwise, look for the {@link #CALL} metatag and call that. + * Look up {@code this[name]} and if it is a {@link LuaFunction}, + * call it inserting {@code this} as an additional first argument, + * and return only its first return value, dropping any others. + * Otherwise, look for the {@link #CALL} metatag and call that. *

- * If the return value is a {@link Varargs}, only the 1st value will be returned. - * To get multiple values, use {@link #invoke()} instead. + * If the return value is a {@link Varargs}, only the 1st value will be returned. + * To get multiple values, use {@link #invoke()} instead. *

* To call {@code this} as a plain call, use {@link #call(LuaValue)} instead. - * + * * @param name Name of the method to look up for invocation * @param arg Argument to supply to the method * @return All values returned from {@code this:name(arg)} as a {@link Varargs} instance - * @throws LuaError if not a function and {@link #CALL} is not defined, - * or the invoked function throws a {@link LuaError} + * @throws LuaError if not a function and {@link #CALL} is not defined, + * or the invoked function throws a {@link LuaError} * or the invoked closure throw a lua {@code error} * @see #call(LuaValue) * @see #invoke(Varargs) @@ -1590,24 +1588,24 @@ public class LuaValue extends Varargs { */ public LuaValue method(String name, LuaValue arg) { return this.get(name).call(this,arg); } - /** Call named method on {@code this} with 1 argument, including metatag processing, + /** Call named method on {@code this} with 1 argument, including metatag processing, * and return only the first return value. *

- * Look up {@code this[name]} and if it is a {@link LuaFunction}, - * call it inserting {@code this} as an additional first argument, - * and return only its first return value, dropping any others. - * Otherwise, look for the {@link #CALL} metatag and call that. + * Look up {@code this[name]} and if it is a {@link LuaFunction}, + * call it inserting {@code this} as an additional first argument, + * and return only its first return value, dropping any others. + * Otherwise, look for the {@link #CALL} metatag and call that. *

- * If the return value is a {@link Varargs}, only the 1st value will be returned. - * To get multiple values, use {@link #invoke()} instead. + * If the return value is a {@link Varargs}, only the 1st value will be returned. + * To get multiple values, use {@link #invoke()} instead. *

* To call {@code this} as a plain call, use {@link #call(LuaValue)} instead. - * + * * @param name Name of the method to look up for invocation * @param arg Argument to supply to the method * @return All values returned from {@code this:name(arg)} as a {@link Varargs} instance - * @throws LuaError if not a function and {@link #CALL} is not defined, - * or the invoked function throws a {@link LuaError} + * @throws LuaError if not a function and {@link #CALL} is not defined, + * or the invoked function throws a {@link LuaError} * or the invoked closure throw a lua {@code error} * @see #call(LuaValue) * @see #invoke(Varargs) @@ -1617,25 +1615,25 @@ public class LuaValue extends Varargs { */ public LuaValue method(LuaValue name, LuaValue arg) { return this.get(name).call(this,arg); } - /** Call named method on {@code this} with 2 arguments, including metatag processing, + /** Call named method on {@code this} with 2 arguments, including metatag processing, * and return only the first return value. *

- * Look up {@code this[name]} and if it is a {@link LuaFunction}, - * call it inserting {@code this} as an additional first argument, - * and return only its first return value, dropping any others. - * Otherwise, look for the {@link #CALL} metatag and call that. + * Look up {@code this[name]} and if it is a {@link LuaFunction}, + * call it inserting {@code this} as an additional first argument, + * and return only its first return value, dropping any others. + * Otherwise, look for the {@link #CALL} metatag and call that. *

- * If the return value is a {@link Varargs}, only the 1st value will be returned. - * To get multiple values, use {@link #invoke()} instead. + * If the return value is a {@link Varargs}, only the 1st value will be returned. + * To get multiple values, use {@link #invoke()} instead. *

* To call {@code this} as a plain call, use {@link #call(LuaValue,LuaValue)} instead. - * + * * @param name Name of the method to look up for invocation * @param arg1 First argument to supply to the method * @param arg2 Second argument to supply to the method * @return All values returned from {@code this:name(arg1,arg2)} as a {@link Varargs} instance - * @throws LuaError if not a function and {@link #CALL} is not defined, - * or the invoked function throws a {@link LuaError} + * @throws LuaError if not a function and {@link #CALL} is not defined, + * or the invoked function throws a {@link LuaError} * or the invoked closure throw a lua {@code error} * @see #call(LuaValue,LuaValue) * @see #invoke(LuaValue,Varargs) @@ -1644,25 +1642,25 @@ public class LuaValue extends Varargs { */ public LuaValue method(String name, LuaValue arg1, LuaValue arg2) { return this.get(name).call(this,arg1,arg2); } - /** Call named method on {@code this} with 2 arguments, including metatag processing, + /** Call named method on {@code this} with 2 arguments, including metatag processing, * and return only the first return value. *

- * Look up {@code this[name]} and if it is a {@link LuaFunction}, - * call it inserting {@code this} as an additional first argument, - * and return only its first return value, dropping any others. - * Otherwise, look for the {@link #CALL} metatag and call that. + * Look up {@code this[name]} and if it is a {@link LuaFunction}, + * call it inserting {@code this} as an additional first argument, + * and return only its first return value, dropping any others. + * Otherwise, look for the {@link #CALL} metatag and call that. *

- * If the return value is a {@link Varargs}, only the 1st value will be returned. - * To get multiple values, use {@link #invoke()} instead. + * If the return value is a {@link Varargs}, only the 1st value will be returned. + * To get multiple values, use {@link #invoke()} instead. *

* To call {@code this} as a plain call, use {@link #call(LuaValue,LuaValue)} instead. - * + * * @param name Name of the method to look up for invocation * @param arg1 First argument to supply to the method * @param arg2 Second argument to supply to the method * @return All values returned from {@code this:name(arg1,arg2)} as a {@link Varargs} instance - * @throws LuaError if not a function and {@link #CALL} is not defined, - * or the invoked function throws a {@link LuaError} + * @throws LuaError if not a function and {@link #CALL} is not defined, + * or the invoked function throws a {@link LuaError} * or the invoked closure throw a lua {@code error} * @see #call(LuaValue,LuaValue) * @see #invoke(LuaValue,Varargs) @@ -1671,19 +1669,19 @@ public class LuaValue extends Varargs { */ public LuaValue method(LuaValue name, LuaValue arg1, LuaValue arg2) { return this.get(name).call(this,arg1,arg2); } - /** Call {@code this} with 0 arguments, including metatag processing, + /** Call {@code this} with 0 arguments, including metatag processing, * and retain all return values in a {@link Varargs}. *

- * If {@code this} is a {@link LuaFunction}, call it, and return all values. - * Otherwise, look for the {@link #CALL} metatag and call that. + * If {@code this} is a {@link LuaFunction}, call it, and return all values. + * Otherwise, look for the {@link #CALL} metatag and call that. *

- * To get a particular return value, us {@link Varargs#arg(int)} + * To get a particular return value, us {@link Varargs#arg(int)} *

* To call {@code this} as a method call, use {@link #invokemethod(LuaValue)} instead. - * + * * @return All return values as a {@link Varargs} instance. - * @throws LuaError if not a function and {@link #CALL} is not defined, - * or the invoked function throws a {@link LuaError} + * @throws LuaError if not a function and {@link #CALL} is not defined, + * or the invoked function throws a {@link LuaError} * or the invoked closure throw a lua {@code error} * @see #call() * @see #invoke(Varargs) @@ -1692,20 +1690,20 @@ public class LuaValue extends Varargs { */ public Varargs invoke() { return invoke(NONE); } - /** Call {@code this} with variable arguments, including metatag processing, + /** Call {@code this} with variable arguments, including metatag processing, * and retain all return values in a {@link Varargs}. *

- * If {@code this} is a {@link LuaFunction}, call it, and return all values. - * Otherwise, look for the {@link #CALL} metatag and call that. + * If {@code this} is a {@link LuaFunction}, call it, and return all values. + * Otherwise, look for the {@link #CALL} metatag and call that. *

- * To get a particular return value, us {@link Varargs#arg(int)} + * To get a particular return value, us {@link Varargs#arg(int)} *

* To call {@code this} as a method call, use {@link #invokemethod(LuaValue)} instead. - * + * * @param args Varargs containing the arguments to supply to the called function * @return All return values as a {@link Varargs} instance. - * @throws LuaError if not a function and {@link #CALL} is not defined, - * or the invoked function throws a {@link LuaError} + * @throws LuaError if not a function and {@link #CALL} is not defined, + * or the invoked function throws a {@link LuaError} * or the invoked closure throw a lua {@code error} * @see #varargsOf(LuaValue[]) * @see #call(LuaValue) @@ -1716,21 +1714,21 @@ public class LuaValue extends Varargs { */ public Varargs invoke(Varargs args) { return callmt().invoke(this,args); } - /** Call {@code this} with variable arguments, including metatag processing, + /** Call {@code this} with variable arguments, including metatag processing, * and retain all return values in a {@link Varargs}. *

- * If {@code this} is a {@link LuaFunction}, call it, and return all values. - * Otherwise, look for the {@link #CALL} metatag and call that. + * If {@code this} is a {@link LuaFunction}, call it, and return all values. + * Otherwise, look for the {@link #CALL} metatag and call that. *

- * To get a particular return value, us {@link Varargs#arg(int)} + * To get a particular return value, us {@link Varargs#arg(int)} *

* To call {@code this} as a method call, use {@link #invokemethod(LuaValue,Varargs)} instead. - * + * * @param arg The first argument to supply to the called function * @param varargs Varargs containing the remaining arguments to supply to the called function * @return All return values as a {@link Varargs} instance. - * @throws LuaError if not a function and {@link #CALL} is not defined, - * or the invoked function throws a {@link LuaError} + * @throws LuaError if not a function and {@link #CALL} is not defined, + * or the invoked function throws a {@link LuaError} * or the invoked closure throw a lua {@code error} * @see #varargsOf(LuaValue[]) * @see #call(LuaValue,LuaValue) @@ -1740,22 +1738,22 @@ public class LuaValue extends Varargs { */ public Varargs invoke(LuaValue arg,Varargs varargs) { return invoke(varargsOf(arg,varargs)); } - /** Call {@code this} with variable arguments, including metatag processing, + /** Call {@code this} with variable arguments, including metatag processing, * and retain all return values in a {@link Varargs}. *

- * If {@code this} is a {@link LuaFunction}, call it, and return all values. - * Otherwise, look for the {@link #CALL} metatag and call that. + * If {@code this} is a {@link LuaFunction}, call it, and return all values. + * Otherwise, look for the {@link #CALL} metatag and call that. *

- * To get a particular return value, us {@link Varargs#arg(int)} + * To get a particular return value, us {@link Varargs#arg(int)} *

* To call {@code this} as a method call, use {@link #invokemethod(LuaValue,Varargs)} instead. - * + * * @param arg1 The first argument to supply to the called function * @param arg2 The second argument to supply to the called function * @param varargs Varargs containing the remaining arguments to supply to the called function * @return All return values as a {@link Varargs} instance. - * @throws LuaError if not a function and {@link #CALL} is not defined, - * or the invoked function throws a {@link LuaError} + * @throws LuaError if not a function and {@link #CALL} is not defined, + * or the invoked function throws a {@link LuaError} * or the invoked closure throw a lua {@code error} * @see #varargsOf(LuaValue[]) * @see #call(LuaValue,LuaValue,LuaValue) @@ -1765,20 +1763,20 @@ public class LuaValue extends Varargs { */ public Varargs invoke(LuaValue arg1,LuaValue arg2,Varargs varargs) { return invoke(varargsOf(arg1,arg2,varargs)); } - /** Call {@code this} with variable arguments, including metatag processing, + /** Call {@code this} with variable arguments, including metatag processing, * and retain all return values in a {@link Varargs}. *

- * If {@code this} is a {@link LuaFunction}, call it, and return all values. - * Otherwise, look for the {@link #CALL} metatag and call that. + * If {@code this} is a {@link LuaFunction}, call it, and return all values. + * Otherwise, look for the {@link #CALL} metatag and call that. *

- * To get a particular return value, us {@link Varargs#arg(int)} + * To get a particular return value, us {@link Varargs#arg(int)} *

* To call {@code this} as a method call, use {@link #invokemethod(LuaValue,Varargs)} instead. - * + * * @param args Array of arguments to supply to the called function * @return All return values as a {@link Varargs} instance. - * @throws LuaError if not a function and {@link #CALL} is not defined, - * or the invoked function throws a {@link LuaError} + * @throws LuaError if not a function and {@link #CALL} is not defined, + * or the invoked function throws a {@link LuaError} * or the invoked closure throw a lua {@code error} * @see #varargsOf(LuaValue[]) * @see #call(LuaValue,LuaValue,LuaValue) @@ -1788,21 +1786,21 @@ public class LuaValue extends Varargs { */ public Varargs invoke(LuaValue[] args) { return invoke(varargsOf(args)); } - /** Call {@code this} with variable arguments, including metatag processing, + /** Call {@code this} with variable arguments, including metatag processing, * and retain all return values in a {@link Varargs}. *

- * If {@code this} is a {@link LuaFunction}, call it, and return all values. - * Otherwise, look for the {@link #CALL} metatag and call that. + * If {@code this} is a {@link LuaFunction}, call it, and return all values. + * Otherwise, look for the {@link #CALL} metatag and call that. *

- * To get a particular return value, us {@link Varargs#arg(int)} + * To get a particular return value, us {@link Varargs#arg(int)} *

* To call {@code this} as a method call, use {@link #invokemethod(LuaValue,Varargs)} instead. - * + * * @param args Array of arguments to supply to the called function * @param varargs Varargs containing additional arguments to supply to the called function * @return All return values as a {@link Varargs} instance. - * @throws LuaError if not a function and {@link #CALL} is not defined, - * or the invoked function throws a {@link LuaError} + * @throws LuaError if not a function and {@link #CALL} is not defined, + * or the invoked function throws a {@link LuaError} * or the invoked closure throw a lua {@code error} * @see #varargsOf(LuaValue[]) * @see #call(LuaValue,LuaValue,LuaValue) @@ -1814,22 +1812,22 @@ public class LuaValue extends Varargs { */ public Varargs invoke(LuaValue[] args,Varargs varargs) { return invoke(varargsOf(args,varargs)); } - /** Call named method on {@code this} with 0 arguments, including metatag processing, + /** Call named method on {@code this} with 0 arguments, including metatag processing, * and retain all return values in a {@link Varargs}. *

- * Look up {@code this[name]} and if it is a {@link LuaFunction}, - * call it inserting {@code this} as an additional first argument, - * and return all return values as a {@link Varargs} instance. - * Otherwise, look for the {@link #CALL} metatag and call that. + * Look up {@code this[name]} and if it is a {@link LuaFunction}, + * call it inserting {@code this} as an additional first argument, + * and return all return values as a {@link Varargs} instance. + * Otherwise, look for the {@link #CALL} metatag and call that. *

- * To get a particular return value, us {@link Varargs#arg(int)} + * To get a particular return value, us {@link Varargs#arg(int)} *

* To call {@code this} as a plain call, use {@link #invoke()} instead. - * + * * @param name Name of the method to look up for invocation * @return All values returned from {@code this:name()} as a {@link Varargs} instance - * @throws LuaError if not a function and {@link #CALL} is not defined, - * or the invoked function throws a {@link LuaError} + * @throws LuaError if not a function and {@link #CALL} is not defined, + * or the invoked function throws a {@link LuaError} * or the invoked closure throw a lua {@code error} * @see #call() * @see #invoke() @@ -1842,22 +1840,22 @@ public class LuaValue extends Varargs { */ public Varargs invokemethod(String name) { return get(name).invoke(this); } - /** Call named method on {@code this} with 0 arguments, including metatag processing, + /** Call named method on {@code this} with 0 arguments, including metatag processing, * and retain all return values in a {@link Varargs}. *

- * Look up {@code this[name]} and if it is a {@link LuaFunction}, - * call it inserting {@code this} as an additional first argument, - * and return all return values as a {@link Varargs} instance. - * Otherwise, look for the {@link #CALL} metatag and call that. + * Look up {@code this[name]} and if it is a {@link LuaFunction}, + * call it inserting {@code this} as an additional first argument, + * and return all return values as a {@link Varargs} instance. + * Otherwise, look for the {@link #CALL} metatag and call that. *

- * To get a particular return value, us {@link Varargs#arg(int)} + * To get a particular return value, us {@link Varargs#arg(int)} *

* To call {@code this} as a plain call, use {@link #invoke()} instead. - * + * * @param name Name of the method to look up for invocation * @return All values returned from {@code this:name()} as a {@link Varargs} instance - * @throws LuaError if not a function and {@link #CALL} is not defined, - * or the invoked function throws a {@link LuaError} + * @throws LuaError if not a function and {@link #CALL} is not defined, + * or the invoked function throws a {@link LuaError} * or the invoked closure throw a lua {@code error} * @see #call() * @see #invoke() @@ -1870,23 +1868,23 @@ public class LuaValue extends Varargs { */ public Varargs invokemethod(LuaValue name) { return get(name).invoke(this); } - /** Call named method on {@code this} with 1 argument, including metatag processing, + /** Call named method on {@code this} with 1 argument, including metatag processing, * and retain all return values in a {@link Varargs}. *

- * Look up {@code this[name]} and if it is a {@link LuaFunction}, - * call it inserting {@code this} as an additional first argument, - * and return all return values as a {@link Varargs} instance. - * Otherwise, look for the {@link #CALL} metatag and call that. + * Look up {@code this[name]} and if it is a {@link LuaFunction}, + * call it inserting {@code this} as an additional first argument, + * and return all return values as a {@link Varargs} instance. + * Otherwise, look for the {@link #CALL} metatag and call that. *

- * To get a particular return value, us {@link Varargs#arg(int)} + * To get a particular return value, us {@link Varargs#arg(int)} *

* To call {@code this} as a plain call, use {@link #invoke(Varargs)} instead. - * + * * @param name Name of the method to look up for invocation - * @param args {@link Varargs} containing arguments to supply to the called function after {@code this} + * @param args {@link Varargs} containing arguments to supply to the called function after {@code this} * @return All values returned from {@code this:name(args)} as a {@link Varargs} instance - * @throws LuaError if not a function and {@link #CALL} is not defined, - * or the invoked function throws a {@link LuaError} + * @throws LuaError if not a function and {@link #CALL} is not defined, + * or the invoked function throws a {@link LuaError} * or the invoked closure throw a lua {@code error} * @see #call() * @see #invoke(Varargs) @@ -1899,23 +1897,23 @@ public class LuaValue extends Varargs { */ public Varargs invokemethod(String name, Varargs args) { return get(name).invoke(varargsOf(this,args)); } - /** Call named method on {@code this} with variable arguments, including metatag processing, + /** Call named method on {@code this} with variable arguments, including metatag processing, * and retain all return values in a {@link Varargs}. *

- * Look up {@code this[name]} and if it is a {@link LuaFunction}, - * call it inserting {@code this} as an additional first argument, - * and return all return values as a {@link Varargs} instance. - * Otherwise, look for the {@link #CALL} metatag and call that. + * Look up {@code this[name]} and if it is a {@link LuaFunction}, + * call it inserting {@code this} as an additional first argument, + * and return all return values as a {@link Varargs} instance. + * Otherwise, look for the {@link #CALL} metatag and call that. *

- * To get a particular return value, us {@link Varargs#arg(int)} + * To get a particular return value, us {@link Varargs#arg(int)} *

* To call {@code this} as a plain call, use {@link #invoke(Varargs)} instead. - * + * * @param name Name of the method to look up for invocation - * @param args {@link Varargs} containing arguments to supply to the called function after {@code this} + * @param args {@link Varargs} containing arguments to supply to the called function after {@code this} * @return All values returned from {@code this:name(args)} as a {@link Varargs} instance - * @throws LuaError if not a function and {@link #CALL} is not defined, - * or the invoked function throws a {@link LuaError} + * @throws LuaError if not a function and {@link #CALL} is not defined, + * or the invoked function throws a {@link LuaError} * or the invoked closure throw a lua {@code error} * @see #call() * @see #invoke(Varargs) @@ -1928,23 +1926,23 @@ public class LuaValue extends Varargs { */ public Varargs invokemethod(LuaValue name, Varargs args) { return get(name).invoke(varargsOf(this,args)); } - /** Call named method on {@code this} with 1 argument, including metatag processing, + /** Call named method on {@code this} with 1 argument, including metatag processing, * and retain all return values in a {@link Varargs}. *

- * Look up {@code this[name]} and if it is a {@link LuaFunction}, - * call it inserting {@code this} as an additional first argument, - * and return all return values as a {@link Varargs} instance. - * Otherwise, look for the {@link #CALL} metatag and call that. + * Look up {@code this[name]} and if it is a {@link LuaFunction}, + * call it inserting {@code this} as an additional first argument, + * and return all return values as a {@link Varargs} instance. + * Otherwise, look for the {@link #CALL} metatag and call that. *

- * To get a particular return value, us {@link Varargs#arg(int)} + * To get a particular return value, us {@link Varargs#arg(int)} *

* To call {@code this} as a plain call, use {@link #invoke(Varargs)} instead. - * + * * @param name Name of the method to look up for invocation - * @param args Array of {@link LuaValue} containing arguments to supply to the called function after {@code this} + * @param args Array of {@link LuaValue} containing arguments to supply to the called function after {@code this} * @return All values returned from {@code this:name(args)} as a {@link Varargs} instance - * @throws LuaError if not a function and {@link #CALL} is not defined, - * or the invoked function throws a {@link LuaError} + * @throws LuaError if not a function and {@link #CALL} is not defined, + * or the invoked function throws a {@link LuaError} * or the invoked closure throw a lua {@code error} * @see #call() * @see #invoke(Varargs) @@ -1958,23 +1956,23 @@ public class LuaValue extends Varargs { */ public Varargs invokemethod(String name, LuaValue[] args) { return get(name).invoke(varargsOf(this,varargsOf(args))); } - /** Call named method on {@code this} with variable arguments, including metatag processing, + /** Call named method on {@code this} with variable arguments, including metatag processing, * and retain all return values in a {@link Varargs}. *

- * Look up {@code this[name]} and if it is a {@link LuaFunction}, - * call it inserting {@code this} as an additional first argument, - * and return all return values as a {@link Varargs} instance. - * Otherwise, look for the {@link #CALL} metatag and call that. + * Look up {@code this[name]} and if it is a {@link LuaFunction}, + * call it inserting {@code this} as an additional first argument, + * and return all return values as a {@link Varargs} instance. + * Otherwise, look for the {@link #CALL} metatag and call that. *

- * To get a particular return value, us {@link Varargs#arg(int)} + * To get a particular return value, us {@link Varargs#arg(int)} *

* To call {@code this} as a plain call, use {@link #invoke(Varargs)} instead. - * + * * @param name Name of the method to look up for invocation - * @param args Array of {@link LuaValue} containing arguments to supply to the called function after {@code this} + * @param args Array of {@link LuaValue} containing arguments to supply to the called function after {@code this} * @return All values returned from {@code this:name(args)} as a {@link Varargs} instance - * @throws LuaError if not a function and {@link #CALL} is not defined, - * or the invoked function throws a {@link LuaError} + * @throws LuaError if not a function and {@link #CALL} is not defined, + * or the invoked function throws a {@link LuaError} * or the invoked closure throw a lua {@code error} * @see #call() * @see #invoke(Varargs) @@ -1991,33 +1989,33 @@ public class LuaValue extends Varargs { /** * Get the metatag value for the {@link #CALL} metatag, if it exists. * @return {@link LuaValue} value if metatag is defined - * @throws LuaError if {@link #CALL} metatag is not defined. + * @throws LuaError if {@link #CALL} metatag is not defined. */ protected LuaValue callmt() { return checkmetatag(CALL, "attempt to call "); } - /** Unary not: return inverse boolean value {@code (~this)} as defined by lua not operator - * @return {@link #TRUE} if {@link #NIL} or {@link #FALSE}, otherwise {@link #FALSE} + /** Unary not: return inverse boolean value {@code (~this)} as defined by lua not operator + * @return {@link #TRUE} if {@link #NIL} or {@link #FALSE}, otherwise {@link #FALSE} */ public LuaValue not() { return FALSE; } - /** Unary minus: return negative value {@code (-this)} as defined by lua unary minus operator - * @return boolean inverse as {@link LuaBoolean} if boolean or nil, - * numeric inverse as {@link LuaNumber} if numeric, + /** Unary minus: return negative value {@code (-this)} as defined by lua unary minus operator + * @return boolean inverse as {@link LuaBoolean} if boolean or nil, + * numeric inverse as {@link LuaNumber} if numeric, * or metatag processing result if {@link #UNM} metatag is defined * @throws LuaError if {@code this} is not a table or string, and has no {@link #UNM} metatag */ public LuaValue neg() { return checkmetatag(UNM, "attempt to perform arithmetic on ").call(this); } - /** Length operator: return lua length of object {@code (#this)} including metatag processing as java int + /** Length operator: return lua length of object {@code (#this)} including metatag processing as java int * @return length as defined by the lua # operator * or metatag processing result * @throws LuaError if {@code this} is not a table or string, and has no {@link #LEN} metatag */ public LuaValue len() { return checkmetatag(LEN, "attempt to get length of ").call(this); } - /** Length operator: return lua length of object {@code (#this)} including metatag processing as java int + /** Length operator: return lua length of object {@code (#this)} including metatag processing as java int * @return length as defined by the lua # operator * or metatag processing result converted to java int using {@link #toint()} * @throws LuaError if {@code this} is not a table or string, and has no {@link #LEN} metatag @@ -2031,14 +2029,14 @@ public class LuaValue extends Varargs { public int rawlen() { typerror("table or string"); return 0; } // object equality, used for key comparison - public boolean equals(Object obj) { return this == obj; } + public boolean equals(Object obj) { return this == obj; } - /** Equals: Perform equality comparison with another value + /** Equals: Perform equality comparison with another value * including metatag processing using {@link #EQ}. * @param val The value to compare with. - * @return {@link #TRUE} if values are comparable and {@code (this == rhs)}, - * {@link #FALSE} if comparable but not equal, - * {@link LuaValue} if metatag processing occurs. + * @return {@link #TRUE} if values are comparable and {@code (this == rhs)}, + * {@link #FALSE} if comparable but not equal, + * {@link LuaValue} if metatag processing occurs. * @see #eq_b(LuaValue) * @see #raweq(LuaValue) * @see #neq(LuaValue) @@ -2047,27 +2045,27 @@ public class LuaValue extends Varargs { */ public LuaValue eq( LuaValue val ) { return eq_b(val)? TRUE: FALSE; } - /** Equals: Perform equality comparison with another value - * including metatag processing using {@link #EQ}, + /** Equals: Perform equality comparison with another value + * including metatag processing using {@link #EQ}, * and return java boolean * @param val The value to compare with. - * @return true if values are comparable and {@code (this == rhs)}, - * false if comparable but not equal, - * result converted to java boolean if metatag processing occurs. + * @return true if values are comparable and {@code (this == rhs)}, + * false if comparable but not equal, + * result converted to java boolean if metatag processing occurs. * @see #eq(LuaValue) * @see #raweq(LuaValue) * @see #neq_b(LuaValue) * @see #eqmtcall(LuaValue, LuaValue, LuaValue, LuaValue) * @see #EQ */ - public boolean eq_b( LuaValue val ) { return this == val; } + public boolean eq_b( LuaValue val ) { return this == val; } - /** Notquals: Perform inequality comparison with another value + /** Notquals: Perform inequality comparison with another value * including metatag processing using {@link #EQ}. * @param val The value to compare with. - * @return {@link #TRUE} if values are comparable and {@code (this != rhs)}, - * {@link #FALSE} if comparable but equal, - * inverse of {@link LuaValue} converted to {@link LuaBoolean} if metatag processing occurs. + * @return {@link #TRUE} if values are comparable and {@code (this != rhs)}, + * {@link #FALSE} if comparable but equal, + * inverse of {@link LuaValue} converted to {@link LuaBoolean} if metatag processing occurs. * @see #eq(LuaValue) * @see #raweq(LuaValue) * @see #eqmtcall(LuaValue, LuaValue, LuaValue, LuaValue) @@ -2075,12 +2073,12 @@ public class LuaValue extends Varargs { */ public LuaValue neq( LuaValue val ) { return eq_b(val)? FALSE: TRUE; } - /** Notquals: Perform inequality comparison with another value + /** Notquals: Perform inequality comparison with another value * including metatag processing using {@link #EQ}. * @param val The value to compare with. - * @return true if values are comparable and {@code (this != rhs)}, - * false if comparable but equal, - * inverse of result converted to boolean if metatag processing occurs. + * @return true if values are comparable and {@code (this != rhs)}, + * false if comparable but equal, + * inverse of result converted to boolean if metatag processing occurs. * @see #eq_b(LuaValue) * @see #raweq(LuaValue) * @see #eqmtcall(LuaValue, LuaValue, LuaValue, LuaValue) @@ -2088,10 +2086,10 @@ public class LuaValue extends Varargs { */ public boolean neq_b( LuaValue val ) { return !eq_b(val); } - /** Equals: Perform direct equality comparison with another value + /** Equals: Perform direct equality comparison with another value * without metatag processing. * @param val The value to compare with. - * @return true if {@code (this == rhs)}, false otherwise + * @return true if {@code (this == rhs)}, false otherwise * @see #eq(LuaValue) * @see #raweq(LuaUserdata) * @see #raweq(LuaString) @@ -2101,52 +2099,52 @@ public class LuaValue extends Varargs { */ public boolean raweq( LuaValue val ) { return this == val; } - /** Equals: Perform direct equality comparison with a {@link LuaUserdata} value + /** Equals: Perform direct equality comparison with a {@link LuaUserdata} value * without metatag processing. * @param val The {@link LuaUserdata} to compare with. - * @return true if {@code this} is userdata - * and their metatables are the same using == + * @return true if {@code this} is userdata + * and their metatables are the same using == * and their instances are equal using {@link #equals(Object)}, - * otherwise false + * otherwise false * @see #eq(LuaValue) * @see #raweq(LuaValue) */ public boolean raweq( LuaUserdata val ) { return false; } - /** Equals: Perform direct equality comparison with a {@link LuaString} value + /** Equals: Perform direct equality comparison with a {@link LuaString} value * without metatag processing. * @param val The {@link LuaString} to compare with. - * @return true if {@code this} is a {@link LuaString} + * @return true if {@code this} is a {@link LuaString} * and their byte sequences match, - * otherwise false + * otherwise false */ public boolean raweq( LuaString val ) { return false; } - /** Equals: Perform direct equality comparison with a double value + /** Equals: Perform direct equality comparison with a double value * without metatag processing. * @param val The double value to compare with. - * @return true if {@code this} is a {@link LuaNumber} + * @return true if {@code this} is a {@link LuaNumber} * whose value equals val, - * otherwise false + * otherwise false */ public boolean raweq( double val ) { return false; } - /** Equals: Perform direct equality comparison with a int value + /** Equals: Perform direct equality comparison with a int value * without metatag processing. * @param val The double value to compare with. - * @return true if {@code this} is a {@link LuaNumber} + * @return true if {@code this} is a {@link LuaNumber} * whose value equals val, - * otherwise false + * otherwise false */ public boolean raweq( int val ) { return false; } - /** Perform equality testing metatag processing + /** Perform equality testing metatag processing * @param lhs left-hand-side of equality expression * @param lhsmt metatag value for left-hand-side - * @param rhs right-hand-side of equality expression + * @param rhs right-hand-side of equality expression * @param rhsmt metatag value for right-hand-side * @return true if metatag processing result is not {@link #NIL} or {@link #FALSE} - * @throws LuaError if metatag was not defined for either operand + * @throws LuaError if metatag was not defined for either operand * @see #equals(Object) * @see #eq(LuaValue) * @see #raweq(LuaValue) @@ -2157,105 +2155,105 @@ public class LuaValue extends Varargs { return h.isnil() || h!=rhsmt.rawget(EQ)? false: h.call(lhs,rhs).toboolean(); } - /** Add: Perform numeric add operation with another value + /** Add: Perform numeric add operation with another value * including metatag processing. *

* Each operand must derive from {@link LuaNumber} * or derive from {@link LuaString} and be convertible to a number * * @param rhs The right-hand-side value to perform the add with - * @return value of {@code (this + rhs)} if both are numeric, - * or {@link LuaValue} if metatag processing occurs - * @throws LuaError if either operand is not a number or string convertible to number, - * and neither has the {@link #ADD} metatag defined + * @return value of {@code (this + rhs)} if both are numeric, + * or {@link LuaValue} if metatag processing occurs + * @throws LuaError if either operand is not a number or string convertible to number, + * and neither has the {@link #ADD} metatag defined * @see #arithmt(LuaValue, LuaValue) */ public LuaValue add( LuaValue rhs ) { return arithmt(ADD,rhs); } - /** Add: Perform numeric add operation with another value + /** Add: Perform numeric add operation with another value * of double type with metatag processing *

* {@code this} must derive from {@link LuaNumber} * or derive from {@link LuaString} and be convertible to a number * * @param rhs The right-hand-side value to perform the add with - * @return value of {@code (this + rhs)} if this is numeric - * @throws LuaError if {@code this} is not a number or string convertible to number + * @return value of {@code (this + rhs)} if this is numeric + * @throws LuaError if {@code this} is not a number or string convertible to number * @see #add(LuaValue) */ public LuaValue add(double rhs) { return arithmtwith(ADD,rhs); } - /** Add: Perform numeric add operation with another value + /** Add: Perform numeric add operation with another value * of int type with metatag processing *

* {@code this} must derive from {@link LuaNumber} * or derive from {@link LuaString} and be convertible to a number * * @param rhs The right-hand-side value to perform the add with - * @return value of {@code (this + rhs)} if this is numeric - * @throws LuaError if {@code this} is not a number or string convertible to number + * @return value of {@code (this + rhs)} if this is numeric + * @throws LuaError if {@code this} is not a number or string convertible to number * @see #add(LuaValue) */ public LuaValue add(int rhs) { return add((double)rhs); } - /** Subtract: Perform numeric subtract operation with another value - * of unknown type, + /** Subtract: Perform numeric subtract operation with another value + * of unknown type, * including metatag processing. *

* Each operand must derive from {@link LuaNumber} * or derive from {@link LuaString} and be convertible to a number * * @param rhs The right-hand-side value to perform the subtract with - * @return value of {@code (this - rhs)} if both are numeric, - * or {@link LuaValue} if metatag processing occurs - * @throws LuaError if either operand is not a number or string convertible to number, - * and neither has the {@link #SUB} metatag defined + * @return value of {@code (this - rhs)} if both are numeric, + * or {@link LuaValue} if metatag processing occurs + * @throws LuaError if either operand is not a number or string convertible to number, + * and neither has the {@link #SUB} metatag defined * @see #arithmt(LuaValue, LuaValue) */ public LuaValue sub( LuaValue rhs ) { return arithmt(SUB,rhs); } - /** Subtract: Perform numeric subtract operation with another value + /** Subtract: Perform numeric subtract operation with another value * of double type with metatag processing *

* {@code this} must derive from {@link LuaNumber} * or derive from {@link LuaString} and be convertible to a number * * @param rhs The right-hand-side value to perform the subtract with - * @return value of {@code (this - rhs)} if this is numeric - * @throws LuaError if {@code this} is not a number or string convertible to number + * @return value of {@code (this - rhs)} if this is numeric + * @throws LuaError if {@code this} is not a number or string convertible to number * @see #sub(LuaValue) */ public LuaValue sub( double rhs ) { return aritherror("sub"); } - /** Subtract: Perform numeric subtract operation with another value + /** Subtract: Perform numeric subtract operation with another value * of int type with metatag processing *

* {@code this} must derive from {@link LuaNumber} * or derive from {@link LuaString} and be convertible to a number * * @param rhs The right-hand-side value to perform the subtract with - * @return value of {@code (this - rhs)} if this is numeric - * @throws LuaError if {@code this} is not a number or string convertible to number + * @return value of {@code (this - rhs)} if this is numeric + * @throws LuaError if {@code this} is not a number or string convertible to number * @see #sub(LuaValue) */ public LuaValue sub( int rhs ) { return aritherror("sub"); } - /** Reverse-subtract: Perform numeric subtract operation from an int value + /** Reverse-subtract: Perform numeric subtract operation from an int value * with metatag processing *

* {@code this} must derive from {@link LuaNumber} * or derive from {@link LuaString} and be convertible to a number * * @param lhs The left-hand-side value from which to perform the subtraction - * @return value of {@code (lhs - this)} if this is numeric - * @throws LuaError if {@code this} is not a number or string convertible to number + * @return value of {@code (lhs - this)} if this is numeric + * @throws LuaError if {@code this} is not a number or string convertible to number * @see #sub(LuaValue) * @see #sub(double) * @see #sub(int) */ public LuaValue subFrom(double lhs) { return arithmtwith(SUB,lhs); } - /** Reverse-subtract: Perform numeric subtract operation from a double value + /** Reverse-subtract: Perform numeric subtract operation from a double value * without metatag processing *

* {@code this} must derive from {@link LuaNumber} @@ -2264,144 +2262,144 @@ public class LuaValue extends Varargs { * For metatag processing {@link #sub(LuaValue)} must be used * * @param lhs The left-hand-side value from which to perform the subtraction - * @return value of {@code (lhs - this)} if this is numeric - * @throws LuaError if {@code this} is not a number or string convertible to number + * @return value of {@code (lhs - this)} if this is numeric + * @throws LuaError if {@code this} is not a number or string convertible to number * @see #sub(LuaValue) * @see #sub(double) * @see #sub(int) */ public LuaValue subFrom(int lhs) { return subFrom((double)lhs); } - /** Multiply: Perform numeric multiply operation with another value - * of unknown type, + /** Multiply: Perform numeric multiply operation with another value + * of unknown type, * including metatag processing. *

* Each operand must derive from {@link LuaNumber} * or derive from {@link LuaString} and be convertible to a number * * @param rhs The right-hand-side value to perform the multiply with - * @return value of {@code (this * rhs)} if both are numeric, - * or {@link LuaValue} if metatag processing occurs - * @throws LuaError if either operand is not a number or string convertible to number, - * and neither has the {@link #MUL} metatag defined + * @return value of {@code (this * rhs)} if both are numeric, + * or {@link LuaValue} if metatag processing occurs + * @throws LuaError if either operand is not a number or string convertible to number, + * and neither has the {@link #MUL} metatag defined * @see #arithmt(LuaValue, LuaValue) */ public LuaValue mul( LuaValue rhs ) { return arithmt(MUL,rhs); } - /** Multiply: Perform numeric multiply operation with another value + /** Multiply: Perform numeric multiply operation with another value * of double type with metatag processing *

* {@code this} must derive from {@link LuaNumber} * or derive from {@link LuaString} and be convertible to a number * * @param rhs The right-hand-side value to perform the multiply with - * @return value of {@code (this * rhs)} if this is numeric - * @throws LuaError if {@code this} is not a number or string convertible to number + * @return value of {@code (this * rhs)} if this is numeric + * @throws LuaError if {@code this} is not a number or string convertible to number * @see #mul(LuaValue) */ public LuaValue mul(double rhs) { return arithmtwith(MUL,rhs); } - /** Multiply: Perform numeric multiply operation with another value + /** Multiply: Perform numeric multiply operation with another value * of int type with metatag processing *

* {@code this} must derive from {@link LuaNumber} * or derive from {@link LuaString} and be convertible to a number * * @param rhs The right-hand-side value to perform the multiply with - * @return value of {@code (this * rhs)} if this is numeric - * @throws LuaError if {@code this} is not a number or string convertible to number + * @return value of {@code (this * rhs)} if this is numeric + * @throws LuaError if {@code this} is not a number or string convertible to number * @see #mul(LuaValue) */ public LuaValue mul(int rhs) { return mul((double)rhs); } - /** Raise to power: Raise this value to a power + /** Raise to power: Raise this value to a power * including metatag processing. *

* Each operand must derive from {@link LuaNumber} * or derive from {@link LuaString} and be convertible to a number * * @param rhs The power to raise this value to - * @return value of {@code (this ^ rhs)} if both are numeric, - * or {@link LuaValue} if metatag processing occurs - * @throws LuaError if either operand is not a number or string convertible to number, - * and neither has the {@link #POW} metatag defined + * @return value of {@code (this ^ rhs)} if both are numeric, + * or {@link LuaValue} if metatag processing occurs + * @throws LuaError if either operand is not a number or string convertible to number, + * and neither has the {@link #POW} metatag defined * @see #arithmt(LuaValue, LuaValue) */ public LuaValue pow( LuaValue rhs ) { return arithmt(POW,rhs); } - /** Raise to power: Raise this value to a power + /** Raise to power: Raise this value to a power * of double type with metatag processing *

* {@code this} must derive from {@link LuaNumber} * or derive from {@link LuaString} and be convertible to a number * * @param rhs The power to raise this value to - * @return value of {@code (this ^ rhs)} if this is numeric - * @throws LuaError if {@code this} is not a number or string convertible to number + * @return value of {@code (this ^ rhs)} if this is numeric + * @throws LuaError if {@code this} is not a number or string convertible to number * @see #pow(LuaValue) */ public LuaValue pow( double rhs ) { return aritherror("pow"); } - /** Raise to power: Raise this value to a power + /** Raise to power: Raise this value to a power * of int type with metatag processing *

* {@code this} must derive from {@link LuaNumber} * or derive from {@link LuaString} and be convertible to a number * * @param rhs The power to raise this value to - * @return value of {@code (this ^ rhs)} if this is numeric - * @throws LuaError if {@code this} is not a number or string convertible to number + * @return value of {@code (this ^ rhs)} if this is numeric + * @throws LuaError if {@code this} is not a number or string convertible to number * @see #pow(LuaValue) */ public LuaValue pow( int rhs ) { return aritherror("pow"); } - /** Reverse-raise to power: Raise another value of double type to this power + /** Reverse-raise to power: Raise another value of double type to this power * with metatag processing *

* {@code this} must derive from {@link LuaNumber} * or derive from {@link LuaString} and be convertible to a number * * @param lhs The left-hand-side value which will be raised to this power - * @return value of {@code (lhs ^ this)} if this is numeric - * @throws LuaError if {@code this} is not a number or string convertible to number + * @return value of {@code (lhs ^ this)} if this is numeric + * @throws LuaError if {@code this} is not a number or string convertible to number * @see #pow(LuaValue) * @see #pow(double) * @see #pow(int) */ public LuaValue powWith(double lhs) { return arithmtwith(POW,lhs); } - /** Reverse-raise to power: Raise another value of double type to this power + /** Reverse-raise to power: Raise another value of double type to this power * with metatag processing *

* {@code this} must derive from {@link LuaNumber} * or derive from {@link LuaString} and be convertible to a number * * @param lhs The left-hand-side value which will be raised to this power - * @return value of {@code (lhs ^ this)} if this is numeric - * @throws LuaError if {@code this} is not a number or string convertible to number + * @return value of {@code (lhs ^ this)} if this is numeric + * @throws LuaError if {@code this} is not a number or string convertible to number * @see #pow(LuaValue) * @see #pow(double) * @see #pow(int) */ public LuaValue powWith(int lhs) { return powWith((double)lhs); } - /** Divide: Perform numeric divide operation by another value - * of unknown type, + /** Divide: Perform numeric divide operation by another value + * of unknown type, * including metatag processing. *

* Each operand must derive from {@link LuaNumber} * or derive from {@link LuaString} and be convertible to a number * * @param rhs The right-hand-side value to perform the divulo with - * @return value of {@code (this / rhs)} if both are numeric, - * or {@link LuaValue} if metatag processing occurs - * @throws LuaError if either operand is not a number or string convertible to number, - * and neither has the {@link #DIV} metatag defined + * @return value of {@code (this / rhs)} if both are numeric, + * or {@link LuaValue} if metatag processing occurs + * @throws LuaError if either operand is not a number or string convertible to number, + * and neither has the {@link #DIV} metatag defined * @see #arithmt(LuaValue, LuaValue) */ public LuaValue div( LuaValue rhs ) { return arithmt(DIV,rhs); } - /** Divide: Perform numeric divide operation by another value + /** Divide: Perform numeric divide operation by another value * of double type without metatag processing *

* {@code this} must derive from {@link LuaNumber} @@ -2410,13 +2408,13 @@ public class LuaValue extends Varargs { * For metatag processing {@link #div(LuaValue)} must be used * * @param rhs The right-hand-side value to perform the divulo with - * @return value of {@code (this / rhs)} if this is numeric - * @throws LuaError if {@code this} is not a number or string convertible to number + * @return value of {@code (this / rhs)} if this is numeric + * @throws LuaError if {@code this} is not a number or string convertible to number * @see #div(LuaValue) */ public LuaValue div( double rhs ) { return aritherror("div"); } - /** Divide: Perform numeric divide operation by another value + /** Divide: Perform numeric divide operation by another value * of int type without metatag processing *

* {@code this} must derive from {@link LuaNumber} @@ -2425,44 +2423,44 @@ public class LuaValue extends Varargs { * For metatag processing {@link #div(LuaValue)} must be used * * @param rhs The right-hand-side value to perform the divulo with - * @return value of {@code (this / rhs)} if this is numeric - * @throws LuaError if {@code this} is not a number or string convertible to number + * @return value of {@code (this / rhs)} if this is numeric + * @throws LuaError if {@code this} is not a number or string convertible to number * @see #div(LuaValue) */ public LuaValue div( int rhs ) { return aritherror("div"); } - /** Reverse-divide: Perform numeric divide operation into another value + /** Reverse-divide: Perform numeric divide operation into another value * with metatag processing *

* {@code this} must derive from {@link LuaNumber} * or derive from {@link LuaString} and be convertible to a number * * @param lhs The left-hand-side value which will be divided by this - * @return value of {@code (lhs / this)} if this is numeric - * @throws LuaError if {@code this} is not a number or string convertible to number + * @return value of {@code (lhs / this)} if this is numeric + * @throws LuaError if {@code this} is not a number or string convertible to number * @see #div(LuaValue) * @see #div(double) * @see #div(int) */ public LuaValue divInto(double lhs) { return arithmtwith(DIV,lhs); } - /** Modulo: Perform numeric modulo operation with another value - * of unknown type, + /** Modulo: Perform numeric modulo operation with another value + * of unknown type, * including metatag processing. *

* Each operand must derive from {@link LuaNumber} * or derive from {@link LuaString} and be convertible to a number * * @param rhs The right-hand-side value to perform the modulo with - * @return value of {@code (this % rhs)} if both are numeric, - * or {@link LuaValue} if metatag processing occurs - * @throws LuaError if either operand is not a number or string convertible to number, - * and neither has the {@link #MOD} metatag defined + * @return value of {@code (this % rhs)} if both are numeric, + * or {@link LuaValue} if metatag processing occurs + * @throws LuaError if either operand is not a number or string convertible to number, + * and neither has the {@link #MOD} metatag defined * @see #arithmt(LuaValue, LuaValue) */ public LuaValue mod( LuaValue rhs ) { return arithmt(MOD,rhs); } - /** Modulo: Perform numeric modulo operation with another value + /** Modulo: Perform numeric modulo operation with another value * of double type without metatag processing *

* {@code this} must derive from {@link LuaNumber} @@ -2471,13 +2469,13 @@ public class LuaValue extends Varargs { * For metatag processing {@link #mod(LuaValue)} must be used * * @param rhs The right-hand-side value to perform the modulo with - * @return value of {@code (this % rhs)} if this is numeric - * @throws LuaError if {@code this} is not a number or string convertible to number + * @return value of {@code (this % rhs)} if this is numeric + * @throws LuaError if {@code this} is not a number or string convertible to number * @see #mod(LuaValue) */ public LuaValue mod( double rhs ) { return aritherror("mod"); } - /** Modulo: Perform numeric modulo operation with another value + /** Modulo: Perform numeric modulo operation with another value * of int type without metatag processing *

* {@code this} must derive from {@link LuaNumber} @@ -2486,35 +2484,35 @@ public class LuaValue extends Varargs { * For metatag processing {@link #mod(LuaValue)} must be used * * @param rhs The right-hand-side value to perform the modulo with - * @return value of {@code (this % rhs)} if this is numeric - * @throws LuaError if {@code this} is not a number or string convertible to number + * @return value of {@code (this % rhs)} if this is numeric + * @throws LuaError if {@code this} is not a number or string convertible to number * @see #mod(LuaValue) */ public LuaValue mod( int rhs ) { return aritherror("mod"); } - /** Reverse-modulo: Perform numeric modulo operation from another value + /** Reverse-modulo: Perform numeric modulo operation from another value * with metatag processing *

* {@code this} must derive from {@link LuaNumber} * or derive from {@link LuaString} and be convertible to a number * * @param lhs The left-hand-side value which will be modulo'ed by this - * @return value of {@code (lhs % this)} if this is numeric - * @throws LuaError if {@code this} is not a number or string convertible to number + * @return value of {@code (lhs % this)} if this is numeric + * @throws LuaError if {@code this} is not a number or string convertible to number * @see #mod(LuaValue) * @see #mod(double) * @see #mod(int) */ public LuaValue modFrom(double lhs) { return arithmtwith(MOD,lhs); } - /** Perform metatag processing for arithmetic operations. + /** Perform metatag processing for arithmetic operations. *

- * Finds the supplied metatag value for {@code this} or {@code op2} and invokes it, - * or throws {@link LuaError} if neither is defined. + * Finds the supplied metatag value for {@code this} or {@code op2} and invokes it, + * or throws {@link LuaError} if neither is defined. * @param tag The metatag to look up * @param op2 The other operand value to perform the operation with * @return {@link LuaValue} resulting from metatag processing - * @throws LuaError if metatag was not defined for either operand + * @throws LuaError if metatag was not defined for either operand * @see #add(LuaValue) * @see #sub(LuaValue) * @see #mul(LuaValue) @@ -2538,14 +2536,14 @@ public class LuaValue extends Varargs { return h.call( this, op2 ); } - /** Perform metatag processing for arithmetic operations when the left-hand-side is a number. + /** Perform metatag processing for arithmetic operations when the left-hand-side is a number. *

- * Finds the supplied metatag value for {@code this} and invokes it, - * or throws {@link LuaError} if neither is defined. + * Finds the supplied metatag value for {@code this} and invokes it, + * or throws {@link LuaError} if neither is defined. * @param tag The metatag to look up * @param op1 The value of the left-hand-side to perform the operation with * @return {@link LuaValue} resulting from metatag processing - * @throws LuaError if metatag was not defined for either operand + * @throws LuaError if metatag was not defined for either operand * @see #add(LuaValue) * @see #sub(LuaValue) * @see #mul(LuaValue) @@ -2566,16 +2564,16 @@ public class LuaValue extends Varargs { return h.call( LuaValue.valueOf(op1), this ); } - /** Less than: Perform numeric or string comparison with another value - * of unknown type, + /** Less than: Perform numeric or string comparison with another value + * of unknown type, * including metatag processing, and returning {@link LuaValue}. *

* To be comparable, both operands must derive from {@link LuaString} - * or both must derive from {@link LuaNumber}. + * or both must derive from {@link LuaNumber}. * * @param rhs The right-hand-side value to perform the comparison with - * @return {@link #TRUE} if {@code (this < rhs)}, {@link #FALSE} if not, - * or {@link LuaValue} if metatag processing occurs + * @return {@link #TRUE} if {@code (this < rhs)}, {@link #FALSE} if not, + * or {@link LuaValue} if metatag processing occurs * @throws LuaError if either both operands are not a strings or both are not numbers * and no {@link #LT} metatag is defined. * @see #gteq_b(LuaValue) @@ -2583,15 +2581,15 @@ public class LuaValue extends Varargs { */ public LuaValue lt( LuaValue rhs ) { return comparemt(LT,rhs); } - /** Less than: Perform numeric comparison with another value - * of double type, + /** Less than: Perform numeric comparison with another value + * of double type, * including metatag processing, and returning {@link LuaValue}. *

- * To be comparable, this must derive from {@link LuaNumber}. + * To be comparable, this must derive from {@link LuaNumber}. * * @param rhs The right-hand-side value to perform the comparison with - * @return {@link #TRUE} if {@code (this < rhs)}, {@link #FALSE} if not, - * or {@link LuaValue} if metatag processing occurs + * @return {@link #TRUE} if {@code (this < rhs)}, {@link #FALSE} if not, + * or {@link LuaValue} if metatag processing occurs * @throws LuaError if this is not a number * and no {@link #LT} metatag is defined. * @see #gteq_b(double) @@ -2599,15 +2597,15 @@ public class LuaValue extends Varargs { */ public LuaValue lt( double rhs ) { return compareerror("number"); } - /** Less than: Perform numeric comparison with another value - * of int type, + /** Less than: Perform numeric comparison with another value + * of int type, * including metatag processing, and returning {@link LuaValue}. *

- * To be comparable, this must derive from {@link LuaNumber}. + * To be comparable, this must derive from {@link LuaNumber}. * * @param rhs The right-hand-side value to perform the comparison with - * @return {@link #TRUE} if {@code (this < rhs)}, {@link #FALSE} if not, - * or {@link LuaValue} if metatag processing occurs + * @return {@link #TRUE} if {@code (this < rhs)}, {@link #FALSE} if not, + * or {@link LuaValue} if metatag processing occurs * @throws LuaError if this is not a number * and no {@link #LT} metatag is defined. * @see #gteq_b(int) @@ -2615,15 +2613,15 @@ public class LuaValue extends Varargs { */ public LuaValue lt( int rhs ) { return compareerror("number"); } - /** Less than: Perform numeric or string comparison with another value - * of unknown type, including metatag processing, + /** 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 {@link LuaString} - * or both must derive from {@link LuaNumber}. + * or both must derive from {@link LuaNumber}. * * @param rhs The right-hand-side value to perform the comparison with - * @return true if {@code (this < rhs)}, false if not, + * @return true if {@code (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 {@link #LT} metatag is defined. @@ -2632,15 +2630,15 @@ public class LuaValue extends Varargs { */ public boolean lt_b( LuaValue rhs ) { return comparemt(LT,rhs).toboolean(); } - /** Less than: Perform numeric comparison with another value - * of int type, - * including metatag processing, + /** 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 {@link LuaNumber}. + * To be comparable, this must derive from {@link LuaNumber}. * * @param rhs The right-hand-side value to perform the comparison with - * @return true if {@code (this < rhs)}, false if not, + * @return true if {@code (this < rhs)}, false if not, * and boolean interpreation of result if metatag processing occurs. * @throws LuaError if this is not a number * and no {@link #LT} metatag is defined. @@ -2649,15 +2647,15 @@ public class LuaValue extends Varargs { */ public boolean lt_b( int rhs ) { compareerror("number"); return false; } - /** Less than: Perform numeric or string comparison with another value - * of unknown type, including metatag processing, + /** 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 {@link LuaString} - * or both must derive from {@link LuaNumber}. + * or both must derive from {@link LuaNumber}. * * @param rhs The right-hand-side value to perform the comparison with - * @return true if {@code (this < rhs)}, false if not, + * @return true if {@code (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 {@link #LT} metatag is defined. @@ -2666,16 +2664,16 @@ public class LuaValue extends Varargs { */ public boolean lt_b( double rhs ) { compareerror("number"); return false; } - /** Less than or equals: Perform numeric or string comparison with another value - * of unknown type, + /** Less than or equals: Perform numeric or string comparison with another value + * of unknown type, * including metatag processing, and returning {@link LuaValue}. *

* To be comparable, both operands must derive from {@link LuaString} - * or both must derive from {@link LuaNumber}. + * or both must derive from {@link LuaNumber}. * * @param rhs The right-hand-side value to perform the comparison with - * @return {@link #TRUE} if {@code (this <= rhs)}, {@link #FALSE} if not, - * or {@link LuaValue} if metatag processing occurs + * @return {@link #TRUE} if {@code (this <= rhs)}, {@link #FALSE} if not, + * or {@link LuaValue} if metatag processing occurs * @throws LuaError if either both operands are not a strings or both are not numbers * and no {@link #LE} metatag is defined. * @see #gteq_b(LuaValue) @@ -2683,15 +2681,15 @@ public class LuaValue extends Varargs { */ public LuaValue lteq( LuaValue rhs ) { return comparemt(LE,rhs); } - /** Less than or equals: Perform numeric comparison with another value - * of double type, + /** Less than or equals: Perform numeric comparison with another value + * of double type, * including metatag processing, and returning {@link LuaValue}. *

- * To be comparable, this must derive from {@link LuaNumber}. + * To be comparable, this must derive from {@link LuaNumber}. * * @param rhs The right-hand-side value to perform the comparison with - * @return {@link #TRUE} if {@code (this <= rhs)}, {@link #FALSE} if not, - * or {@link LuaValue} if metatag processing occurs + * @return {@link #TRUE} if {@code (this <= rhs)}, {@link #FALSE} if not, + * or {@link LuaValue} if metatag processing occurs * @throws LuaError if this is not a number * and no {@link #LE} metatag is defined. * @see #gteq_b(double) @@ -2699,15 +2697,15 @@ public class LuaValue extends Varargs { */ public LuaValue lteq( double rhs ) { return compareerror("number"); } - /** Less than or equals: Perform numeric comparison with another value - * of int type, + /** Less than or equals: Perform numeric comparison with another value + * of int type, * including metatag processing, and returning {@link LuaValue}. *

- * To be comparable, this must derive from {@link LuaNumber}. + * To be comparable, this must derive from {@link LuaNumber}. * * @param rhs The right-hand-side value to perform the comparison with - * @return {@link #TRUE} if {@code (this <= rhs)}, {@link #FALSE} if not, - * or {@link LuaValue} if metatag processing occurs + * @return {@link #TRUE} if {@code (this <= rhs)}, {@link #FALSE} if not, + * or {@link LuaValue} if metatag processing occurs * @throws LuaError if this is not a number * and no {@link #LE} metatag is defined. * @see #gteq_b(int) @@ -2715,15 +2713,15 @@ public class LuaValue extends Varargs { */ public LuaValue lteq( int rhs ) { return compareerror("number"); } - /** Less than or equals: Perform numeric or string comparison with another value - * of unknown type, including metatag processing, + /** 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 {@link LuaString} - * or both must derive from {@link LuaNumber}. + * or both must derive from {@link LuaNumber}. * * @param rhs The right-hand-side value to perform the comparison with - * @return true if {@code (this <= rhs)}, false if not, + * @return true if {@code (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 {@link #LE} metatag is defined. @@ -2732,15 +2730,15 @@ public class LuaValue extends Varargs { */ public boolean lteq_b( LuaValue rhs ) { return comparemt(LE,rhs).toboolean(); } - /** Less than or equals: Perform numeric comparison with another value - * of int type, - * including metatag processing, + /** 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 {@link LuaNumber}. + * To be comparable, this must derive from {@link LuaNumber}. * * @param rhs The right-hand-side value to perform the comparison with - * @return true if {@code (this <= rhs)}, false if not, + * @return true if {@code (this <= rhs)}, false if not, * and boolean interpreation of result if metatag processing occurs. * @throws LuaError if this is not a number * and no {@link #LE} metatag is defined. @@ -2749,15 +2747,15 @@ public class LuaValue extends Varargs { */ public boolean lteq_b( int rhs ) { compareerror("number"); return false; } - /** Less than or equals: Perform numeric comparison with another value - * of double type, - * including metatag processing, + /** 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 {@link LuaNumber}. + * To be comparable, this must derive from {@link LuaNumber}. * * @param rhs The right-hand-side value to perform the comparison with - * @return true if {@code (this <= rhs)}, false if not, + * @return true if {@code (this <= rhs)}, false if not, * and boolean interpreation of result if metatag processing occurs. * @throws LuaError if this is not a number * and no {@link #LE} metatag is defined. @@ -2766,16 +2764,16 @@ public class LuaValue extends Varargs { */ public boolean lteq_b( double rhs ) { compareerror("number"); return false; } - /** Greater than: Perform numeric or string comparison with another value - * of unknown type, + /** Greater than: Perform numeric or string comparison with another value + * of unknown type, * including metatag processing, and returning {@link LuaValue}. *

* To be comparable, both operands must derive from {@link LuaString} - * or both must derive from {@link LuaNumber}. + * or both must derive from {@link LuaNumber}. * * @param rhs The right-hand-side value to perform the comparison with - * @return {@link #TRUE} if {@code (this > rhs)}, {@link #FALSE} if not, - * or {@link LuaValue} if metatag processing occurs + * @return {@link #TRUE} if {@code (this > rhs)}, {@link #FALSE} if not, + * or {@link LuaValue} if metatag processing occurs * @throws LuaError if either both operands are not a strings or both are not numbers * and no {@link #LE} metatag is defined. * @see #gteq_b(LuaValue) @@ -2783,15 +2781,15 @@ public class LuaValue extends Varargs { */ public LuaValue gt( LuaValue rhs ) { return rhs.comparemt(LE,this); } - /** Greater than: Perform numeric comparison with another value - * of double type, + /** Greater than: Perform numeric comparison with another value + * of double type, * including metatag processing, and returning {@link LuaValue}. *

- * To be comparable, this must derive from {@link LuaNumber}. + * To be comparable, this must derive from {@link LuaNumber}. * * @param rhs The right-hand-side value to perform the comparison with - * @return {@link #TRUE} if {@code (this > rhs)}, {@link #FALSE} if not, - * or {@link LuaValue} if metatag processing occurs + * @return {@link #TRUE} if {@code (this > rhs)}, {@link #FALSE} if not, + * or {@link LuaValue} if metatag processing occurs * @throws LuaError if this is not a number * and no {@link #LE} metatag is defined. * @see #gteq_b(double) @@ -2799,15 +2797,15 @@ public class LuaValue extends Varargs { */ public LuaValue gt( double rhs ) { return compareerror("number"); } - /** Greater than: Perform numeric comparison with another value - * of int type, + /** Greater than: Perform numeric comparison with another value + * of int type, * including metatag processing, and returning {@link LuaValue}. *

- * To be comparable, this must derive from {@link LuaNumber}. + * To be comparable, this must derive from {@link LuaNumber}. * * @param rhs The right-hand-side value to perform the comparison with - * @return {@link #TRUE} if {@code (this > rhs)}, {@link #FALSE} if not, - * or {@link LuaValue} if metatag processing occurs + * @return {@link #TRUE} if {@code (this > rhs)}, {@link #FALSE} if not, + * or {@link LuaValue} if metatag processing occurs * @throws LuaError if this is not a number * and no {@link #LE} metatag is defined. * @see #gteq_b(int) @@ -2815,15 +2813,15 @@ public class LuaValue extends Varargs { */ public LuaValue gt( int rhs ) { return compareerror("number"); } - /** Greater than: Perform numeric or string comparison with another value - * of unknown type, including metatag processing, + /** 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 {@link LuaString} - * or both must derive from {@link LuaNumber}. + * or both must derive from {@link LuaNumber}. * * @param rhs The right-hand-side value to perform the comparison with - * @return true if {@code (this > rhs)}, false if not, + * @return true if {@code (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 {@link #LE} metatag is defined. @@ -2832,15 +2830,15 @@ public class LuaValue extends Varargs { */ public boolean gt_b( LuaValue rhs ) { return rhs.comparemt(LE,this).toboolean(); } - /** Greater than: Perform numeric comparison with another value - * of int type, - * including metatag processing, + /** 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 {@link LuaNumber}. + * To be comparable, this must derive from {@link LuaNumber}. * * @param rhs The right-hand-side value to perform the comparison with - * @return true if {@code (this > rhs)}, false if not, + * @return true if {@code (this > rhs)}, false if not, * and boolean interpreation of result if metatag processing occurs. * @throws LuaError if this is not a number * and no {@link #LE} metatag is defined. @@ -2849,15 +2847,15 @@ public class LuaValue extends Varargs { */ public boolean gt_b( int rhs ) { compareerror("number"); return false; } - /** Greater than: Perform numeric or string comparison with another value - * of unknown type, including metatag processing, + /** 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 {@link LuaString} - * or both must derive from {@link LuaNumber}. + * or both must derive from {@link LuaNumber}. * * @param rhs The right-hand-side value to perform the comparison with - * @return true if {@code (this > rhs)}, false if not, + * @return true if {@code (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 {@link #LE} metatag is defined. @@ -2866,16 +2864,16 @@ public class LuaValue extends Varargs { */ public boolean gt_b( double rhs ) { compareerror("number"); return false; } - /** Greater than or equals: Perform numeric or string comparison with another value - * of unknown type, + /** Greater than or equals: Perform numeric or string comparison with another value + * of unknown type, * including metatag processing, and returning {@link LuaValue}. *

* To be comparable, both operands must derive from {@link LuaString} - * or both must derive from {@link LuaNumber}. + * or both must derive from {@link LuaNumber}. * * @param rhs The right-hand-side value to perform the comparison with - * @return {@link #TRUE} if {@code (this >= rhs)}, {@link #FALSE} if not, - * or {@link LuaValue} if metatag processing occurs + * @return {@link #TRUE} if {@code (this >= rhs)}, {@link #FALSE} if not, + * or {@link LuaValue} if metatag processing occurs * @throws LuaError if either both operands are not a strings or both are not numbers * and no {@link #LT} metatag is defined. * @see #gteq_b(LuaValue) @@ -2883,15 +2881,15 @@ public class LuaValue extends Varargs { */ public LuaValue gteq( LuaValue rhs ) { return rhs.comparemt(LT,this); } - /** Greater than or equals: Perform numeric comparison with another value - * of double type, + /** Greater than or equals: Perform numeric comparison with another value + * of double type, * including metatag processing, and returning {@link LuaValue}. *

- * To be comparable, this must derive from {@link LuaNumber}. + * To be comparable, this must derive from {@link LuaNumber}. * * @param rhs The right-hand-side value to perform the comparison with - * @return {@link #TRUE} if {@code (this >= rhs)}, {@link #FALSE} if not, - * or {@link LuaValue} if metatag processing occurs + * @return {@link #TRUE} if {@code (this >= rhs)}, {@link #FALSE} if not, + * or {@link LuaValue} if metatag processing occurs * @throws LuaError if this is not a number * and no {@link #LT} metatag is defined. * @see #gteq_b(double) @@ -2899,15 +2897,15 @@ public class LuaValue extends Varargs { */ public LuaValue gteq( double rhs ) { return compareerror("number"); } - /** Greater than or equals: Perform numeric comparison with another value - * of int type, + /** Greater than or equals: Perform numeric comparison with another value + * of int type, * including metatag processing, and returning {@link LuaValue}. *

- * To be comparable, this must derive from {@link LuaNumber}. + * To be comparable, this must derive from {@link LuaNumber}. * * @param rhs The right-hand-side value to perform the comparison with - * @return {@link #TRUE} if {@code (this >= rhs)}, {@link #FALSE} if not, - * or {@link LuaValue} if metatag processing occurs + * @return {@link #TRUE} if {@code (this >= rhs)}, {@link #FALSE} if not, + * or {@link LuaValue} if metatag processing occurs * @throws LuaError if this is not a number * and no {@link #LT} metatag is defined. * @see #gteq_b(int) @@ -2915,15 +2913,15 @@ public class LuaValue extends Varargs { */ public LuaValue gteq( int rhs ) { return valueOf(todouble() >= rhs); } - /** Greater than or equals: Perform numeric or string comparison with another value - * of unknown type, including metatag processing, + /** 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 {@link LuaString} - * or both must derive from {@link LuaNumber}. + * or both must derive from {@link LuaNumber}. * * @param rhs The right-hand-side value to perform the comparison with - * @return true if {@code (this >= rhs)}, false if not, + * @return true if {@code (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 {@link #LT} metatag is defined. @@ -2932,15 +2930,15 @@ public class LuaValue extends Varargs { */ public boolean gteq_b( LuaValue rhs ) { return rhs.comparemt(LT,this).toboolean(); } - /** Greater than or equals: Perform numeric comparison with another value - * of int type, - * including metatag processing, + /** 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 {@link LuaNumber}. + * To be comparable, this must derive from {@link LuaNumber}. * * @param rhs The right-hand-side value to perform the comparison with - * @return true if {@code (this >= rhs)}, false if not, + * @return true if {@code (this >= rhs)}, false if not, * and boolean interpreation of result if metatag processing occurs. * @throws LuaError if this is not a number * and no {@link #LT} metatag is defined. @@ -2949,15 +2947,15 @@ public class LuaValue extends Varargs { */ public boolean gteq_b( int rhs ) { compareerror("number"); return false; } - /** Greater than or equals: Perform numeric comparison with another value - * of double type, - * including metatag processing, + /** 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 {@link LuaNumber}. + * To be comparable, this must derive from {@link LuaNumber}. * * @param rhs The right-hand-side value to perform the comparison with - * @return true if {@code (this >= rhs)}, false if not, + * @return true if {@code (this >= rhs)}, false if not, * and boolean interpreation of result if metatag processing occurs. * @throws LuaError if this is not a number * and no {@link #LT} metatag is defined. @@ -2966,22 +2964,22 @@ public class LuaValue extends Varargs { */ public boolean gteq_b( double rhs ) { compareerror("number"); return false; } - /** Perform metatag processing for comparison operations. + /** Perform metatag processing for comparison operations. *

- * Finds the supplied metatag value and invokes it, - * or throws {@link LuaError} if none applies. + * Finds the supplied metatag value and invokes it, + * or throws {@link LuaError} if none applies. * @param tag The metatag to look up * @param op1 The operand with which to to perform the operation * @return {@link 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. + * @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 #gt(LuaValue) * @see #gteq(LuaValue) * @see #lt(LuaValue) * @see #lteq(LuaValue) */ - public LuaValue comparemt( LuaValue tag, LuaValue op1 ) { + public LuaValue comparemt( LuaValue tag, LuaValue op1 ) { LuaValue h; if (!(h = metatag(tag)).isnil() || !(h = op1.metatag(tag)).isnil()) return h.call(this, op1); @@ -2990,116 +2988,116 @@ public class LuaValue extends Varargs { return error("attempt to compare "+tag+" on "+typename()+" and "+op1.typename()); } - /** Perform string comparison with another value - * of any type + /** 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 {@link LuaString}. + * Only strings can be compared, meaning + * each operand must derive from {@link LuaString}. * * @param rhs The right-hand-side value to perform the comparison with - * @return int < 0 for {@code (this < rhs)}, int > 0 for {@code (this > rhs)}, or 0 when same string. + * @return int < 0 for {@code (this < rhs)}, int > 0 for {@code (this > rhs)}, or 0 when same string. * @throws LuaError if either operand is not a string */ public int strcmp( LuaValue rhs ) { error("attempt to compare "+typename()); return 0; } - /** Perform string comparison with another value - * known to be a {@link LuaString} + /** Perform string comparison with another value + * known to be a {@link LuaString} * using string comparison based on byte values. *

- * Only strings can be compared, meaning - * each operand must derive from {@link LuaString}. + * Only strings can be compared, meaning + * each operand must derive from {@link LuaString}. * * @param rhs The right-hand-side value to perform the comparison with - * @return int < 0 for {@code (this < rhs)}, int > 0 for {@code (this > rhs)}, or 0 when same string. + * @return int < 0 for {@code (this < rhs)}, int > 0 for {@code (this > rhs)}, or 0 when same string. * @throws LuaError if this is not a string */ public int strcmp( LuaString rhs ) { error("attempt to compare "+typename()); return 0; } - /** Concatenate another value onto this value and return the result + /** 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 {@link LuaString} or {@link LuaNumber}. + * Only strings and numbers as represented can be concatenated, meaning + * each operand must derive from {@link LuaString} or {@link LuaNumber}. * * @param rhs The right-hand-side value to perform the operation with * @return {@link LuaValue} resulting from concatenation of {@code (this .. rhs)} - * @throws LuaError if either operand is not of an appropriate type, + * @throws LuaError if either operand is not of an appropriate type, * such as nil or a table */ public LuaValue concat(LuaValue rhs) { return this.concatmt(rhs); } - /** 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. + /** 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 {@link LuaString} or {@link LuaNumber}. + * Only strings and numbers as represented can be concatenated, meaning + * each operand must derive from {@link LuaString} or {@link LuaNumber}. * * @param lhs The left-hand-side value onto which this will be concatenated * @return {@link LuaValue} resulting from concatenation of {@code (lhs .. this)} - * @throws LuaError if either operand is not of an appropriate type, + * @throws LuaError if either operand is not of an appropriate type, * such as nil or a table * @see #concat(LuaValue) */ public LuaValue concatTo(LuaValue lhs) { return lhs.concatmt(this); } - /** Reverse-concatenation: concatenate this value onto another value - * known to be a {@link LuaNumber} - * and return the result using rules of lua string concatenation including - * metatag processing. + /** Reverse-concatenation: concatenate this value onto another value + * known to be a {@link 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 {@link LuaString} or {@link LuaNumber}. + * Only strings and numbers as represented can be concatenated, meaning + * each operand must derive from {@link LuaString} or {@link LuaNumber}. * * @param lhs The left-hand-side value onto which this will be concatenated * @return {@link LuaValue} resulting from concatenation of {@code (lhs .. this)} - * @throws LuaError if either operand is not of an appropriate type, + * @throws LuaError if either operand is not of an appropriate type, * such as nil or a table * @see #concat(LuaValue) */ public LuaValue concatTo(LuaNumber lhs) { return lhs.concatmt(this); } - /** Reverse-concatenation: concatenate this value onto another value - * known to be a {@link LuaString} - * and return the result using rules of lua string concatenation including - * metatag processing. + /** Reverse-concatenation: concatenate this value onto another value + * known to be a {@link 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 {@link LuaString} or {@link LuaNumber}. + * Only strings and numbers as represented can be concatenated, meaning + * each operand must derive from {@link LuaString} or {@link LuaNumber}. * * @param lhs The left-hand-side value onto which this will be concatenated * @return {@link LuaValue} resulting from concatenation of {@code (lhs .. this)} - * @throws LuaError if either operand is not of an appropriate type, + * @throws LuaError if either operand is not of an appropriate type, * such as nil or a table * @see #concat(LuaValue) */ public LuaValue concatTo(LuaString lhs) { return lhs.concatmt(this); } - /** Convert the value to a {@link Buffer} for more efficient concatenation of - * multiple strings. + /** Convert the value to a {@link Buffer} for more efficient concatenation of + * multiple strings. * @return Buffer instance containing the string or number */ public Buffer buffer() { return new Buffer(this); } - /** Concatenate a {@link Buffer} onto this value and return the result + /** Concatenate a {@link 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 {@link LuaString} or {@link LuaNumber}. + * Only strings and numbers as represented can be concatenated, meaning + * each operand must derive from {@link LuaString} or {@link LuaNumber}. * * @param rhs The right-hand-side {@link Buffer} to perform the operation with * @return LuaString resulting from concatenation of {@code (this .. rhs)} - * @throws LuaError if either operand is not of an appropriate type, + * @throws LuaError if either operand is not of an appropriate type, * such as nil or a table */ public Buffer concat(Buffer rhs) { return rhs.concatTo(this); } - /** Perform metatag processing for concatenation operations. + /** Perform metatag processing for concatenation operations. *

- * Finds the {@link #CONCAT} metatag value and invokes it, - * or throws {@link LuaError} if it doesn't exist. + * Finds the {@link #CONCAT} metatag value and invokes it, + * or throws {@link LuaError} if it doesn't exist. * @param rhs The right-hand-side value to perform the operation with * @return {@link LuaValue} resulting from metatag processing for {@link #CONCAT} metatag. * @throws LuaError if metatag was not defined for either operand @@ -3123,22 +3121,22 @@ public class LuaValue extends Varargs { * This returns either {@code this} or {@code rhs} depending on the boolean value for {@code this}. * * @param rhs The right-hand-side value to perform the operation with - * @return {@code this} if {@code this.toboolean()} is true, {@code rhs} otherwise. + * @return {@code this} if {@code this.toboolean()} is true, {@code rhs} otherwise. */ public LuaValue or( LuaValue rhs ) { return this.toboolean()? this: rhs; } - /** Perform end-condition test in for-loop processing. + /** Perform end-condition test in for-loop processing. *

* Used in lua-bytecode to Java-bytecode conversion. * * @param limit the numerical limit to complete the for loop - * @param step the numberical step size to use. + * @param step the numberical step size to use. * @return true if limit has not been reached, false otherwise. */ public boolean testfor_b(LuaValue limit, LuaValue step) { return step.gt_b(0)? lteq_b(limit): gteq_b(limit); } /** - * Convert this value to a string if it is a {@link LuaString} or {@link LuaNumber}, + * Convert this value to a string if it is a {@link LuaString} or {@link LuaNumber}, * or throw a {@link LuaError} if it is not * @return {@link LuaString} corresponding to the value if a string or number * @throws LuaError if not a string or number @@ -3165,9 +3163,9 @@ public class LuaValue extends Varargs { */ public static LuaInteger valueOf(int i) { return LuaInteger.valueOf(i); } - /** Convert java double to a {@link LuaValue}. - * This may return a {@link LuaInteger} or {@link LuaDouble} depending - * on the value supplied. + /** Convert java double to a {@link LuaValue}. + * This may return a {@link LuaInteger} or {@link LuaDouble} depending + * on the value supplied. * * @param d double value to convert * @return {@link LuaNumber} instance, possibly pooled, whose value is d @@ -3195,86 +3193,86 @@ public class LuaValue extends Varargs { * @param len number of bytes to include in the {@link LuaString} * @return {@link LuaString} instance, possibly pooled, whose bytes are those in the supplied array */ - public static LuaString valueOf(byte[] bytes, int off, int len) { - return LuaString.valueOf(bytes,off,len); + public static LuaString valueOf(byte[] bytes, int off, int len) { + return LuaString.valueOf(bytes,off,len); } - /** Construct an empty {@link LuaTable}. - * @return new {@link LuaTable} instance with no values and no metatable. + /** Construct an empty {@link LuaTable}. + * @return new {@link LuaTable} instance with no values and no metatable. */ public static LuaTable tableOf() { return new LuaTable(); } - /** Construct a {@link LuaTable} initialized with supplied array values. + /** Construct a {@link LuaTable} initialized with supplied array values. * @param varargs {@link Varargs} containing the values to use in initialization * @param firstarg the index of the first argument to use from the varargs, 1 being the first. - * @return new {@link LuaTable} instance with sequential elements coming from the varargs. + * @return new {@link LuaTable} instance with sequential elements coming from the varargs. */ public static LuaTable tableOf(Varargs varargs, int firstarg) { return new LuaTable(varargs,firstarg); } - /** Construct an empty {@link LuaTable} preallocated to hold array and hashed elements + /** Construct an empty {@link LuaTable} preallocated to hold array and hashed elements * @param narray Number of array elements to preallocate * @param nhash Number of hash elements to preallocate * @return new {@link LuaTable} instance with no values and no metatable, but preallocated for array and hashed elements. */ - public static LuaTable tableOf(int narray, int nhash) { return new LuaTable(narray, nhash); } + public static LuaTable tableOf(int narray, int nhash) { return new LuaTable(narray, nhash); } - /** Construct a {@link LuaTable} initialized with supplied array values. + /** Construct a {@link LuaTable} initialized with supplied array values. * @param unnamedValues array of {@link LuaValue} containing the values to use in initialization - * @return new {@link LuaTable} instance with sequential elements coming from the array. + * @return new {@link LuaTable} instance with sequential elements coming from the array. */ public static LuaTable listOf(LuaValue[] unnamedValues) { return new LuaTable(null,unnamedValues,null); } - /** Construct a {@link LuaTable} initialized with supplied array values. + /** Construct a {@link LuaTable} initialized with supplied array values. * @param unnamedValues array of {@link LuaValue} containing the first values to use in initialization * @param lastarg {@link Varargs} containing additional values to use in initialization * to be put after the last unnamedValues element - * @return new {@link LuaTable} instance with sequential elements coming from the array and varargs. + * @return new {@link LuaTable} instance with sequential elements coming from the array and varargs. */ public static LuaTable listOf(LuaValue[] unnamedValues,Varargs lastarg) { return new LuaTable(null,unnamedValues,lastarg); } - /** Construct a {@link LuaTable} initialized with supplied named values. + /** Construct a {@link LuaTable} initialized with supplied named values. * @param namedValues array of {@link LuaValue} containing the keys and values to use in initialization * in order {@code {key-a, value-a, key-b, value-b, ...} } - * @return new {@link LuaTable} instance with non-sequential keys coming from the supplied array. + * @return new {@link LuaTable} instance with non-sequential keys coming from the supplied array. */ - public static LuaTable tableOf(LuaValue[] namedValues) { return new LuaTable(namedValues,null,null); } + public static LuaTable tableOf(LuaValue[] namedValues) { return new LuaTable(namedValues,null,null); } /** Construct a {@link 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. + * possibly overwriting named values at the same slot if there are conflicts. * @param namedValues array of {@link LuaValue} containing the keys and values to use in initialization * in order {@code {key-a, value-a, key-b, value-b, ...} } * @param unnamedValues array of {@link LuaValue} containing the sequenctial elements to use in initialization * in order {@code {value-1, value-2, ...} }, or null if there are none - * @return new {@link LuaTable} instance with named and sequential values supplied. + * @return new {@link LuaTable} instance with named and sequential values supplied. */ - public static LuaTable tableOf(LuaValue[] namedValues, LuaValue[] unnamedValues) {return new LuaTable(namedValues,unnamedValues,null); } + public static LuaTable tableOf(LuaValue[] namedValues, LuaValue[] unnamedValues) {return new LuaTable(namedValues,unnamedValues,null); } /** Construct a {@link 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. + * possibly overwriting named values at the same slot if there are conflicts. * @param namedValues array of {@link LuaValue} containing the keys and values to use in initialization * in order {@code {key-a, value-a, key-b, value-b, ...} } * @param unnamedValues array of {@link LuaValue} containing the first sequenctial elements to use in initialization * in order {@code {value-1, value-2, ...} }, or null if there are none - * @param lastarg {@link Varargs} containing additional values to use in the sequential part of the initialization, + * @param lastarg {@link Varargs} containing additional values to use in the sequential part of the initialization, * to be put after the last unnamedValues element - * @return new {@link LuaTable} instance with named and sequential values supplied. + * @return new {@link LuaTable} instance with named and sequential values supplied. */ - public static LuaTable tableOf(LuaValue[] namedValues, LuaValue[] unnamedValues, Varargs lastarg) {return new LuaTable(namedValues,unnamedValues,lastarg); } + public static LuaTable tableOf(LuaValue[] namedValues, LuaValue[] unnamedValues, Varargs lastarg) {return new LuaTable(namedValues,unnamedValues,lastarg); } - /** Construct a LuaUserdata for an object. + /** Construct a LuaUserdata for an object. * * @param o The java instance to be wrapped as userdata - * @return {@link LuaUserdata} value wrapping the java instance. + * @return {@link LuaUserdata} value wrapping the java instance. */ public static LuaUserdata userdataOf(Object o) { return new LuaUserdata(o); } - /** Construct a LuaUserdata for an object with a user supplied metatable. + /** Construct a LuaUserdata for an object with a user supplied metatable. * * @param o The java instance to be wrapped as userdata - * @param metatable The metatble to associate with the userdata instance. - * @return {@link LuaUserdata} value wrapping the java instance. + * @param metatable The metatble to associate with the userdata instance. + * @return {@link LuaUserdata} value wrapping the java instance. */ public static LuaUserdata userdataOf(Object o,LuaValue metatable) { return new LuaUserdata(o,metatable); } @@ -3292,7 +3290,7 @@ public class LuaValue extends Varargs { protected static LuaValue gettable(LuaValue t, LuaValue key) { LuaValue tm; int loop = 0; - do { + do { if (t.istable()) { LuaValue res = t.rawget(key); if ((!res.isnil()) || (tm = t.metatag(INDEX)).isnil()) @@ -3312,14 +3310,14 @@ public class LuaValue extends Varargs { * Perform field assignment including metatag processing. * @param t {@link LuaValue} on which value is being set, typically a table or something with the metatag {@link LuaValue#NEWINDEX} defined * @param key {@link LuaValue} naming the field to assign - * @param value {@link LuaValue} the new value to assign to {@code key} + * @param value {@link LuaValue} the new value to assign to {@code key} * @throws LuaError if there is a loop in metatag processing - * @return true if assignment or metatag processing succeeded, false otherwise + * @return true if assignment or metatag processing succeeded, false otherwise */ protected static boolean settable(LuaValue t, LuaValue key, LuaValue value) { LuaValue tm; int loop = 0; - do { + do { if (t.istable()) { if ((!t.rawget(key).isnil()) || (tm = t.metatag(NEWINDEX)).isnil()) { t.rawset(key, value); @@ -3339,9 +3337,9 @@ public class LuaValue extends Varargs { } /** - * Get particular metatag, or return {@link LuaValue#NIL} if it doesn't exist - * @param tag Metatag name to look up, typically a string such as - * {@link LuaValue#INDEX} or {@link LuaValue#NEWINDEX} + * Get particular metatag, or return {@link LuaValue#NIL} if it doesn't exist + * @param tag Metatag name to look up, typically a string such as + * {@link LuaValue#INDEX} or {@link LuaValue#NEWINDEX} * @return {@link LuaValue} for tag {@code reason}, or {@link LuaValue#NIL} */ public LuaValue metatag(LuaValue tag) { @@ -3352,9 +3350,9 @@ public class LuaValue extends Varargs { } /** - * Get particular metatag, or throw {@link LuaError} if it doesn't exist - * @param tag Metatag name to look up, typically a string such as - * {@link LuaValue#INDEX} or {@link LuaValue#NEWINDEX} + * Get particular metatag, or throw {@link LuaError} if it doesn't exist + * @param tag Metatag name to look up, typically a string such as + * {@link LuaValue#INDEX} or {@link LuaValue#NEWINDEX} * @param reason Description of error when tag lookup fails. * @return {@link LuaValue} that can be called * @throws LuaError when the lookup fails. @@ -3362,7 +3360,7 @@ public class LuaValue extends Varargs { protected LuaValue checkmetatag(LuaValue tag, String reason) { LuaValue h = this.metatag(tag); if ( h.isnil() ) - throw new LuaError(reason+typename()); + throw new LuaError(reason + "a " + typename() + " value"); return h; } @@ -3386,8 +3384,8 @@ public class LuaValue extends Varargs { } } - /** Throw {@link LuaError} indicating index was attempted on illegal type - * @throws LuaError when called. + /** Throw {@link LuaError} indicating index was attempted on illegal type + * @throws LuaError when called. */ private void indexerror(String key) { error( "attempt to index ? (a "+typename()+" value) with key '" + key + "'" ); @@ -3396,7 +3394,7 @@ public class LuaValue extends Varargs { /** Construct a {@link Varargs} around an array of {@link LuaValue}s. * * @param v The array of {@link LuaValue}s - * @return {@link Varargs} wrapping the supplied values. + * @return {@link Varargs} wrapping the supplied values. * @see LuaValue#varargsOf(LuaValue, Varargs) * @see LuaValue#varargsOf(LuaValue[], int, int) */ @@ -3404,7 +3402,7 @@ public class LuaValue extends Varargs { switch ( v.length ) { case 0: return NONE; case 1: return v[0]; - case 2: return new Varargs.PairVarargs(v[0],v[1]); + case 2: return new Varargs.PairVarargs(v[0],v[1]); default: return new Varargs.ArrayVarargs(v,NONE); } } @@ -3415,16 +3413,16 @@ public class LuaValue extends Varargs { * @param r {@link Varargs} contain values to include at the end * @return {@link Varargs} wrapping the supplied values. * @see LuaValue#varargsOf(LuaValue[]) - * @see LuaValue#varargsOf(LuaValue[], int, int, Varargs) + * @see LuaValue#varargsOf(LuaValue[], int, int, Varargs) */ - public static Varargs varargsOf(final LuaValue[] v,Varargs r) { + public static Varargs varargsOf(final LuaValue[] v,Varargs r) { switch ( v.length ) { case 0: return r; - case 1: return r.narg()>0? - (Varargs) new Varargs.PairVarargs(v[0],r): + case 1: return r.narg()>0? + (Varargs) new Varargs.PairVarargs(v[0],r): (Varargs) v[0]; - case 2: return r.narg()>0? - (Varargs) new Varargs.ArrayVarargs(v,r): + case 2: return r.narg()>0? + (Varargs) new Varargs.ArrayVarargs(v,r): (Varargs) new Varargs.PairVarargs(v[0],v[1]); default: return new Varargs.ArrayVarargs(v,r); } @@ -3451,24 +3449,24 @@ public class LuaValue extends Varargs { /** Construct a {@link Varargs} around an array of {@link LuaValue}s. * * Caller must ensure that array contents are not mutated after this call - * or undefined behavior will result. + * or undefined behavior will result. * * @param v The array of {@link LuaValue}s * @param offset number of initial values to skip in the array * @param length number of values to include from the array * @param more {@link Varargs} contain values to include at the end - * @return {@link Varargs} wrapping the supplied values. + * @return {@link Varargs} wrapping the supplied values. * @see LuaValue#varargsOf(LuaValue[], Varargs) * @see LuaValue#varargsOf(LuaValue[], int, int) */ public static Varargs varargsOf(final LuaValue[] v, final int offset, final int length, Varargs more) { switch ( length ) { case 0: return more; - case 1: return more.narg()>0? - (Varargs) new Varargs.PairVarargs(v[offset],more): + case 1: return more.narg()>0? + (Varargs) new Varargs.PairVarargs(v[offset],more): (Varargs) v[offset]; - case 2: return more.narg()>0? - (Varargs) new Varargs.ArrayPartVarargs(v,offset,length,more): + case 2: return more.narg()>0? + (Varargs) new Varargs.ArrayPartVarargs(v,offset,length,more): (Varargs) new Varargs.PairVarargs(v[offset],v[offset+1]); default: return new Varargs.ArrayPartVarargs(v,offset,length,more); } @@ -3477,12 +3475,12 @@ public class LuaValue extends Varargs { /** Construct a {@link Varargs} around a set of 2 or more {@link LuaValue}s. *

* 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. + * followed by another variable list of remaining values. * * @param v First {@link LuaValue} in the {@link Varargs} - * @param r {@link LuaValue} supplying the 2rd value, + * @param r {@link LuaValue} supplying the 2rd value, * or {@link Varargs}s supplying all values beyond the first - * @return {@link Varargs} wrapping the supplied values. + * @return {@link Varargs} wrapping the supplied values. */ public static Varargs varargsOf(LuaValue v, Varargs r) { switch ( r.narg() ) { @@ -3494,18 +3492,18 @@ public class LuaValue extends Varargs { /** Construct a {@link Varargs} around a set of 3 or more {@link LuaValue}s. *

* 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. + * followed by another variable list of remaining values. * * @param v1 First {@link LuaValue} in the {@link Varargs} * @param v2 Second {@link LuaValue} in the {@link Varargs} - * @param v3 {@link LuaValue} supplying the 3rd value, + * @param v3 {@link LuaValue} supplying the 3rd value, * or {@link Varargs}s supplying all values beyond the second - * @return {@link Varargs} wrapping the supplied values. + * @return {@link Varargs} wrapping the supplied values. */ - public static Varargs varargsOf(LuaValue v1,LuaValue v2,Varargs v3) { + public static Varargs varargsOf(LuaValue v1,LuaValue v2,Varargs v3) { switch ( v3.narg() ) { case 0: return new Varargs.PairVarargs(v1,v2); - default: return new Varargs.ArrayPartVarargs(new LuaValue[]{v1,v2}, 0, 2, v3); + default: return new Varargs.ArrayPartVarargs(new LuaValue[]{v1,v2}, 0, 2, v3); } } @@ -3513,9 +3511,9 @@ public class LuaValue extends Varargs { *

* The tail call is not yet called or processing until the client invokes * {@link 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. + *

+ * This method is typically not used directly by client code. + * Instead use one of the function invocation methods. * * @param func {@link LuaValue} to be called as a tail call * @param args {@link Varargs} containing the arguments to the call @@ -3525,14 +3523,14 @@ public class LuaValue extends Varargs { * @see LuaValue#method(LuaValue) * @see LuaValue#invokemethod(LuaValue) */ - public static Varargs tailcallOf(LuaValue func, Varargs args) { + public static Varargs tailcallOf(LuaValue func, Varargs args) { return new TailcallVarargs(func, args); } /** * Callback used during tail call processing to invoke the function once. *

- * This may return a {@link TailcallVarargs} to be evaluated by the client. + * This may return a {@link TailcallVarargs} to be evaluated by the client. *

* This should not be called directly, instead use one of the call invocation functions. * @@ -3547,18 +3545,18 @@ public class LuaValue extends Varargs { return invoke(args); } - /** Hook for implementations such as LuaJC to load the environment of the main chunk - * into the first upvalue location. If the function has no upvalues or is not a main chunk, + /** Hook for implementations such as LuaJC to load the environment of the main chunk + * into the first upvalue location. If the function has no upvalues or is not a main chunk, * calling this will be no effect. * @param env The environment to load into the first upvalue, if there is one. */ public void initupvalue1(LuaValue env) {} - /** Varargs implemenation with no values. + /** Varargs implemenation with no values. *

* This is an internal class not intended to be used directly. - * Instead use the predefined constant {@link LuaValue#NONE} - * + * Instead use the predefined constant {@link LuaValue#NONE} + * * @see LuaValue#NONE */ private static final class None extends LuaNil {