New implementation for Lua tables. Does not use Vector or Hashtable, instead

uses plain Java arrays directly to keep heap allocation to a minimum.
Includes some unit tests that seem to indicate the basic operations are
correct. However, the following things are not implemented:

* Shrinking the capacity when elements are removed
* Optimal storage of each element in array vs. hash when entries are
  added out of order. A junit test case is there for this.
This commit is contained in:
Ian Farmer
2007-09-03 00:38:38 +00:00
parent 79d5642bfd
commit b8571b93f9
8 changed files with 629 additions and 174 deletions

View File

@@ -19,4 +19,9 @@ public class LNumber extends LValue {
return TYPE_NAME;
}
/**
* Returns false by default for non-LNumbers, but subclasses of LNumber must
* override.
*/
public abstract boolean isInteger();
}