Package party.iroiro.luajava.value
Class AbstractLuaValue<T extends Lua>
- Type Parameters:
T- the Lua thread type
- All Implemented Interfaces:
Map<LuaValue,,LuaValue> LuaTableTrait,LuaValue
- Direct Known Subclasses:
AbstractRefLuaValue,ImmutableLuaValue
public abstract class AbstractLuaValue<T extends Lua>
extends AbstractMap<LuaValue,LuaValue>
implements LuaValue
Basic implementation of a
LuaValue on some Lua thread-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final TThe Lua state this value belongs to.protected final Lua.LuaTypeThe Lua type of this value. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractLuaValue(T L, Lua.LuaType type) Creates a new AbstractLuaValue. -
Method Summary
Modifier and TypeMethodDescriptionLuaValue[]PerformsthisLuaValue(parameter1, parameter2, ...)entrySet()booleanget(int i) Gets the value at the specified integer index from the table.Gets the value at the specified string key from the table.Gets the value at the specified Lua value key from the table.inthashCode()intlength()Returns the length of the array part of this Lua table.Similar toLuaTableTrait.set(Object, Object)Similar toLuaTableTrait.put(LuaValue, LuaValue), but handles other Java types as wellstate()Returns the Lua state where this value resides.booleantoBuffer()longdoubletoNumber()toProxy(Class<?>[] interfaces, Lua.Conversion degree) Creates a proxy from this value withLua.createProxy(Class[], Lua.Conversion).<I> ICreates a proxy from this value withLua.createProxy(Class[], Lua.Conversion).type()Returns the type of this Lua value.Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, get, isEmpty, keySet, put, putAll, remove, size, toString, valuesMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface party.iroiro.luajava.value.LuaTableTrait
get, put, sizeMethods inherited from interface party.iroiro.luajava.value.LuaValue
push, toJavaObject, toStringMethods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, forEach, getOrDefault, isEmpty, keySet, merge, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, values
-
Field Details
-
L
The Lua state this value belongs to. -
type
The Lua type of this value.
-
-
Constructor Details
-
AbstractLuaValue
Creates a new AbstractLuaValue.- Parameters:
L- the Lua state this value belongs totype- the Lua type of this value
-
-
Method Details
-
type
Description copied from interface:LuaValueReturns the type of this Lua value. -
state
Description copied from interface:LuaValueReturns the Lua state where this value resides. -
equals
-
hashCode
public int hashCode() -
entrySet
-
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
Description copied from interface:LuaTableTraitGets the value at the specified integer index from the table.- Specified by:
getin interfaceLuaTableTrait- Parameters:
i- the index- Returns:
thisLuaValue[i]
-
get
Description copied from interface:LuaTableTraitGets the value at the specified string key from the table.- Specified by:
getin interfaceLuaTableTrait- Parameters:
key- the key- Returns:
thisLuaValue[key]
-
get
Description copied from interface:LuaTableTraitGets the value at the specified Lua value key from the table.- Specified by:
getin interfaceLuaTableTrait- Parameters:
key- the key- Returns:
thisLuaValue[key]
-
set
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
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
Description copied from interface:LuaValuePerformsthisLuaValue(parameter1, parameter2, ...) -
toNumber
public double toNumber() -
toInteger
public long toInteger() -
toBoolean
public boolean toBoolean() -
toBuffer
-
toProxy
Description copied from interface:LuaValueCreates a proxy from this value withLua.createProxy(Class[], Lua.Conversion). -
toProxy
Description copied from interface:LuaValueCreates a proxy from this value withLua.createProxy(Class[], Lua.Conversion).
-