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