Package com.prineside.luaj
Class LuaBoolean
java.lang.Object
com.prineside.luaj.Varargs
com.prineside.luaj.LuaValue
com.prineside.luaj.LuaBoolean
Extension of
LuaValue which can hold a Java boolean as its value.
These instance are not instantiated directly by clients.
Instead, there are exactly twon instances of this class,
LuaValue.TRUE and LuaValue.FALSE
representing the lua values true and false.
The function LuaValue.valueOf(boolean) will always
return one of these two values.
Any LuaValue can be converted to its equivalent
boolean representation using LuaValue.toboolean()
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class com.prineside.luaj.LuaValue
LuaValue.NillableSerializer, LuaValue.None -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic LuaValueShared static metatable for boolean values represented in lua.booleanThe value of the booleanFields inherited from class com.prineside.luaj.LuaValue
ADD, CALL, CONCAT, DIV, EMPTYSTRING, ENV, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILLABLE_SERIALIZER, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturn the boolean value for this booleanbooleanCheck that the value is aLuaBoolean, or throwLuaErrorif notGet the metatable for thisLuaValuebooleanCheck ifthisis abooleannot()Unary not: return inverse boolean value(~this)as defined by lua not operatorbooleanoptboolean(boolean defval) Check that optional argument is a boolean and return its boolean valuebooleanConvert to boolean false ifLuaValue.NILorLuaValue.FALSE, true if anything elseConvert to human readable String for any type.inttype()Get the enumeration value for the type of this value.typename()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, cachedDouble, cachedInt, cachedVarargsOf, cachedVarargsOf, cachedVarargsOf, cachedVarargsOf, cachedVarargsOf, cachedVarargsOf, call, call, call, call, call, checkclosure, checkdouble, checkfunction, checkglobals, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, div, div, div, divInto, eq, eq_b, eqmtcall, equals, 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, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isclosure, isfunction, isint, isinttype, islong, isnil, isnumber, isstring, istable, isthread, isuserdata, isuserdata, isvalidkey, 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, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, or, pow, pow, pow, powWith, powWith, presize, raweq, raweq, raweq, raweq, raweq, rawget, rawget, rawget, 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, 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, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, dealias, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type
-
Field Details
-
s_metatable
Shared static metatable for boolean values represented in lua. -
v
public boolean vThe value of the boolean
-
-
Method Details
-
type
public 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:
-
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:
-
isboolean
public boolean isboolean()Description copied from class:LuaValueCheck ifthisis aboolean -
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
-
booleanValue
public boolean booleanValue()Return the boolean value for this boolean- Returns:
- value as a Java boolean
-
toboolean
public boolean toboolean()Description copied from class:LuaValueConvert to boolean false ifLuaValue.NILorLuaValue.FALSE, true if anything else -
tojstring
Description copied from class:LuaValueConvert to human readable String for any type. -
optboolean
public 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:
-
checkboolean
public boolean checkboolean()Description copied from class:LuaValueCheck that the value is aLuaBoolean, or throwLuaErrorif not- Overrides:
checkbooleanin classLuaValue- Returns:
- boolean value for
thisif it is aLuaBoolean - See Also:
-
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
- See Also:
-