org.luaj.vm2
Class LuaTable

java.lang.Object
  extended by org.luaj.vm2.Varargs
      extended by org.luaj.vm2.LuaValue
          extended by org.luaj.vm2.LuaTable
Direct Known Subclasses:
WeakTable

public class LuaTable
extends LuaValue


Field Summary
protected  LuaValue[] array
           
protected  LuaValue[] hashKeys
           
protected  LuaValue[] hashValues
           
 
Fields inherited from class org.luaj.vm2.LuaValue
CALL, EMPTYSTRING, FALSE, INDEX, METATABLE, MINUSONE, MODE, NEWINDEX, NIL, NILS, NONE, NOVALS, ONE, TBOOLEAN, TFUNCTION, TINT, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TRUE, TSTRING, TTABLE, TTHREAD, TUSERDATA, TVALUE, TYPE_NAMES, ZERO
 
Constructor Summary
LuaTable()
           
LuaTable(int narray, int nhash)
           
LuaTable(LuaValue[] named, LuaValue[] unnamed, Varargs lastarg)
           
LuaTable(Varargs varargs)
           
LuaTable(Varargs varargs, int firstarg)
           
 
Method Summary
protected  LuaTable changemode(boolean weakkeys, boolean weakvalues)
           
 LuaTable checktable()
           
 LuaValue concat(LuaString sep, int i, int j)
           
 LuaValue foreach(LuaValue func)
          Call the supplied function once for each key-value pair
 LuaValue foreachi(LuaValue func)
          Call the supplied function once for each key-value pair in the contiguous array part
 LuaValue get(int key)
           
 LuaValue get(LuaValue key)
           
 LuaValue getmetatable()
           
 LuaValue getn()
           
 int hashFindSlot(LuaValue key)
           
 void hashset(LuaValue key, LuaValue value)
           
 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)
           
 boolean istable()
           
 LuaValue[] keys()
          Value used in testing to enumerate the keys
 LuaValue len()
           
 int length()
          Get the length of this table, as lua defines it.
 int maxn()
           
 Varargs next(LuaValue key)
          Get the next element after a particular key in the table
 LuaTable opttable(LuaTable defval)
           
 void presize(int i)
           
 LuaValue rawget(int key)
           
 LuaValue rawget(LuaValue key)
           
 void rawset(int key, LuaValue value)
           
 void rawset(LuaValue key, LuaValue value)
          caller must ensure key is not nil
protected  LuaTable recreateas(boolean weakkeys, boolean weakvalues)
           
 LuaValue remove(int pos)
           
 void set(int key, LuaValue value)
           
 void set(LuaValue key, LuaValue value)
          caller must ensure key is not nil
 LuaValue setmetatable(LuaValue metatable)
           
 void sort(LuaValue comparator)
           
 int type()
           
 java.lang.String typename()
           
 
Methods inherited from class org.luaj.vm2.LuaValue
add, add, add, and, arg, arg1, argerror, argerror, aritherror, aritherror, assert_, call, call, call, call, callerror, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checknumber, checkstring, checkString, checkthread, checkuserdata, checkuserdata, checkvalidkey, compareerror, compareerror, concat_s, concat, concatTo_s, div, divInto, eq_b, eq_b, eq_b, eq_b, eq, equals, error, get, getfenv, gettable, gt_b, gt_b, gt_b, gt, gteq_b, gteq_b, gteq_b, gteq, incr, invoke, invoke, invoke, invoke, invoke, invoke, invokemethod, invokemethod, invokemethod, invokemethod, isboolean, isclosure, isfunction, isint, isinttype, islong, isnil, isnumber, isstring, isthread, isuserdata, isuserdata, lenerror, listOf, listOf, load, lt_b, lt_b, lt_b, lt, lteq_b, lteq_b, lteq_b, lteq, metatag, method, method, method, method, method, method, mod, modFrom, mul, mul, mul, narg, neg, neq_b, neq_b, neq_b, neq, not, onInvoke, optboolean, optclosure, optdouble, optfunction, optint, optinteger, optjstring, optlong, optnumber, optstring, optString, optthread, optuserdata, optuserdata, optvalue, or, pow, powWith, powWith, rawget, rawset, rawset, rawset, rawset, rawset, rawsetlist, set, set, set, set, set, setfenv, settable, strcmp, strcmp, strongvalue, strvalue, sub, subFrom, subFrom, tableOf, tableOf, tableOf, tableOf, tableOf, tableOf, tailcallOf, testfor_b, testfor_b, 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, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf, varargsOf
 
Methods inherited from class org.luaj.vm2.Varargs
argcheck, checkboolean, checkclosure, checkdouble, checkfunction, checkint, checkinteger, checkjstring, checklong, checknotnil, checknumber, checkstring, 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, 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

array

protected LuaValue[] array

hashKeys

protected LuaValue[] hashKeys

hashValues

protected LuaValue[] hashValues
Constructor Detail

LuaTable

public LuaTable()

LuaTable

public LuaTable(int narray,
                int nhash)

LuaTable

public LuaTable(LuaValue[] named,
                LuaValue[] unnamed,
                Varargs lastarg)

LuaTable

public LuaTable(Varargs varargs)

LuaTable

public LuaTable(Varargs varargs,
                int firstarg)
Method Detail

type

public int type()
Specified by:
type in class LuaValue

typename

public java.lang.String typename()
Specified by:
typename in class LuaValue

istable

public boolean istable()
Overrides:
istable in class LuaValue

checktable

public LuaTable checktable()
Overrides:
checktable in class LuaValue

opttable

public LuaTable opttable(LuaTable defval)
Overrides:
opttable in class LuaValue

presize

public void presize(int i)
Overrides:
presize in class LuaValue

getmetatable

public LuaValue getmetatable()
Overrides:
getmetatable in class LuaValue

setmetatable

public LuaValue setmetatable(LuaValue metatable)
Overrides:
setmetatable in class LuaValue

changemode

protected LuaTable changemode(boolean weakkeys,
                              boolean weakvalues)

recreateas

protected LuaTable recreateas(boolean weakkeys,
                              boolean weakvalues)

get

public LuaValue get(int key)
Overrides:
get in class LuaValue

get

public LuaValue get(LuaValue key)
Overrides:
get in class LuaValue

rawget

public LuaValue rawget(int key)
Overrides:
rawget in class LuaValue

rawget

public LuaValue rawget(LuaValue key)
Overrides:
rawget in class LuaValue

set

public void set(int key,
                LuaValue value)
Overrides:
set in class LuaValue

set

public void set(LuaValue key,
                LuaValue value)
caller must ensure key is not nil

Overrides:
set in class LuaValue

rawset

public void rawset(int key,
                   LuaValue value)
Overrides:
rawset in class LuaValue

rawset

public void rawset(LuaValue key,
                   LuaValue value)
caller must ensure key is not nil

Overrides:
rawset in class LuaValue

remove

public LuaValue remove(int pos)

insert

public void insert(int pos,
                   LuaValue value)

concat

public LuaValue concat(LuaString sep,
                       int i,
                       int j)

getn

public LuaValue getn()
Overrides:
getn in class LuaValue

length

public int length()
Get the length of this table, as lua defines it.

Overrides:
length in class LuaValue

len

public LuaValue len()
Overrides:
len in class LuaValue

maxn

public int maxn()

next

public Varargs next(LuaValue key)
Get the next element after a particular key in the table

Overrides:
next in class LuaValue
Returns:
key,value or nil

inext

public Varargs inext(LuaValue key)
Get the next element after a particular key in the contiguous array part of a table

Overrides:
inext in class LuaValue
Returns:
key,value or nil

foreach

public LuaValue foreach(LuaValue func)
Call the supplied function once for each key-value pair

Parameters:
func - function to call

foreachi

public LuaValue foreachi(LuaValue func)
Call the supplied function once for each key-value pair in the contiguous array part

Parameters:
func -

keys

public LuaValue[] keys()
Value used in testing to enumerate the keys


hashset

public void hashset(LuaValue key,
                    LuaValue value)

hashFindSlot

public int hashFindSlot(LuaValue key)

sort

public void sort(LuaValue comparator)


Copyright © 2007-2013 Luaj.org. All Rights Reserved.