JAL-1807 test
[jalviewjs.git] / bin / com / stevesoft / pat / BackRefRule.js
1 Clazz.declarePackage ("com.stevesoft.pat");
2 Clazz.load (["com.stevesoft.pat.ReplaceRule"], "com.stevesoft.pat.BackRefRule", null, function () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.n = 0;
5 Clazz.instantialize (this, arguments);
6 }, com.stevesoft.pat, "BackRefRule", com.stevesoft.pat.ReplaceRule);
7 Clazz.makeConstructor (c$, 
8 function (n) {
9 Clazz.superConstructor (this, com.stevesoft.pat.BackRefRule, []);
10 this.n = n;
11 }, "~N");
12 Clazz.overrideMethod (c$, "apply", 
13 function (sb, res) {
14 var x = res.stringMatchedI (this.n);
15 sb.append (x == null ? "" : x);
16 }, "com.stevesoft.pat.StringBufferLike,com.stevesoft.pat.RegRes");
17 Clazz.overrideMethod (c$, "toString1", 
18 function () {
19 return "$" + this.n;
20 });
21 Clazz.overrideMethod (c$, "clone1", 
22 function () {
23 return  new com.stevesoft.pat.BackRefRule (this.n);
24 });
25 });