/** Return argument i as a java long value, discarding any fractional part and truncating, * or 0 if not a number. * @param i the index of the argument to convert, 1 is the first argument * @return long value with fraction discarded and truncated if necessary if argument i is number, otherwise 0 * */ public long tolong(int i) { return arg(i).tolong(); }
/** Return argument i as a java long value, discarding any fractional part and truncating, * or 0 if not a number. * @param i the index of the argument to convert, 1 is the first argument * @return long value with fraction discarded and truncated if necessary if argument i is number, otherwise 0 * */ public long tolong(int i) { return arg(i).tolong(); }
/** Return argument i as a java long value, discarding any fractional part and truncating, * or 0 if not a number. * @param i the index of the argument to convert, 1 is the first argument * @return long value with fraction discarded and truncated if necessary if argument i is number, otherwise 0 * */ public long tolong(int i) { return arg(i).tolong(); }
public long getLong(String name) { return env.get(name).tolong(); }
map.put(key.toString(), new Var(value.tolong()));
private static Object toJavaValue(LuaValue aValue) { if (aValue.isnil()) { return null; } if (aValue.istable()) { LuaTable theTable = (LuaTable) aValue; LuaValue theObject = theTable.get(LuaString.valueOf("javaobject")); if (theObject.isuserdata()) { return theObject.checkuserdata(); } throw new IllegalArgumentException("Cannot convert " + aValue+" to java object"); } if (aValue.isint()) { return aValue.toint(); } if (aValue.islong()) { return aValue.tolong(); } if (aValue.isstring()) { return aValue.toString(); } return aValue.toString(); }