public class LuaList extends LuaTable
| 限定符和类型 | 字段和说明 |
|---|---|
protected org.luaj.vm2.Metatable |
m_metatable
metatable for this table, or null
|
hash, hashEntries, mConstADD, 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| 构造器和说明 |
|---|
LuaList()
Construct empty table
|
LuaList(int narray)
Construct table with preset capacity.
|
LuaList(Varargs varargs)
Construct table of unnamed elements.
|
LuaList(Varargs varargs,
int firstarg)
Construct table of unnamed elements.
|
| 限定符和类型 | 方法和说明 |
|---|---|
LuaValue |
arrayget(LuaValue[] array,
int index)
Returns the value at the given index in the array, or null if it is a weak reference that
has been dropped.
|
LuaTable |
checktable()
|
LuaValue |
concat(LuaString sep,
int i,
int j)
Concatenate the contents of a table efficiently, using
Buffer |
org.luaj.vm2.LuaTable.Slot |
entry(LuaValue key,
LuaValue value)
Return an instance of Slot appropriate for the given key and value.
|
boolean |
eq_b(LuaValue val)
Equals: Perform equality comparison with another value
including metatag processing using
LuaValue.EQ,
and return java boolean |
LuaValue |
eq(LuaValue val)
Equals: Perform equality comparison with another value
including metatag processing using
LuaValue.EQ. |
LuaValue |
get(int key)
Get a value in a table including metatag processing using
LuaValue.INDEX. |
LuaValue |
get(LuaValue key)
Get a value in a table including metatag processing using
LuaValue.INDEX. |
protected int |
getArrayLength()
Get the length of the array part of the table.
|
protected int |
getHashLength()
Get the length of the hash part of the table.
|
LuaValue |
getmetatable()
Get the metatable for this
LuaValue
For LuaTable and LuaUserdata instances,
the metatable returned is this instance metatable. |
Varargs |
inext(LuaValue key)
Get the next element after a particular key in the
contiguous array part of a table
|
void |
insert(int pos,
LuaValue value)
Insert an element at a position in a list-table
|
boolean |
istable()
Check if
this is a table |
int |
keyCount()
This may be deprecated in a future release.
|
LuaValue[] |
keys()
This may be deprecated in a future release.
|
LuaValue |
len()
Length operator: return lua length of object
(#this) including metatag processing as java int |
int |
length()
Length operator: return lua length of object
(#this) including metatag processing as java int |
Varargs |
next(LuaValue key)
Get the next element after a particular key in the table
|
LuaTable |
opttable(LuaTable defval)
Check that optional argument is a table and return as
LuaTable |
void |
presize(int narray)
Preallocate the array part of a table to be a certain size,
Primarily used internally in response to a SETLIST bytecode.
|
LuaValue |
rawget(int key)
Get a value in a table without metatag processing.
|
LuaValue |
rawget(LuaValue key)
Get a value in a table without metatag processing.
|
int |
rawlen()
Get raw length of table or string without metatag processing.
|
void |
rawset(int key,
LuaValue value)
Set a value in a table without metatag processing.
|
void |
rawset(LuaValue key,
LuaValue value)
caller must ensure key is not nil
|
LuaValue |
remove(int pos)
Remove the element at a position in a list-table
|
void |
set(int key,
LuaValue value)
Set a value in a table without metatag processing using
LuaValue.NEWINDEX. |
void |
set(LuaValue key,
LuaValue value)
caller must ensure key is not nil
|
LuaValue |
setmetatable(LuaValue metatable)
Set the metatable for this
LuaValue
For LuaTable and LuaUserdata instances, the metatable is per instance. |
void |
sort(LuaValue comparator)
Sort the table using a comparator.
|
LuaValue |
toLuaValue()
Return this metatable as a LuaValue.
|
int |
type()
Get the enumeration value for the type of this value.
|
String |
typename()
Get the String name of the type of this value.
|
Varargs |
unpack()
Unpack all the elements of this table
|
Varargs |
unpack(int i)
Unpack all the elements of this table from element i
|
Varargs |
unpack(int i,
int j)
Unpack the elements from i to j inclusive
|
boolean |
useWeakKeys()
Return whether or not this table's keys are weak.
|
boolean |
useWeakValues()
Return whether or not this table's values are weak.
|
LuaValue |
wrap(LuaValue value)
Returns the given value wrapped in a weak reference if appropriate.
|
_const, clear, clone, defaultEntry, entry, find, hashget, hashmod, hashpow2, hashset, hashSlot, isLargeKey, presize, sizeadd, 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, checkfunction, checkglobals, checkint, checkinteger, checkjstring, checklong, checkmetatag, checknotnil, checknumber, checknumber, checkstring, checkthread, checkuserdata, checkuserdata, compareerror, compareerror, comparemt, concat, concat, concatmt, concatTo, concatTo, concatTo, div, div, div, divInto, eqmtcall, equals, error, 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, initupvalue1, invoke, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isfunction, isint, isinttype, islong, isnil, isnumber, isstring, isthread, isuserdata, isuserdata, isvalidkey, jcall, jget, jset, lenerror, 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, not, onInvoke, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, optthread, optuserdata, optuserdata, optvalue, or, pow, pow, pow, powWith, powWith, raweq, raweq, raweq, raweq, raweq, rawget, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, setfenv, 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, toboolean, tobyte, tochar, todouble, tofloat, toint, tojstring, 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 LuaList()
public LuaList(int narray)
narray - capacity of array partpublic LuaList(Varargs varargs)
varargs - Unnamed elements in order value-1, value-2, ... public LuaList(Varargs varargs, int firstarg)
varargs - Unnamed elements in order value-1, value-2, ... firstarg - the index in varargs of the first argument to include in the tablepublic int type()
LuaValuetype 在类中 LuaTableLuaValue.TNIL,
LuaValue.TBOOLEAN,
LuaValue.TNUMBER,
LuaValue.TSTRING,
LuaValue.TTABLE,
LuaValue.TFUNCTION,
LuaValue.TUSERDATA,
LuaValue.TTHREADLuaValue.typename()public String typename()
LuaValuetypename 在类中 LuaTableLuaValue.TYPE_NAMES
corresponding to the type of this value:
"nil", "boolean", "number", "string",
"table", "function", "userdata", "thread"LuaValue.type()public boolean istable()
LuaValuethis is a tableistable 在类中 LuaTabletable, otherwise falseLuaValue.checktable(),
LuaValue.opttable(LuaTable),
LuaValue.TTABLEpublic LuaTable checktable()
LuaValuechecktable 在类中 LuaTablethis if it is a LuaTableLuaValue.istable(),
LuaValue.opttable(LuaTable),
LuaValue.TTABLEpublic LuaTable opttable(LuaTable defval)
LuaValueLuaTableopttable 在类中 LuaTabledefval - LuaTable to return if this is nil or nonethis cast to LuaTable if a table,
defval if nil or none,
throws LuaError if some other typeLuaValue.checktable(),
LuaValue.istable(),
LuaValue.TTABLEpublic void presize(int narray)
LuaValuePrimarily used internally in response to a SETLIST bytecode.
protected int getArrayLength()
getArrayLength 在类中 LuaTableprotected int getHashLength()
getHashLength 在类中 LuaTablepublic 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 在类中 LuaTableLuaBoolean.s_metatable,
LuaNumber.s_metatable,
LuaNil.s_metatable,
LuaFunction.s_metatable,
LuaThread.s_metatablepublic LuaValue setmetatable(LuaValue metatable)
LuaValueLuaValue
For LuaTable and LuaUserdata instances, the metatable is per instance.
For all other types, there is one metatable per type that can be set directly from java
setmetatable 在类中 LuaTablemetatable - LuaValue instance to serve as the metatable, or null to reset it.this to allow chaining of Java function callsLuaBoolean.s_metatable,
LuaNumber.s_metatable,
LuaNil.s_metatable,
LuaFunction.s_metatable,
LuaThread.s_metatablepublic LuaValue get(int key)
LuaValueLuaValue.INDEX.get 在类中 LuaTablekey - the key to look upLuaValue for that key, or LuaValue.NIL if not foundLuaValue.get(LuaValue),
LuaValue.rawget(int)public LuaValue get(LuaValue key)
LuaValueLuaValue.INDEX.get 在类中 LuaTablekey - the key to look up, must not be LuaValue.NIL or nullLuaValue for that key, or LuaValue.NIL if not found and no metatagLuaValue.get(int),
LuaValue.get(String),
LuaValue.rawget(LuaValue)public LuaValue rawget(int key)
LuaValuerawget 在类中 LuaTablekey - the key to look upLuaValue for that key, or LuaValue.NIL if not foundpublic LuaValue rawget(LuaValue key)
LuaValuerawget 在类中 LuaTablekey - the key to look up, must not be LuaValue.NIL or nullLuaValue for that key, or LuaValue.NIL if not foundpublic void set(int key,
LuaValue value)
LuaValueLuaValue.NEWINDEX.set 在类中 LuaTablekey - the key to usevalue - the value to use, can be LuaValue.NIL, must not be nullpublic void set(LuaValue key, LuaValue value)
set 在类中 LuaTablekey - the key to use, must not be LuaValue.NIL or nullvalue - the value to use, can be LuaValue.NIL, must not be nullpublic void rawset(int key,
LuaValue value)
LuaValuerawset 在类中 LuaTablekey - the key to usevalue - the value to use, can be LuaValue.NIL, must not be nullpublic void rawset(LuaValue key, LuaValue value)
rawset 在类中 LuaTablekey - the key to use, must not be LuaValue.NIL or nullvalue - the value to use, can be LuaValue.NIL, must not be nullpublic LuaValue remove(int pos)
remove 在类中 LuaTablepos - the position to removeLuaValue.NONE if not removedpublic void insert(int pos,
LuaValue value)
public LuaValue concat(LuaString sep, int i, int j)
Bufferpublic int length()
LuaValue(#this) including metatag processing as java intlength 在类中 LuaTableLuaValue.toint()public LuaValue len()
LuaValue(#this) including metatag processing as java intpublic int rawlen()
LuaValuepublic Varargs next(LuaValue key)
next 在类中 LuaTablekey - LuaInteger value identifying a key to start from,
or LuaValue.NIL to start at the beginningLuaTable,
LuaValue.inext(LuaValue),
LuaValue.valueOf(int),
Varargs.arg1(),
Varargs.arg(int),
LuaValue.isnil()public Varargs inext(LuaValue key)
inext 在类中 LuaTablekey - LuaInteger value identifying a key to start from,
or LuaValue.NIL to start at the beginningLuaTable,
LuaValue.next(LuaValue),
LuaValue.valueOf(int),
Varargs.arg1(),
Varargs.arg(int),
LuaValue.isnil()public void sort(LuaValue comparator)
public int keyCount()
public LuaValue[] keys()
public LuaValue eq(LuaValue val)
LuaValueLuaValue.EQ.eq 在类中 LuaTableval - The value to compare with.LuaValue.TRUE if values are comparable and (this == rhs),
LuaValue.FALSE if comparable but not equal,
LuaValue if metatag processing occurs.LuaValue.eq_b(LuaValue),
LuaValue.raweq(LuaValue),
LuaValue.neq(LuaValue),
LuaValue.eqmtcall(LuaValue, LuaValue, LuaValue, LuaValue),
LuaValue.EQpublic boolean eq_b(LuaValue val)
LuaValueLuaValue.EQ,
and return java booleaneq_b 在类中 LuaTableval - The value to compare with.(this == rhs),
false if comparable but not equal,
result converted to java boolean if metatag processing occurs.LuaValue.eq(LuaValue),
LuaValue.raweq(LuaValue),
LuaValue.neq_b(LuaValue),
LuaValue.eqmtcall(LuaValue, LuaValue, LuaValue, LuaValue),
LuaValue.EQpublic Varargs unpack(int i)
public Varargs unpack(int i, int j)
public boolean useWeakKeys()
useWeakKeys 在类中 LuaTablepublic boolean useWeakValues()
useWeakValues 在类中 LuaTablepublic LuaValue toLuaValue()
toLuaValue 在类中 LuaTablepublic LuaValue wrap(LuaValue value)
public LuaValue arrayget(LuaValue[] array, int index)
Copyright © 2020. All rights reserved.