/** Convert java int to a {@link LuaValue}. * * @param i int value to convert * @return {@link LuaInteger} instance, possibly pooled, whose value is i */ public static LuaInteger valueOf(int i) { return LuaInteger.valueOf(i); }
@Override public LuaValue call() { return LuaInteger.valueOf(mStatusCode); } });
/** Convert java int to a {@link LuaValue}. * * @param i int value to convert * @return {@link LuaInteger} instance, possibly pooled, whose value is i */ public static LuaInteger valueOf(int i) { return LuaInteger.valueOf(i); }
/** Convert java int to a {@link LuaValue}. * * @param i int value to convert * @return {@link LuaInteger} instance, possibly pooled, whose value is i */ public static LuaInteger valueOf(int i) { return LuaInteger.valueOf(i); }
public LuaValue coerce( Object javaValue ) { Character c = (Character) javaValue; return LuaInteger.valueOf( c.charValue() ); } }
public LuaValue coerce( Object javaValue ) { Number n = (Number) javaValue; return LuaInteger.valueOf( n.intValue() ); } }
public LuaValue coerce( Object javaValue ) { Character c = (Character) javaValue; return LuaInteger.valueOf( c.charValue() ); } }
/** Set a value in a table without metatag processing using {@link #NEWINDEX}. * @param key the key to use * @param value the value to use, can be {@link #NIL}, must not be null * @throws LuaError if {@code this} is not a table, * or there is no {@link #NEWINDEX} metatag */ public void set( int key, LuaValue value ) { set(LuaInteger.valueOf(key), value ); }
/** Set a value in a table without metatag processing using {@link #NEWINDEX}. * @param key the key to use * @param value the value to use, can be {@link #NIL}, must not be null * @throws LuaError if {@code this} is not a table, * or there is no {@link #NEWINDEX} metatag */ public void set( int key, LuaValue value ) { set(LuaInteger.valueOf(key), value ); }
int numberK(LuaValue r) { if ( r instanceof LuaDouble ) { double d = r.todouble(); int i = (int) d; if ( d == (double) i ) r = LuaInteger.valueOf(i); } return this.addk(r); }
public void rawset( int key, LuaValue value ) { if ( ! arrayset(key, value) ) hashset( LuaInteger.valueOf(key), value ); }
private static LuaTable arrayToTable(Object[] arrayObj){ LuaTable table = new LuaTable(); for( int i = 0; i < arrayObj.length; i++ ){ table.set( LuaInteger.valueOf( i + 1), CoerceJavaToLua.coerce(arrayObj[i])); } return table; } }
@Override public LuaValue call(LuaValue arg) { int res = ResourceUtils.getColor(arg.tojstring(), sandBoxContext .getAndroidContext()); return LuaInteger.valueOf(res); } });
/** * Load a number from a binary chunk * @return the {@link LuaValue} loaded * @throws IOException if an i/o exception occurs */ LuaValue loadNumber() throws IOException { if ( luacNumberFormat == NUMBER_FORMAT_INTS_ONLY ) { return LuaInteger.valueOf( loadInt() ); } else { return longBitsToLuaNumber( loadInt64() ); } }
/** * Get the next element after a particular key in the * contiguous array part of a table * @return key,value or none */ public Varargs inext(LuaValue key) { int k = key.checkint() + 1; LuaValue v = rawget(k); return v.isnil()? NONE: varargsOf(LuaInteger.valueOf(k),v); }
public LuaValue len() { final LuaValue h = metatag(LEN); if (h.toboolean()) return h.call(this); return LuaInteger.valueOf(rawlen()); }
@Override public void set( int key, LuaValue value ) { if ( m_metatable==null || ! rawget(key).isnil() || ! settable(this,LuaInteger.valueOf(key),value) ) rawset(key, value); }
/** * Get the next element after a particular key in the * contiguous array part of a table * @return key,value or none */ @Override public Varargs inext(LuaValue key) { int k = key.checkint() + 1; LuaValue v = rawget(k); return v.isnil()? NONE: varargsOf(LuaInteger.valueOf(k),v); }
/** * Get the next element after a particular key in the * contiguous array part of a table * @return key,value or none */ public Varargs inext(LuaValue key) { int k = key.checkint() + 1; LuaValue v = rawget(k); return v.isnil()? NONE: varargsOf(LuaInteger.valueOf(k),v); }
public void set( int key, LuaValue value ) { if ( m_metatable==null || ! rawget(key).isnil() || ! settable(this,LuaInteger.valueOf(key),value) ) rawset(key, value); }