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 aLuaValue
on some Lua thread
-
-
Field Summary
Fields Modifier and Type Field Description protected T
L
protected Lua.LuaType
type
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractLuaValue(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()
boolean
equals(java.lang.Object o)
LuaValue
get(int i)
LuaValue
get(java.lang.String key)
LuaValue
get(LuaValue key)
int
hashCode()
int
length()
Returns the length of the array part of this Lua table.LuaValue
set(int key, java.lang.Object value)
Similar toLuaTableTrait.set(Object, Object)
LuaValue
set(java.lang.Object key, java.lang.Object value)
Similar toLuaTableTrait.put(LuaValue, LuaValue)
, but handles other Java types as wellLua
state()
boolean
toBoolean()
long
toInteger()
double
toNumber()
java.lang.Object
toProxy(java.lang.Class<?>[] interfaces, Lua.Conversion degree)
Creates a proxy from this value withLua.createProxy(Class[], Lua.Conversion)
.<I> I
toProxy(java.lang.Class<I> targetInterface)
Creates a proxy from this value withLua.createProxy(Class[], Lua.Conversion)
.Lua.LuaType
type()
-
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:LuaTableTrait
Returns the length of the array part of this Lua table.- Specified by:
length
in interfaceLuaTableTrait
- Returns:
- the length as would be returned by the Lua
#
operator
-
get
public LuaValue get(int i)
- Specified by:
get
in interfaceLuaTableTrait
- Parameters:
i
- the index- Returns:
thisLuaValue[i]
-
get
public LuaValue get(java.lang.String key)
- Specified by:
get
in interfaceLuaTableTrait
- Parameters:
key
- the key- Returns:
thisLuaValue[key]
-
get
public LuaValue get(LuaValue key)
- Specified by:
get
in interfaceLuaTableTrait
- Parameters:
key
- the key- Returns:
thisLuaValue[key]
-
set
public LuaValue set(int key, java.lang.Object value)
Description copied from interface:LuaTableTrait
Similar toLuaTableTrait.set(Object, Object)
- Specified by:
set
in interfaceLuaTableTrait
- Parameters:
key
- the keyvalue
- the value, either aLuaValue
type or any Java object- Returns:
- the previous value
-
set
public LuaValue set(java.lang.Object key, java.lang.Object value)
Description copied from interface:LuaTableTrait
Similar toLuaTableTrait.put(LuaValue, LuaValue)
, but handles other Java types as well- Specified by:
set
in interfaceLuaTableTrait
- Parameters:
key
- the key, either aLuaValue
type or any Java objectvalue
- the value, either aLuaValue
type or any Java object- Returns:
- the previous value
-
call
public LuaValue[] call(java.lang.Object... parameters)
Description copied from interface:LuaValue
PerformsthisLuaValue(parameter1, parameter2, ...)
-
toProxy
public <I> I toProxy(java.lang.Class<I> targetInterface)
Description copied from interface:LuaValue
Creates 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:LuaValue
Creates a proxy from this value withLua.createProxy(Class[], Lua.Conversion)
.
-
-