Remove deprecated functions.

This commit is contained in:
James Roseborough
2010-08-21 14:56:48 +00:00
parent d70ed23d1d
commit 31c7c5f2b5
3 changed files with 10 additions and 22 deletions

View File

@@ -561,12 +561,19 @@ public class LuaTable extends LuaValue {
array[j] = a;
}
/** @deprecated - count via iteration instead */
/** This may be deprecated in a future release.
* It is recommended to count via iteration over next() instead */
public int keyCount() {
return keys().length;
LuaValue k = LuaValue.NIL;
for ( int i=0; true; i++ ) {
Varargs n = next(k);
if ( (k = n.arg1()).isnil() )
return i;
}
}
/** @deprecated - use next() instead */
/** This may be deprecated in a future release.
* It is recommended to use next() instead */
public LuaValue[] keys() {
Vector l = new Vector();
LuaValue k = LuaValue.NIL;

View File

@@ -146,9 +146,6 @@ public class LuaValue extends Varargs {
public Object optuserdata(Class c, Object defval) { argerror(c.getName()); return null; }
public LuaValue optvalue(LuaValue defval) { return this; }
/** @deprecated - use optjstring() instead */
public String optString(String defval) { return optjstring(defval); }
// argument type checks
public boolean checkboolean() { argerror("boolean"); return false; }
public LuaClosure checkclosure() { argerror("closure"); return null; }
@@ -167,10 +164,6 @@ public class LuaValue extends Varargs {
public Object checkuserdata(Class c) { argerror("userdata"); return null; }
public LuaValue checknotnil() { return this; }
public LuaValue checkvalidkey() { return this; }
/** @deprecated - use checkjstring() instead */
public String checkString() { return checkjstring(); }
// errors
public static LuaValue error(String message) { throw new LuaError(message); }
@@ -359,14 +352,8 @@ public class LuaValue extends Varargs {
public LuaValue or( LuaValue rhs ) { return this.toboolean()? this: rhs; }
// for loop helpers
/** @deprecated - used during development only */
public boolean testfor_b(LuaValue limit, boolean stepgtzero) { return stepgtzero? lteq_b(limit): gteq_b(limit); }
/** used in for loop only */
public boolean testfor_b(LuaValue limit, LuaValue step) { return step.gt_b(0)? lteq_b(limit): gteq_b(limit); }
/** @deprecated - used in samples only */
public boolean testfor_b(LuaValue limit) { return lteq(limit).toboolean(); }
/** @deprecated - used in samples only, use add(1) instead */
public LuaValue incr() { return add(ONE); }
// lua number/string conversion
public LuaString strvalue() { typerror("strValue"); return null; }

View File

@@ -91,9 +91,6 @@ public abstract class Varargs {
public Object optuserdata(int i, Class c, Object defval) { return arg(i).optuserdata(c,defval); }
public LuaValue optvalue(int i, LuaValue defval) { return i>0 && i<=narg()? arg(i): defval; }
/** @deprecated - use optjstring() instead */
public String optString(int i, String defval) { return optjstring(i,defval); }
// required argument types
public boolean checkboolean(int i) { return arg(i).checkboolean(); }
public LuaClosure checkclosure(int i) { return arg(i).checkclosure(); }
@@ -112,9 +109,6 @@ public abstract class Varargs {
public LuaValue checkvalue(int i) { return i<=narg()? arg(i): LuaValue.argerror(i,"value expected"); }
public LuaValue checknotnil(int i) { return arg(i).checknotnil(); }
/** @deprecated - use checkjstring() instead */
public String checkString(int i) { return checkjstring(i); }
public void argcheck(boolean test, int i, String msg) { if (!test) LuaValue.argerror(i,msg); }
public boolean isnoneornil(int i) {