X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=site%2Fj2s%2Fcom%2Fstevesoft%2Fpat%2FOrMark.js;h=7590a74d8af29f0fd9fc2304d1e059b410f3c459;hp=bf47fca8bd813740d849078e6f7f220f19f86a1c;hb=b9b7a352eee79b7764c3b09c9d19663075061d8c;hpb=7301a2415adab88038b291fc54caeeb3a5a47a44 diff --git a/site/j2s/com/stevesoft/pat/OrMark.js b/site/j2s/com/stevesoft/pat/OrMark.js index bf47fca..7590a74 100644 --- a/site/j2s/com/stevesoft/pat/OrMark.js +++ b/site/j2s/com/stevesoft/pat/OrMark.js @@ -1,54 +1,54 @@ -Clazz.declarePackage ("com.stevesoft.pat"); -Clazz.load (["com.stevesoft.pat.Or", "$.SubMark"], "com.stevesoft.pat.OrMark", null, function () { -c$ = Clazz.decorateAsClass (function () { -this.sm = null; -this.id = 0; -Clazz.instantialize (this, arguments); -}, com.stevesoft.pat, "OrMark", com.stevesoft.pat.Or); -Clazz.prepareFields (c$, function () { -this.sm = new com.stevesoft.pat.SubMark (); -}); -Clazz.makeConstructor (c$, -function (i) { -Clazz.superConstructor (this, com.stevesoft.pat.OrMark, []); -this.sm.om = this; -this.id = i; -}, "~N"); -Clazz.overrideMethod (c$, "leftForm", -function () { -return "("; -}); -Clazz.defineMethod (c$, "getNext", -function () { -return this.sm; -}); -Clazz.defineMethod (c$, "matchInternal", -function (pos, pt) { -this.sm.next = Clazz.superCall (this, com.stevesoft.pat.OrMark, "getNext", []); -if (pt.marks == null) { -var n2 = 2 * pt.nMarks + 2; -pt.marks = Clazz.newIntArray (n2, 0); -for (var i = 0; i < n2; i++) { -pt.marks[i] = -1; -} -}pt.marks[this.id] = pos; -var ret = Clazz.superCall (this, com.stevesoft.pat.OrMark, "matchInternal", [pos, pt]); -if (ret < 0) { -pt.marks[this.id] = -1; -} else if (pt.marks[this.id] > pt.marks[this.id + pt.nMarks]) { -var swap = pt.marks[this.id]; -pt.marks[this.id] = pt.marks[this.id + pt.nMarks] + 1; -pt.marks[this.id + pt.nMarks] = swap + 1; -}return ret; -}, "~N,com.stevesoft.pat.Pthings"); -Clazz.overrideMethod (c$, "clone1", -function (h) { -var om = new com.stevesoft.pat.OrMark (this.id); -h.put (om, om); -h.put (this, om); -for (var i = 0; i < this.v.size (); i++) { -om.v.addElement ((this.v.elementAt (i)).clone (h)); -} -return om; -}, "java.util.Hashtable"); -}); +Clazz.declarePackage ("com.stevesoft.pat"); +Clazz.load (["com.stevesoft.pat.Or", "$.SubMark"], "com.stevesoft.pat.OrMark", null, function () { +c$ = Clazz.decorateAsClass (function () { +this.sm = null; +this.id = 0; +Clazz.instantialize (this, arguments); +}, com.stevesoft.pat, "OrMark", com.stevesoft.pat.Or); +Clazz.prepareFields (c$, function () { +this.sm = new com.stevesoft.pat.SubMark (); +}); +Clazz.makeConstructor (c$, +function (i) { +Clazz.superConstructor (this, com.stevesoft.pat.OrMark, []); +this.sm.om = this; +this.id = i; +}, "~N"); +Clazz.overrideMethod (c$, "leftForm", +function () { +return "("; +}); +Clazz.defineMethod (c$, "getNext", +function () { +return this.sm; +}); +Clazz.defineMethod (c$, "matchInternal", +function (pos, pt) { +this.sm.next = Clazz.superCall (this, com.stevesoft.pat.OrMark, "getNext", []); +if (pt.marks == null) { +var n2 = 2 * pt.nMarks + 2; +pt.marks = Clazz.newIntArray (n2, 0); +for (var i = 0; i < n2; i++) { +pt.marks[i] = -1; +} +}pt.marks[this.id] = pos; +var ret = Clazz.superCall (this, com.stevesoft.pat.OrMark, "matchInternal", [pos, pt]); +if (ret < 0) { +pt.marks[this.id] = -1; +} else if (pt.marks[this.id] > pt.marks[this.id + pt.nMarks]) { +var swap = pt.marks[this.id]; +pt.marks[this.id] = pt.marks[this.id + pt.nMarks] + 1; +pt.marks[this.id + pt.nMarks] = swap + 1; +}return ret; +}, "~N,com.stevesoft.pat.Pthings"); +Clazz.overrideMethod (c$, "clone1", +function (h) { +var om = new com.stevesoft.pat.OrMark (this.id); +h.put (om, om); +h.put (this, om); +for (var i = 0; i < this.v.size (); i++) { +om.v.addElement ((this.v.elementAt (i)).clone (h)); +} +return om; +}, "java.util.Hashtable"); +});