Class LuaNil
- Direct Known Subclasses:
 LuaValue.None
nil 
 
 There will be one instance of this class, LuaValue.NIL, 
 per Java virtual machine.  
 However, the Varargs instance LuaValue.NONE
 which is the empty list, 
 is also considered treated as a nil value by default.  
 
 Although it is possible to test for nil using Java == operator, 
 the recommended approach is to use the method LuaValue.isnil() 
 instead.  By using that any ambiguities between 
 LuaValue.NIL and LuaValue.NONE are avoided.
- See Also:
 
- 
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class com.prineside.luaj.LuaValue
LuaValue.NillableSerializer, LuaValue.NoneNested classes/interfaces inherited from class com.prineside.luaj.Varargs
Varargs.ArrayVarargs - 
Field Summary
Fields inherited from class com.prineside.luaj.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, ENV, EQ, FALSE, INDEX, IPAIRS, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILLABLE_SERIALIZER, NILS, NONE, NOVALS, ONE, PAIRS, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO - 
Method Summary
Modifier and TypeMethodDescriptionfinal LuaValueCheck that this is not the valueLuaValue.NIL, or throwLuaErrorif it isfinal booleanfinal LuaValueGet the metatable for thisLuaValuefinal booleanisnil()Check ifthisis#NILfinal booleanReturn true if this is a valid key in a table index operation.final LuaValuenot()Unary not: return inverse boolean value(~this)as defined by lua not operatorfinal booleanoptboolean(boolean defval) Check that optional argument is a boolean and return its boolean valuefinal LuaClosureoptclosure(LuaClosure defval) Check that optional argument is a closure and return asLuaClosurefinal doubleoptdouble(double defval) Check that optional argument is a number or string convertible to number and return as doublefinal LuaFunctionoptfunction(LuaFunction defval) Check that optional argument is a function and return asLuaFunctionfinal intoptint(int defval) Check that optional argument is a number or string convertible to number and return as intfinal Stringoptjstring(String defval) Check that optional argument is a string or number and return as Java Stringfinal longoptlong(long defval) Check that optional argument is a number or string convertible to number and return as longfinal LuaNumberCheck that optional argument is a number or string convertible to number and return asLuaNumberfinal LuaStringCheck that optional argument is a string or number and return asLuaStringfinal LuaTableCheck that optional argument is a table and return asLuaTablefinal Objectoptuserdata(Class c, Object defval) Check that optional argument is a userdata whose instance is of a type and return the Object instancefinal Objectoptuserdata(Object defval) Check that optional argument is a userdata and return the Object instancefinal LuaValuePerform argument check that this is not nil or none.final booleanConvert to boolean false ifLuaValue.NILorLuaValue.FALSE, true if anything elseConvert to human readable String for any type.final StringtoString()Convert the value to a human readable string usingLuaValue.tojstring()final inttype()Get the enumeration value for the type of this value.final Stringtypename()Get the String name of the type of this value.Methods inherited from class com.prineside.luaj.LuaValue
add, add, add, and, arg, arg1, argerror, assert_, buffer, call, call, call, call, call, cBool, cDouble, cFloat, checkboolean, checkclosure, checkdouble, checkfunction, checkglobals, checkint, checkjstring, checklong, checknumber, checknumber, checkstring, checktable, checkuserdata, checkuserdata, cInt, cNcDouble, cNcFloat, cNcInt, cObject, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, cRegObject, div, div, div, divInto, eq, eq_b, eqmtcall, error, get, get, get, gt, gt, gt, gt_b, gt_b, gt_b, gteq, gteq, gteq, gteq_b, gteq_b, gteq_b, inext, initupvalue1, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isfunction, isint, isinttype, islong, isnumber, isRegObject, isstring, istable, isuserdata, isuserdata, len, length, listOf, listOf, load, lt, lt, lt, lt_b, lt_b, lt_b, lteq, lteq, lteq, lteq_b, lteq_b, lteq_b, metatag, method, method, method, method, method, method, mod, mod, mod, modFrom, mul, mul, mul, narg, neg, neq, neq_b, next, onInvoke, or, pow, pow, pow, powWith, powWith, presize, raweq, raweq, raweq, raweq, raweq, rawget, rawget, rawget, rawlen, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setmetatable, strcmp, strcmp, strongvalue, strvalue, sub, sub, sub, subargs, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, tobyte, tochar, todouble, tofloat, toint, tolong, tonumber, toshort, tostring, touserdata, touserdata, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOfMethods inherited from class com.prineside.luaj.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkuserdata, checkuserdata, checkvalue, dealias, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optjstring, optlong, optnumber, optstring, opttable, optuserdata, optuserdata, optvalue, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type 
- 
Method Details
- 
type
public final int type()Description copied from class:LuaValueGet the enumeration value for the type of this value.- Specified by:
 typein classLuaValue- Returns:
 - value for this type, one of
 
LuaValue.TNIL,LuaValue.TBOOLEAN,LuaValue.TNUMBER,LuaValue.TSTRING,LuaValue.TTABLE,LuaValue.TFUNCTION,LuaValue.TUSERDATA,LuaValue.TTHREAD - See Also:
 
 - 
toString
Description copied from class:LuaValueConvert the value to a human readable string usingLuaValue.tojstring() - 
typename
Description copied from class:LuaValueGet the String name of the type of this value.- Specified by:
 typenamein classLuaValue- Returns:
 - name from type name list 
LuaValue.TYPE_NAMEScorresponding to the type of this value: "nil", "boolean", "number", "string", "table", "function", "userdata", "thread" - See Also:
 
 - 
tojstring
Description copied from class:LuaValueConvert to human readable String for any type. - 
not
Description copied from class:LuaValueUnary not: return inverse boolean value(~this)as defined by lua not operator- Overrides:
 notin classLuaValue- Returns:
 LuaValue.TRUEifLuaValue.NILorLuaValue.FALSE, otherwiseLuaValue.FALSE
 - 
toboolean
public final boolean toboolean()Description copied from class:LuaValueConvert to boolean false ifLuaValue.NILorLuaValue.FALSE, true if anything else - 
isnil
public final boolean isnil()Description copied from class:LuaValueCheck ifthisis#NIL - 
getmetatable
Description copied from class:LuaValueGet the metatable for thisLuaValueFor
LuaTableandLuaUserdatainstances, the metatable returned is this instance metatable. For all other types, the class metatable value will be returned.- Overrides:
 getmetatablein classLuaValue- Returns:
 - metatable, or null if it there is none
 
 - 
equals
 - 
checknotnil
Description copied from class:LuaValueCheck that this is not the valueLuaValue.NIL, or throwLuaErrorif it is- Overrides:
 checknotnilin classLuaValue- Returns:
 thisif it is notLuaValue.NIL- See Also:
 
 - 
isvalidkey
public final boolean isvalidkey()Description copied from class:LuaValueReturn true if this is a valid key in a table index operation.- Overrides:
 isvalidkeyin classLuaValue- Returns:
 - true if valid as a table key, otherwise false
 - See Also:
 
 - 
optboolean
public final boolean optboolean(boolean defval) Description copied from class:LuaValueCheck that optional argument is a boolean and return its boolean value- Overrides:
 optbooleanin classLuaValue- Parameters:
 defval- boolean value to return ifthisis nil or none- Returns:
 thiscast to boolean if aLuaBoolean,defvalif nil or none, throwsLuaErrorotherwise- See Also:
 
 - 
optclosure
Description copied from class:LuaValueCheck that optional argument is a closure and return asLuaClosureA
LuaClosureis aLuaFunctionthat executes lua byteccode.- Overrides:
 optclosurein classLuaValue- Parameters:
 defval-LuaClosureto return ifthisis nil or none- Returns:
 thiscast toLuaClosureif a function,defvalif nil or none, throwsLuaErrorotherwise- See Also:
 
 - 
optdouble
public final double optdouble(double defval) Description copied from class:LuaValueCheck that optional argument is a number or string convertible to number and return as double - 
optfunction
Description copied from class:LuaValueCheck that optional argument is a function and return asLuaFunctionA
LuaFunctionmay either be a Java function that implements functionality directly in Java, or aLuaClosurewhich is aLuaFunctionthat executes lua bytecode.- Overrides:
 optfunctionin classLuaValue- Parameters:
 defval-LuaFunctionto return ifthisis nil or none- Returns:
 thiscast toLuaFunctionif a function,defvalif nil or none, throwsLuaErrorotherwise- See Also:
 
 - 
optint
public final int optint(int defval) Description copied from class:LuaValueCheck that optional argument is a number or string convertible to number and return as int - 
optlong
public final long optlong(long defval) Description copied from class:LuaValueCheck that optional argument is a number or string convertible to number and return as long - 
optnumber
Description copied from class:LuaValueCheck that optional argument is a number or string convertible to number and return asLuaNumber - 
opttable
Description copied from class:LuaValueCheck that optional argument is a table and return asLuaTable - 
optjstring
Description copied from class:LuaValueCheck that optional argument is a string or number and return as Java String- Overrides:
 optjstringin classLuaValue- Parameters:
 defval-LuaStringto return ifthisis nil or none- Returns:
 thisconverted to String if a string or number,defvalif nil or none, throwsLuaErrorif some other type- See Also:
 
 - 
optstring
Description copied from class:LuaValueCheck that optional argument is a string or number and return asLuaString - 
optuserdata
Description copied from class:LuaValueCheck that optional argument is a userdata and return the Object instance- Overrides:
 optuserdatain classLuaValue- Parameters:
 defval- Object to return ifthisis nil or none- Returns:
 - Object instance of the userdata if a 
LuaUserdata,defvalif nil or none, throwsLuaErrorif some other type - See Also:
 
 - 
optuserdata
Description copied from class:LuaValueCheck that optional argument is a userdata whose instance is of a type and return the Object instance- Overrides:
 optuserdatain classLuaValue- Parameters:
 c- Class to test userdata instance againstdefval- Object to return ifthisis nil or none- Returns:
 - Object instance of the userdata if a 
LuaUserdataand instance is assignable toc,defvalif nil or none, throwsLuaErrorif some other type - See Also:
 
 - 
optvalue
Description copied from class:LuaValuePerform argument check that this is not nil or none. 
 -