org.luaj.vm
Class LUserData

java.lang.Object
  extended by org.luaj.vm.LValue
      extended by org.luaj.vm.LUserData

public class LUserData
extends LValue


Field Summary
 java.lang.Object m_instance
           
 LTable m_metatable
           
 
Fields inherited from class org.luaj.vm.LValue
TM_INDEX, TM_METATABLE, TM_MODE, TM_NEWINDEX
 
Constructor Summary
LUserData(java.lang.Object obj)
           
LUserData(java.lang.Object obj, LTable metatable)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 int hashCode()
           
 boolean isUserData()
          Returns true if this is an LUserData
 boolean luaBinCmpUnknown(int opcode, LValue lhs)
           
 LTable luaGetMetatable()
          Valid for all types: get a metatable.
 int luaGetType()
          Valid for all types: return the int value identifying the type of this value
 java.lang.Object toJavaInstance()
          Convert to a Java Object iff this is a LUserData value
 java.lang.String toJavaString()
          Convert to a Java String
 
Methods inherited from class org.luaj.vm.LValue
compareError, conversionError, id, isClosure, isFunction, isInteger, isNil, isNumber, isString, isTable, luaAsString, luaBinCmpDouble, luaBinCmpInteger, luaBinCmpString, luaBinOpDouble, luaBinOpInteger, luaBinOpUnknown, luaConcatTo, luaGetEnv, luaGetTable, luaGetTypeName, luaLength, luaSetEnv, luaSetMetatable, luaSetTable, luaStackCall, luaToNumber, luaUnaryMinus, toJavaBoolean, toJavaBoxedBoolean, toJavaBoxedByte, toJavaBoxedCharacter, toJavaBoxedDouble, toJavaBoxedFloat, toJavaBoxedInteger, toJavaBoxedLong, toJavaBoxedShort, toJavaByte, toJavaChar, toJavaDouble, toJavaFloat, toJavaInt, toJavaLong, toJavaShort, toString, toStrongReference
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

m_instance

public final java.lang.Object m_instance

m_metatable

public LTable m_metatable
Constructor Detail

LUserData

public LUserData(java.lang.Object obj)

LUserData

public LUserData(java.lang.Object obj,
                 LTable metatable)
Method Detail

toJavaString

public java.lang.String toJavaString()
Description copied from class: LValue
Convert to a Java String

Overrides:
toJavaString in class LValue

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

luaGetType

public int luaGetType()
Description copied from class: LValue
Valid for all types: return the int value identifying the type of this value

Specified by:
luaGetType in class LValue

luaGetMetatable

public LTable luaGetMetatable()
Description copied from class: LValue
Valid for all types: get a metatable. Only tables and userdata can have a different metatable per instance, though, other types are restricted to one metatable per type. Since metatables on non-tables can only be set through Java and not Lua, this function should be overridden for each value type as necessary.

Overrides:
luaGetMetatable in class LValue
Returns:
null if there is no meta-table

toJavaInstance

public java.lang.Object toJavaInstance()
Description copied from class: LValue
Convert to a Java Object iff this is a LUserData value

Overrides:
toJavaInstance in class LValue

luaBinCmpUnknown

public boolean luaBinCmpUnknown(int opcode,
                                LValue lhs)
Overrides:
luaBinCmpUnknown in class LValue

isUserData

public boolean isUserData()
Description copied from class: LValue
Returns true if this is an LUserData

Overrides:
isUserData in class LValue


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