File size: 922 Bytes
233f6d4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | Clazz.declarePackage ("J.export");
Clazz.load (["java.util.Hashtable"], "J.export.UseTable", null, function () {
c$ = Clazz.decorateAsClass (function () {
this.iObj = 0;
this.keyword = null;
this.term = '\0';
Clazz.instantialize (this, arguments);
}, J["export"], "UseTable", java.util.Hashtable);
Clazz.makeConstructor (c$,
function (keyword) {
Clazz.superConstructor (this, J["export"].UseTable, []);
this.keyword = keyword;
this.term = keyword.charAt (keyword.length - 1);
}, "~S");
Clazz.defineMethod (c$, "getDef",
function (key) {
if (this.containsKey (key)) return this.keyword + this.get (key) + this.term;
var id = "_" + (this.iObj++);
this.put (key, id);
return id;
}, "~S");
Clazz.defineMethod (c$, "getDefRet",
function (key, ret) {
if ((ret[0] = this.get (key)) != null) return true;
this.put (key, ret[0] = "_" + key.charAt (0) + (this.iObj++));
return false;
}, "~S,~A");
});
|