public abstract class LuaFunction extends LuaValue
Direct subclass include LibFunction
which is the base class for
all built-in library functions coded in Java,
and LuaClosure, which represents a lua closure
whose bytecode is interpreted when the function is invoked.
LuaValue,
LuaClosure,
LibFunction| 限定符和类型 | 字段和说明 |
|---|---|
static LuaValue |
s_metatable
Shared static metatable for all functions and closures.
|
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| 构造器和说明 |
|---|
LuaFunction() |
LuaFunction(LuaValue env) |
| 限定符和类型 | 方法和说明 |
|---|---|
LuaFunction |
checkfunction()
Check that the value is a function , or throw
LuaError if not
A LuaFunction may either be a Java function that implements
functionality directly in Java, or a LuaClosure
which is a LuaFunction that executes lua bytecode. |
String |
classnamestub()
Return the last part of the class name, to be used as a function name in tojstring and elsewhere.
|
LuaValue |
getfenv() |
LuaValue |
getmetatable()
Get the metatable for this
LuaValue
For LuaTable and LuaUserdata instances,
the metatable returned is this instance metatable. |
boolean |
isfunction()
Check if
this is a function |
String |
name()
Return a human-readable name for this function.
|
LuaFunction |
optfunction(LuaFunction defval)
Check that optional argument is a function and return as
LuaFunction
A LuaFunction may either be a Java function that implements
functionality directly in Java, or a LuaClosure
which is a LuaFunction that executes lua bytecode. |
void |
setfenv(LuaValue env) |
LuaString |
strvalue()
|
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, checkboolean, checkclosure, checkdouble, 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, 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, isboolean, isclosure, 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, not, onInvoke, optboolean, optclosure, optdouble, 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, settable, setuservalue, shl, shl, shr, shr, strcmp, strcmp, strongvalue, sub, sub, sub, subargs, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, toboolean, 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 LuaFunction()
public LuaFunction(LuaValue env)
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 isfunction()
LuaValuethis is a functionisfunction 在类中 LuaValuefunction, otherwise falseLuaValue.isclosure(),
LuaValue.checkfunction(),
LuaValue.optfunction(LuaFunction),
LuaValue.TFUNCTIONpublic LuaFunction checkfunction()
LuaValueLuaError if not
A LuaFunction may either be a Java function that implements
functionality directly in Java, or a LuaClosure
which is a LuaFunction that executes lua bytecode.
checkfunction 在类中 LuaValuethis if it is a lua function or closureLuaValue.checkclosure()public LuaFunction optfunction(LuaFunction defval)
LuaValueLuaFunction
A LuaFunction may either be a Java function that implements
functionality directly in Java, or a LuaClosure
which is a LuaFunction that executes lua bytecode.
optfunction 在类中 LuaValuedefval - LuaFunction to return if this is nil or nonethis cast to LuaFunction if a function,
defval if nil or none,
throws LuaError otherwiseLuaValue.checkfunction(),
LuaValue.isfunction(),
LuaValue.TFUNCTIONpublic 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 在类中 LuaValueLuaBoolean.s_metatable,
LuaNumber.s_metatable,
LuaNil.s_metatable,
s_metatable,
LuaThread.s_metatablepublic String tojstring()
LuaValuetojstring 在类中 LuaValueLuaValue.tostring(),
LuaValue.optjstring(String),
LuaValue.checkjstring(),
LuaValue.isstring(),
LuaValue.TSTRINGpublic String classnamestub()
public String name()
Copyright © 2020. All rights reserved.