JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.git] / site / j2s / com / stevesoft / pat / End.js
1 Clazz.declarePackage ("com.stevesoft.pat");\r
2 Clazz.load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.End", ["com.stevesoft.pat.patInt"], function () {\r
3 c$ = Clazz.decorateAsClass (function () {\r
4 this.retIsEnd = false;\r
5 Clazz.instantialize (this, arguments);\r
6 }, com.stevesoft.pat, "End", com.stevesoft.pat.Pattern);\r
7 Clazz.makeConstructor (c$, \r
8 function (b) {\r
9 Clazz.superConstructor (this, com.stevesoft.pat.End, []);\r
10 this.retIsEnd = b;\r
11 }, "~B");\r
12 Clazz.overrideMethod (c$, "matchInternal", \r
13 function (pos, pt) {\r
14 if (this.retIsEnd && pt.mFlag && pos < pt.src.length ()) {\r
15 if (pt.src.charAt (pos) == '\n') {\r
16 return this.nextMatch (pos, pt);\r
17 }}if (pt.src.length () == pos) {\r
18 return this.nextMatch (pos, pt);\r
19 } else if (pos < pt.src.length ()) {\r
20 pt.src.charAt (pos);\r
21 }return -1;\r
22 }, "~N,com.stevesoft.pat.Pthings");\r
23 Clazz.overrideMethod (c$, "toString", \r
24 function () {\r
25 if (this.retIsEnd) {\r
26 return "$";\r
27 } else {\r
28 return "\\Z";\r
29 }});\r
30 Clazz.overrideMethod (c$, "maxChars", \r
31 function () {\r
32 return  new com.stevesoft.pat.patInt (1);\r
33 });\r
34 Clazz.overrideMethod (c$, "clone1", \r
35 function (h) {\r
36 return  new com.stevesoft.pat.End (this.retIsEnd);\r
37 }, "java.util.Hashtable");\r
38 });\r