Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / com / stevesoft / pat / Pattern.js
index a4dc10b..a3dddd4 100644 (file)
-Clazz.declarePackage ("com.stevesoft.pat");\r
-Clazz.load (null, "com.stevesoft.pat.Pattern", ["com.stevesoft.pat.MessageManager", "$.patInf", "$.patInt", "java.lang.Error", "$.StringBuffer"], function () {\r
-c$ = Clazz.decorateAsClass (function () {\r
-this.next = null;\r
-this.parent = null;\r
-this.mfrom = 0;\r
-Clazz.instantialize (this, arguments);\r
-}, com.stevesoft.pat, "Pattern");\r
-Clazz.defineMethod (c$, "getNext", \r
-function () {\r
-return this.next != null ? this.next : (this.parent == null ? null : this.parent.getNext ());\r
-});\r
-Clazz.defineMethod (c$, "setParent", \r
-function (p) {\r
-if (this.next != null) {\r
-this.next.setParent (p);\r
-} else {\r
-this.parent = p;\r
-}}, "com.stevesoft.pat.Pattern");\r
-Clazz.defineMethod (c$, "nextMatch", \r
-function (i, pt) {\r
-var p = this.getNext ();\r
-return p == null ? i : p.matchInternal (i, pt);\r
-}, "~N,com.stevesoft.pat.Pthings");\r
-Clazz.defineMethod (c$, "nextString", \r
-function () {\r
-if (this.next == null) {\r
-return "";\r
-}return this.next.toString ();\r
-});\r
-c$.inString = Clazz.defineMethod (c$, "inString", \r
-function (c, s) {\r
-var i;\r
-for (i = 0; i < s.length; i++) {\r
-if (s.charAt (i) == c) {\r
-return true;\r
-}}\r
-return false;\r
-}, "~S,~S");\r
-c$.protect = Clazz.defineMethod (c$, "protect", \r
-function (s, PROTECT_THESE, esc) {\r
-var i;\r
-var sb =  new StringBuffer ();\r
-var p = PROTECT_THESE + esc;\r
-for (i = 0; i < s.length; i++) {\r
-var c = s.charAt (i);\r
-if (com.stevesoft.pat.Pattern.inString (c, p)) {\r
-sb.append (esc);\r
-}sb.append (c);\r
-}\r
-return sb.toString ();\r
-}, "~S,~S,~S");\r
-Clazz.defineMethod (c$, "match", \r
-function (s, pt) {\r
-return this.matchAt (s, 0, pt);\r
-}, "com.stevesoft.pat.StringLike,com.stevesoft.pat.Pthings");\r
-Clazz.defineMethod (c$, "matchAt", \r
-function (s, i, pt) {\r
-pt.src = s;\r
-var r = this.matchInternal (i, pt);\r
-if (r < 0) {\r
-return -1;\r
-}this.mfrom = r < i ? r + 1 : i;\r
-return r < i ? i - r - 1 : r - i;\r
-}, "com.stevesoft.pat.StringLike,~N,com.stevesoft.pat.Pthings");\r
-Clazz.defineMethod (c$, "Masked", \r
-function (i, pt) {\r
-return pt.cbits == null ? false : pt.cbits.get (i);\r
-}, "~N,com.stevesoft.pat.Pthings");\r
-Clazz.defineMethod (c$, "add", \r
-function (p) {\r
-if (this.next == null) {\r
-if (p == null) {\r
-return this;\r
-}this.next = p;\r
-p.parent = this.parent;\r
-this.parent = null;\r
-} else {\r
-this.next.add (p);\r
-}return this;\r
-}, "com.stevesoft.pat.Pattern");\r
-Clazz.defineMethod (c$, "minChars", \r
-function () {\r
-return  new com.stevesoft.pat.patInt (0);\r
-});\r
-Clazz.defineMethod (c$, "maxChars", \r
-function () {\r
-return  new com.stevesoft.pat.patInf ();\r
-});\r
-Clazz.defineMethod (c$, "countMinChars", \r
-function () {\r
-var p = this;\r
-var sum =  new com.stevesoft.pat.patInt (0);\r
-while (p != null) {\r
-sum.pluseq (p.minChars ());\r
-p = p.next;\r
-}\r
-return sum;\r
-});\r
-Clazz.defineMethod (c$, "countMaxChars", \r
-function () {\r
-var p = this;\r
-var sum =  new com.stevesoft.pat.patInt (0);\r
-while (p != null) {\r
-sum.pluseq (p.maxChars ());\r
-p = p.next;\r
-}\r
-return sum;\r
-});\r
-Clazz.defineMethod (c$, "testMatch", \r
-function (p, pos, pt) {\r
-var tab = null;\r
-if (pt.marks != null) {\r
-try {\r
-tab =  Clazz.newIntArray (pt.marks.length, 0);\r
-for (var i = 0; i < tab.length; i++) {\r
-tab[i] = pt.marks[i];\r
-}\r
-} catch (t) {\r
-}\r
-}var ret = p.matchInternal (pos, pt);\r
-if (ret < 0) {\r
-pt.marks = tab;\r
-}return ret;\r
-}, "com.stevesoft.pat.Pattern,~N,com.stevesoft.pat.Pthings");\r
-Clazz.defineMethod (c$, "clone1", \r
-function (h) {\r
-throw  new Error (com.stevesoft.pat.MessageManager.formatMessage ("error.no_such_method_as_clone1_for",  Clazz.newArray (-1, [this.getClass ().getName ()])));\r
-}, "java.util.Hashtable");\r
-Clazz.defineMethod (c$, "clone", \r
-function (h) {\r
-var p = h.get (this);\r
-if (p != null) {\r
-return p;\r
-}p = this.clone1 (h);\r
-if (p == null) {\r
-throw  new Error (com.stevesoft.pat.MessageManager.getString ("error.null_from_clone1"));\r
-}h.put (this, p);\r
-h.put (p, p);\r
-if (this.next != null) {\r
-p.next = this.next.clone (h);\r
-}if (this.parent != null) {\r
-p.parent = this.parent.clone (h);\r
-}return p;\r
-}, "java.util.Hashtable");\r
-Clazz.overrideMethod (c$, "equals", \r
-function (o) {\r
-return o === this;\r
-}, "~O");\r
-Clazz.defineStatics (c$,\r
-"ESC", '\\',\r
-"PROTECT_THESE", "[]{}(),$,-\"^.");\r
-});\r
+Clazz.declarePackage ("com.stevesoft.pat");
+Clazz.load (null, "com.stevesoft.pat.Pattern", ["com.stevesoft.pat.MessageManager", "$.patInf", "$.patInt", "java.lang.Error", "$.StringBuffer"], function () {
+c$ = Clazz.decorateAsClass (function () {
+this.next = null;
+this.parent = null;
+this.mfrom = 0;
+Clazz.instantialize (this, arguments);
+}, com.stevesoft.pat, "Pattern");
+Clazz.defineMethod (c$, "getNext", 
+function () {
+return this.next != null ? this.next : (this.parent == null ? null : this.parent.getNext ());
+});
+Clazz.defineMethod (c$, "setParent", 
+function (p) {
+if (this.next != null) {
+this.next.setParent (p);
+} else {
+this.parent = p;
+}}, "com.stevesoft.pat.Pattern");
+Clazz.defineMethod (c$, "nextMatch", 
+function (i, pt) {
+var p = this.getNext ();
+return p == null ? i : p.matchInternal (i, pt);
+}, "~N,com.stevesoft.pat.Pthings");
+Clazz.defineMethod (c$, "nextString", 
+function () {
+if (this.next == null) {
+return "";
+}return this.next.toString ();
+});
+c$.inString = Clazz.defineMethod (c$, "inString", 
+function (c, s) {
+var i;
+for (i = 0; i < s.length; i++) {
+if (s.charAt (i) == c) {
+return true;
+}}
+return false;
+}, "~S,~S");
+c$.protect = Clazz.defineMethod (c$, "protect", 
+function (s, PROTECT_THESE, esc) {
+var i;
+var sb =  new StringBuffer ();
+var p = PROTECT_THESE + esc;
+for (i = 0; i < s.length; i++) {
+var c = s.charAt (i);
+if (com.stevesoft.pat.Pattern.inString (c, p)) {
+sb.append (esc);
+}sb.append (c);
+}
+return sb.toString ();
+}, "~S,~S,~S");
+Clazz.defineMethod (c$, "match", 
+function (s, pt) {
+return this.matchAt (s, 0, pt);
+}, "com.stevesoft.pat.StringLike,com.stevesoft.pat.Pthings");
+Clazz.defineMethod (c$, "matchAt", 
+function (s, i, pt) {
+pt.src = s;
+var r = this.matchInternal (i, pt);
+if (r < 0) {
+return -1;
+}this.mfrom = r < i ? r + 1 : i;
+return r < i ? i - r - 1 : r - i;
+}, "com.stevesoft.pat.StringLike,~N,com.stevesoft.pat.Pthings");
+Clazz.defineMethod (c$, "Masked", 
+function (i, pt) {
+return pt.cbits == null ? false : pt.cbits.get (i);
+}, "~N,com.stevesoft.pat.Pthings");
+Clazz.defineMethod (c$, "add", 
+function (p) {
+if (this.next == null) {
+if (p == null) {
+return this;
+}this.next = p;
+p.parent = this.parent;
+this.parent = null;
+} else {
+this.next.add (p);
+}return this;
+}, "com.stevesoft.pat.Pattern");
+Clazz.defineMethod (c$, "minChars", 
+function () {
+return  new com.stevesoft.pat.patInt (0);
+});
+Clazz.defineMethod (c$, "maxChars", 
+function () {
+return  new com.stevesoft.pat.patInf ();
+});
+Clazz.defineMethod (c$, "countMinChars", 
+function () {
+var p = this;
+var sum =  new com.stevesoft.pat.patInt (0);
+while (p != null) {
+sum.pluseq (p.minChars ());
+p = p.next;
+}
+return sum;
+});
+Clazz.defineMethod (c$, "countMaxChars", 
+function () {
+var p = this;
+var sum =  new com.stevesoft.pat.patInt (0);
+while (p != null) {
+sum.pluseq (p.maxChars ());
+p = p.next;
+}
+return sum;
+});
+Clazz.defineMethod (c$, "testMatch", 
+function (p, pos, pt) {
+var tab = null;
+if (pt.marks != null) {
+try {
+tab =  Clazz.newIntArray (pt.marks.length, 0);
+for (var i = 0; i < tab.length; i++) {
+tab[i] = pt.marks[i];
+}
+} catch (t) {
+}
+}var ret = p.matchInternal (pos, pt);
+if (ret < 0) {
+pt.marks = tab;
+}return ret;
+}, "com.stevesoft.pat.Pattern,~N,com.stevesoft.pat.Pthings");
+Clazz.defineMethod (c$, "clone1", 
+function (h) {
+throw  new Error (com.stevesoft.pat.MessageManager.formatMessage ("error.no_such_method_as_clone1_for",  Clazz.newArray (-1, [this.getClass ().getName ()])));
+}, "java.util.Hashtable");
+Clazz.defineMethod (c$, "clone", 
+function (h) {
+var p = h.get (this);
+if (p != null) {
+return p;
+}p = this.clone1 (h);
+if (p == null) {
+throw  new Error (com.stevesoft.pat.MessageManager.getString ("error.null_from_clone1"));
+}h.put (this, p);
+h.put (p, p);
+if (this.next != null) {
+p.next = this.next.clone (h);
+}if (this.parent != null) {
+p.parent = this.parent.clone (h);
+}return p;
+}, "java.util.Hashtable");
+Clazz.overrideMethod (c$, "equals", 
+function (o) {
+return o === this;
+}, "~O");
+Clazz.defineStatics (c$,
+"ESC", '\\',
+"PROTECT_THESE", "[]{}(),$,-\"^.");
+});