|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.luaj.vm2.Varargs
org.luaj.vm2.LuaValue
org.luaj.vm2.LuaBoolean
public final class 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()
LuaValue,
LuaValue.valueOf(boolean),
LuaValue.TRUE,
LuaValue.FALSE| Field Summary | |
|---|---|
static LuaValue |
s_metatable
Shared static metatable for boolean values represented in lua. |
boolean |
v
The value of the boolean |
| Fields inherited from class org.luaj.vm2.LuaValue |
|---|
ADD, CALL, CONCAT, DIV, EMPTYSTRING, EQ, FALSE, INDEX, LE, LEN, LT, METATABLE, MINUSONE, MOD, MODE, MUL, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, POW, SUB, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TOSTRING, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, UNM, ZERO |
| Method Summary | |
|---|---|
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 |
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 FALSE, true if anything else |
java.lang.String |
tojstring()
Convert to human readable String for any type. |
int |
type()
Get the enumeration value for the type of this value. |
java.lang.String |
typename()
Get the String name of the type of this value. |
| Methods inherited from class org.luaj.vm2.Varargs |
|---|
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, checktable, checkthread, checkuserdata, checkuserdata, checkvalue, eval, isfunction, isnil, isnoneornil, isnumber, isstring, istable, isTailcall, isthread, isuserdata, isvalue, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, opttable, optthread, optuserdata, optuserdata, optvalue, subargs, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, tolong, toshort, touserdata, touserdata, type |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static LuaValue s_metatable
public final boolean v
| Method Detail |
|---|
public int type()
LuaValue
type in class LuaValueTNIL,
TBOOLEAN,
TNUMBER,
TSTRING,
TTABLE,
TFUNCTION,
TUSERDATA,
TTHREADLuaValue.typename()public java.lang.String typename()
LuaValue
typename in class 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 boolean
isboolean in class LuaValueboolean, otherwise falseLuaValue.isboolean(),
LuaValue.toboolean(),
LuaValue.checkboolean(),
LuaValue.optboolean(boolean),
#TOBOLEANpublic LuaValue not()
LuaValue(~this) as defined by lua not operator
not in class LuaValueTRUE if NIL or FALSE, otherwise FALSEpublic boolean booleanValue()
public boolean toboolean()
LuaValueLuaValue.NIL or FALSE, true if anything else
toboolean in class LuaValueLuaValue.optboolean(boolean),
LuaValue.checkboolean(),
LuaValue.isboolean(),
TBOOLEANpublic java.lang.String tojstring()
LuaValue
tojstring in class LuaValueLuaValue.tostring(),
LuaValue.optjstring(String),
LuaValue.checkjstring(),
LuaValue.isstring(),
TSTRINGpublic boolean optboolean(boolean defval)
LuaValue
optboolean in class LuaValuedefval - boolean value to return if this is nil or none
this cast to boolean if a ,
defval if nil or none,
throws LuaError otherwiseLuaValue.checkboolean(),
LuaValue.isboolean(),
LuaValue.TBOOLEANpublic boolean checkboolean()
LuaValueLuaBoolean,
or throw LuaError if not
checkboolean in class 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 in class LuaValues_metatable,
LuaNumber.s_metatable,
LuaNil.s_metatable,
LuaFunction.s_metatable,
LuaThread.s_metatable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||