Add LTable.put(String,int) utility function

This commit is contained in:
James Roseborough
2008-04-03 15:33:51 +00:00
parent 35ed9dca3c
commit 727f8725d2

View File

@@ -146,6 +146,14 @@ public class LTable extends LValue {
put( new LString( key ), value );
}
/**
* Utility method for putting a string key, int value directly, typically for
* initializing a table. Bypasses the metatable, if any.
*/
public void put( String key, int value ) {
put( new LString( key ), LInteger.valueOf(value) );
}
/**
* Method for putting an integer-keyed value. Bypasses the metatable, if
* any.