Package party.iroiro.luajava.value
Class AbstractLuaValue<T extends Lua>
- java.lang.Object
-
- Type Parameters:
T- the Lua thread type
- All Implemented Interfaces:
java.util.Map<LuaValue,LuaValue>,LuaTableTrait,LuaValue
- Direct Known Subclasses:
AbstractRefLuaValue,ImmutableLuaValue
public abstract class AbstractLuaValue<T extends Lua> extends java.util.AbstractMap<LuaValue,LuaValue> implements LuaValue
Basic implementation of aLuaValueon some Lua thread
-
-
Field Summary
Fields Modifier and Type Field Description protected TLprotected Lua.LuaTypetype
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractLuaValue(T L, Lua.LuaType type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LuaValue[]call(java.lang.Object... parameters)PerformsthisLuaValue(parameter1, parameter2, ...)@NotNull java.util.Set<java.util.Map.Entry<LuaValue,LuaValue>>entrySet()booleanequals(java.lang.Object o)LuaValueget(int i)LuaValueget(java.lang.String key)LuaValueget(LuaValue key)inthashCode()intlength()Returns the length of the array part of this Lua table.LuaValueset(int key, java.lang.Object value)Similar toLuaTableTrait.set(Object, Object)LuaValueset(java.lang.Object key, java.lang.Object value)Similar toLuaTableTrait.put(LuaValue, LuaValue), but handles other Java types as wellLuastate()booleantoBoolean()longtoInteger()doubletoNumber()java.lang.ObjecttoProxy(java.lang.Class<?>[] interfaces, Lua.Conversion degree)Creates a proxy from this value withLua.createProxy(Class[], Lua.Conversion).<I> ItoProxy(java.lang.Class<I> targetInterface)Creates a proxy from this value withLua.createProxy(Class[], Lua.Conversion).Lua.LuaTypetype()-
Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, get, isEmpty, keySet, put, putAll, remove, size, toString, values
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface party.iroiro.luajava.value.LuaTableTrait
get, put, size
-
Methods inherited from interface party.iroiro.luajava.value.LuaValue
push, toJavaObject, toString
-
-
-
-
Field Detail
-
type
protected final Lua.LuaType type
-
-
Constructor Detail
-
AbstractLuaValue
protected AbstractLuaValue(T L, Lua.LuaType type)
-
-
Method Detail
-
type
public Lua.LuaType type()
-
state
public Lua state()
-
equals
public boolean equals(java.lang.Object o)
-
hashCode
public int hashCode()
-
length
public int length()
Description copied from interface:LuaTableTraitReturns the length of the array part of this Lua table.- Specified by:
lengthin interfaceLuaTableTrait- Returns:
- the length as would be returned by the Lua
#operator
-
get
public LuaValue get(int i)
- Specified by:
getin interfaceLuaTableTrait- Parameters:
i- the index- Returns:
thisLuaValue[i]
-
get
public LuaValue get(java.lang.String key)
- Specified by:
getin interfaceLuaTableTrait- Parameters:
key- the key- Returns:
thisLuaValue[key]
-
get
public LuaValue get(LuaValue key)
- Specified by:
getin interfaceLuaTableTrait- Parameters:
key- the key- Returns:
thisLuaValue[key]
-
set
public LuaValue set(int key, java.lang.Object value)
Description copied from interface:LuaTableTraitSimilar toLuaTableTrait.set(Object, Object)- Specified by:
setin interfaceLuaTableTrait- Parameters:
key- the keyvalue- the value, either aLuaValuetype or any Java object- Returns:
- the previous value
-
set
public LuaValue set(java.lang.Object key, java.lang.Object value)
Description copied from interface:LuaTableTraitSimilar toLuaTableTrait.put(LuaValue, LuaValue), but handles other Java types as well- Specified by:
setin interfaceLuaTableTrait- Parameters:
key- the key, either aLuaValuetype or any Java objectvalue- the value, either aLuaValuetype or any Java object- Returns:
- the previous value
-
call
public LuaValue[] call(java.lang.Object... parameters)
Description copied from interface:LuaValuePerformsthisLuaValue(parameter1, parameter2, ...)
-
toProxy
public <I> I toProxy(java.lang.Class<I> targetInterface)
Description copied from interface:LuaValueCreates a proxy from this value withLua.createProxy(Class[], Lua.Conversion).
-
toProxy
public java.lang.Object toProxy(java.lang.Class<?>[] interfaces, Lua.Conversion degree)Description copied from interface:LuaValueCreates a proxy from this value withLua.createProxy(Class[], Lua.Conversion).
-
-