JAL-1807
[jalview.git] / site / j2s / com / stevesoft / pat / Start.js
diff --git a/site/j2s/com/stevesoft/pat/Start.js b/site/j2s/com/stevesoft/pat/Start.js
new file mode 100644 (file)
index 0000000..1ef02d7
--- /dev/null
@@ -0,0 +1,35 @@
+Clazz.declarePackage ("com.stevesoft.pat");
+Clazz.load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.Start", ["com.stevesoft.pat.patInt"], function () {
+c$ = Clazz.decorateAsClass (function () {
+this.retIsStart = false;
+Clazz.instantialize (this, arguments);
+}, com.stevesoft.pat, "Start", com.stevesoft.pat.Pattern);
+Clazz.makeConstructor (c$, 
+function (b) {
+Clazz.superConstructor (this, com.stevesoft.pat.Start, []);
+this.retIsStart = b;
+}, "~B");
+Clazz.overrideMethod (c$, "matchInternal", 
+function (pos, pt) {
+if (this.retIsStart && pt.mFlag && pos > 0 && pt.src.charAt (pos - 1) == '\n') {
+return this.nextMatch (pos, pt);
+}if (pos == 0) {
+return this.nextMatch (pos, pt);
+}return -1;
+}, "~N,com.stevesoft.pat.Pthings");
+Clazz.overrideMethod (c$, "toString", 
+function () {
+if (this.retIsStart) {
+return "^" + this.nextString ();
+} else {
+return "\\A" + this.nextString ();
+}});
+Clazz.overrideMethod (c$, "maxChars", 
+function () {
+return  new com.stevesoft.pat.patInt (0);
+});
+Clazz.overrideMethod (c$, "clone1", 
+function (h) {
+return  new com.stevesoft.pat.Start (this.retIsStart);
+}, "java.util.Hashtable");
+});