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