org.luaj.vm
Class LClosure

java.lang.Object
  extended by org.luaj.vm.LValue
      extended by org.luaj.vm.LFunction
          extended by org.luaj.vm.LClosure

public class LClosure
extends LFunction


Field Summary
 LTable env
           
 LPrototype p
           
 UpVal[] upVals
           
 
Fields inherited from class org.luaj.vm.LValue
TM_INDEX, TM_METATABLE, TM_MODE, TM_NEWINDEX
 
Constructor Summary
protected LClosure(LPrototype p, LTable env)
          Construct using a prototype and initial environment.
 
Method Summary
 boolean isClosure()
          Returns true if this is a lua closure, false otherwise
 LTable luaGetEnv(LTable d)
          Get the enviroment for this closure
 boolean luaSetEnv(LTable t)
          Set the environment if a thread, or closure, and return 1, otherwise return 0
 boolean luaStackCall(LuaState vm)
          Set up a Java invocation, and leave the results on the stack starting at base.
 
Methods inherited from class org.luaj.vm.LFunction
__index, __newindex, invoke, isFunction, luaGetType, toJavaString
 
Methods inherited from class org.luaj.vm.LValue
compareError, conversionError, id, isInteger, isNil, isNumber, isString, isTable, isUserData, isValidKey, luaAsString, luaBinCmpDouble, luaBinCmpInteger, luaBinCmpString, luaBinCmpUnknown, luaBinOpDouble, luaBinOpInteger, luaBinOpUnknown, luaConcatTo, luaGetMetatable, luaGetTable, luaGetTypeName, luaLength, luaSetMetatable, luaSetTable, luaToNumber, luaUnaryMinus, toJavaBoolean, toJavaBoxedBoolean, toJavaBoxedByte, toJavaBoxedCharacter, toJavaBoxedDouble, toJavaBoxedFloat, toJavaBoxedInteger, toJavaBoxedLong, toJavaBoxedShort, toJavaByte, toJavaChar, toJavaDouble, toJavaFloat, toJavaInstance, toJavaInt, toJavaLong, toJavaShort, toString, toStrongReference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

p

public LPrototype p

upVals

public UpVal[] upVals

env

public LTable env
Constructor Detail

LClosure

protected LClosure(LPrototype p,
                   LTable env)
Construct using a prototype and initial environment.

Parameters:
p -
env -
Method Detail

luaStackCall

public boolean luaStackCall(LuaState vm)
Description copied from class: LFunction
Set up a Java invocation, and leave the results on the stack starting at base. The default implementation for LFunction delegates to the VM which provides convenience.

Overrides:
luaStackCall in class LFunction

luaSetEnv

public boolean luaSetEnv(LTable t)
Set the environment if a thread, or closure, and return 1, otherwise return 0

Overrides:
luaSetEnv in class LValue

luaGetEnv

public LTable luaGetEnv(LTable d)
Get the enviroment for this closure

Overrides:
luaGetEnv in class LValue
Parameters:
d - global environment to return if this is not a closure

isClosure

public boolean isClosure()
Returns true if this is a lua closure, false otherwise

Overrides:
isClosure in class LValue


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