JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.git] / site / j2s / com / stevesoft / pat / TransPat.js
1 Clazz.declarePackage ("com.stevesoft.pat");\r
2 Clazz.load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.TransPat", ["com.stevesoft.pat.Regex"], function () {\r
3 c$ = Clazz.decorateAsClass (function () {\r
4 this.ra = null;\r
5 this.ra_len = 0;\r
6 this.pn = -1;\r
7 this.lastMatchedTo = -1;\r
8 Clazz.instantialize (this, arguments);\r
9 }, com.stevesoft.pat, "TransPat", com.stevesoft.pat.Pattern);\r
10 Clazz.prepareFields (c$, function () {\r
11 this.ra =  new Array (10);\r
12 });\r
13 Clazz.overrideMethod (c$, "toString", \r
14 function () {\r
15 return "(?#TransPat)";\r
16 });\r
17 Clazz.makeConstructor (c$, \r
18 function () {\r
19 Clazz.superConstructor (this, com.stevesoft.pat.TransPat, []);\r
20 });\r
21 Clazz.defineMethod (c$, "matchInternal", \r
22 function (pos, pt) {\r
23 for (var i = 0; i < this.ra_len; i++) {\r
24 pt.ignoreCase = this.ra[i].ignoreCase;\r
25 pt.mFlag = this.ra[i].mFlag;\r
26 pt.dotDoesntMatchCR = com.stevesoft.pat.Regex.dotDoesntMatchCR;\r
27 var r = this.ra[i].thePattern.matchInternal (pos, pt);\r
28 if (r >= 0) {\r
29 this.pn = i;\r
30 return r;\r
31 }}\r
32 this.pn = -1;\r
33 return -1;\r
34 }, "~N,com.stevesoft.pat.Pthings");\r
35 });\r