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