public final class LuaBoolean extends LuaValue
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()
| 限定符和类型 | 字段和说明 |
|---|---|
static LuaValue |
s_metatable
Shared static metatable for boolean values represented in lua.
|
boolean |
v
The value of the boolean
|
ADD, BAND, BNOT, BOR, BXOR, CALL, CONCAT, DIV, EMPTYSTRING, ENV, EQ, FALSE, IDIV, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SHL, SHR, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, uservalue, ZERO| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
booleanValue()
Return the boolean value for this boolean
|
boolean |
checkboolean()
Check that the value is a
LuaBoolean,
or throw LuaError if not |
LuaValue |
getmetatable()
Get the metatable for this
LuaValue
For LuaTable and LuaUserdata instances,
the metatable returned is this instance metatable. |
boolean |
isboolean()
Check if
this is a boolean |
LuaValue |
not()
Unary not: return inverse boolean value
(~this) as defined by lua not operator |
boolean |
optboolean(boolean defval)
Check that optional argument is a boolean and return its boolean value
|
boolean |
toboolean()
Convert to boolean false if
LuaValue.NIL or LuaValue.FALSE, true if anything else |
String |
tojstring()
Convert to human readable String for any type.
|
int |
type()
Get the enumeration value for the type of this value.
|
String |
typename()
Get the String name of the type of this value.
|
add, add, add, and, arg, arg1, argerror, argerror, aritherror, aritherror, arithmt, arithmtwith, assert_, band, band, bnot, bor, bor, buffer, bxor, bxor, call, call, call, call, call, callmt, checkclosure, checkdouble, checkfunction, checkglobals, checkint, checkinteger, checkjstring, checklong, checkmetatag, checknotnil, checknumber, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, compareerror, compareerror, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, div, div, div, divInto, eq_b, eq, eqmtcall, equals, error, get, get, get, getfenv, gettable, getuservalue, gt_b, gt_b, gt_b, gt, gt, gt, gteq_b, gteq_b, gteq_b, gteq, gteq, gteq, idiv, idiv, illegal, 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, jcall, jget, jset, len, lenerror, length, listOf, listOf, load, lt_b, lt_b, lt_b, lt, lt, lt, lteq_b, lteq_b, lteq_b, lteq, lteq, lteq, metatableOf, metatag, method, method, method, method, method, method, mod, mod, mod, modFrom, mul, mul, mul, narg, neg, neq_b, neq, next, onInvoke, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, or, pow, pow, pow, powWith, powWith, presize, raweq, raweq, raweq, raweq, raweq, rawget, rawget, rawget, rawlen, rawset, rawset, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, set, set, setfenv, setmetatable, settable, setuservalue, shl, shl, shr, shr, 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, typerror, unimplemented, userdataOf, userdataOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOfargcheck, 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, typepublic static LuaValue s_metatable
public final boolean v
public int type()
LuaValuetype 在类中 LuaValueLuaValue.TNIL,
LuaValue.TBOOLEAN,
LuaValue.TNUMBER,
LuaValue.TSTRING,
LuaValue.TTABLE,
LuaValue.TFUNCTION,
LuaValue.TUSERDATA,
LuaValue.TTHREADLuaValue.typename()public String typename()
LuaValuetypename 在类中 LuaValueLuaValue.TYPE_NAMES
corresponding to the type of this value:
"nil", "boolean", "number", "string",
"table", "function", "userdata", "thread"LuaValue.type()public boolean isboolean()
LuaValuethis is a booleanisboolean 在类中 LuaValueboolean, otherwise falseLuaValue.isboolean(),
LuaValue.toboolean(),
LuaValue.checkboolean(),
LuaValue.optboolean(boolean),
LuaValue.TBOOLEANpublic LuaValue not()
LuaValue(~this) as defined by lua not operatornot 在类中 LuaValueLuaValue.TRUE if LuaValue.NIL or LuaValue.FALSE, otherwise LuaValue.FALSEpublic boolean booleanValue()
public boolean toboolean()
LuaValueLuaValue.NIL or LuaValue.FALSE, true if anything elsetoboolean 在类中 LuaValueLuaValue.optboolean(boolean),
LuaValue.checkboolean(),
LuaValue.isboolean(),
LuaValue.TBOOLEANpublic String tojstring()
LuaValuetojstring 在类中 LuaValueLuaValue.tostring(),
LuaValue.optjstring(String),
LuaValue.checkjstring(),
LuaValue.isstring(),
LuaValue.TSTRINGpublic boolean optboolean(boolean defval)
LuaValueoptboolean 在类中 LuaValuedefval - boolean value to return if this is nil or nonethis cast to boolean if a LuaBoolean,
defval if nil or none,
throws LuaError otherwiseLuaValue.checkboolean(),
LuaValue.isboolean(),
LuaValue.TBOOLEANpublic boolean checkboolean()
LuaValueLuaBoolean,
or throw LuaError if notcheckboolean 在类中 LuaValuethis if it is a LuaBooleanLuaValue.optboolean(boolean),
LuaValue.TBOOLEANpublic LuaValue getmetatable()
LuaValueLuaValue
For LuaTable and LuaUserdata instances,
the metatable returned is this instance metatable.
For all other types, the class metatable value will be returned.
getmetatable 在类中 LuaValues_metatable,
LuaNumber.s_metatable,
LuaNil.s_metatable,
LuaFunction.s_metatable,
LuaThread.s_metatableCopyright © 2020. All rights reserved.