public class WeakTable extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
WeakTable.WeakSlot |
| 构造器和说明 |
|---|
WeakTable(boolean weakkeys,
boolean weakvalues,
LuaValue backing)
Construct a table with weak keys, weak values, or both
|
| 限定符和类型 | 方法和说明 |
|---|---|
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.
|
org.luaj.vm2.LuaTable.Slot |
entry(LuaValue key,
LuaValue value)
Return an instance of Slot appropriate for the given key and value.
|
static LuaTable |
make(boolean weakkeys,
boolean weakvalues) |
protected static LuaValue |
strengthen(Object ref)
Unwrap a LuaValue from a WeakReference and/or WeakUserdata.
|
LuaValue |
toLuaValue()
Return this metatable as a LuaValue.
|
boolean |
useWeakKeys()
Return whether or not this table's keys are weak.
|
boolean |
useWeakValues()
Return whether or not this table's values are weak.
|
protected static LuaValue |
weaken(LuaValue value)
Self-sent message to convert a value to its weak counterpart
|
LuaValue |
wrap(LuaValue value)
Returns the given value wrapped in a weak reference if appropriate.
|
public WeakTable(boolean weakkeys,
boolean weakvalues,
LuaValue backing)
weakkeys - true to let the table have weak keysweakvalues - true to let the table have weak valuespublic static LuaTable make(boolean weakkeys, boolean weakvalues)
public boolean useWeakKeys()
public boolean useWeakValues()
public LuaValue toLuaValue()
public org.luaj.vm2.LuaTable.Slot entry(LuaValue key, LuaValue value)
protected static LuaValue weaken(LuaValue value)
value - value to convertLuaValue that is a strong or weak reference, depending on type of valueprotected static LuaValue strengthen(Object ref)
ref - reference to convertweaken(LuaValue)public LuaValue wrap(LuaValue value)
Copyright © 2020. All rights reserved.