/** Return argument i as a LuaTable if a lua table, {@code defval} if nil, or throw a LuaError if any other type. * @param i the index of the argument to test, 1 is the first argument * @return LuaTable value if a table, or defval if not supplied or nil * @exception LuaError if the argument is not a lua table * */ public LuaTable opttable(int i, LuaTable defval) { return arg(i).opttable(defval); }
/** Return argument i as a LuaTable if a lua table, {@code defval} if nil, or throw a LuaError if any other type. * @param i the index of the argument to test, 1 is the first argument * @return LuaTable value if a table, or defval if not supplied or nil * @exception LuaError if the argument is not a lua table * */ public LuaTable opttable(int i, LuaTable defval) { return arg(i).opttable(defval); }
/** Return argument i as a LuaTable if a lua table, {@code defval} if nil, or throw a LuaError if any other type. * @param i the index of the argument to test, 1 is the first argument * @return LuaTable value if a table, or defval if not supplied or nil * @exception LuaError if the argument is not a lua table * */ public LuaTable opttable(int i, LuaTable defval) { return arg(i).opttable(defval); }
public LuaValue call(LuaValue value, LuaValue table) { LuaValue mt = table.opttable(null); switch ( value.type() ) { case TNIL: LuaNil.s_metatable = mt; break; case TNUMBER: LuaNumber.s_metatable = mt; break; case TBOOLEAN: LuaBoolean.s_metatable = mt; break; case TSTRING: LuaString.s_metatable = mt; break; case TFUNCTION: LuaFunction.s_metatable = mt; break; case TTHREAD: LuaThread.s_metatable = mt; break; default: value.setmetatable( mt ); } return value; } }
public LuaValue call(LuaValue value, LuaValue table) { LuaValue mt = table.opttable(null); switch ( value.type() ) { case TNIL: LuaNil.s_metatable = mt; break; case TNUMBER: LuaNumber.s_metatable = mt; break; case TBOOLEAN: LuaBoolean.s_metatable = mt; break; case TSTRING: LuaString.s_metatable = mt; break; case TFUNCTION: LuaFunction.s_metatable = mt; break; case TTHREAD: LuaThread.s_metatable = mt; break; default: value.setmetatable( mt ); } return value; } }
@Override public LuaValue call(LuaValue value, LuaValue table) { LuaValue mt = table.opttable(null); switch ( value.type() ) { case TNIL: LuaNil.s_metatable = mt; break; case TNUMBER: LuaNumber.s_metatable = mt; break; case TBOOLEAN: LuaBoolean.s_metatable = mt; break; case TSTRING: LuaString.s_metatable = mt; break; case TFUNCTION: LuaFunction.s_metatable = mt; break; case TTHREAD: LuaThread.s_metatable = mt; break; default: value.setmetatable( mt ); } return value; } }