X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=bin%2Fcom%2Fstevesoft%2Fpat%2FRegRes.js;h=9a31c29a90578a1a97277fdae64d8a9e8e851808;hp=ec4def19be8246886a47b86914ff14d4d78e038a;hb=8ffd05b3abe52c0b6b79b011c0966361f82d5fe6;hpb=6154cb57a6eac3bb1344b8342495f5bb701ee921 diff --git a/bin/com/stevesoft/pat/RegRes.js b/bin/com/stevesoft/pat/RegRes.js index ec4def1..9a31c29 100644 --- a/bin/com/stevesoft/pat/RegRes.js +++ b/bin/com/stevesoft/pat/RegRes.js @@ -1,155 +1,155 @@ -Clazz.declarePackage ("com.stevesoft.pat"); -Clazz.load (null, "com.stevesoft.pat.RegRes", ["java.lang.StringBuffer"], function () { -c$ = Clazz.decorateAsClass (function () { -this.marks = null; -this.didMatch_ = false; -this.src = null; -this.charsMatched_ = 0; -this.matchFrom_ = 0; -this.numSubs_ = 0; -Clazz.instantialize (this, arguments); -}, com.stevesoft.pat, "RegRes"); -Clazz.defineMethod (c$, "getString", -function () { -return this.src.toString (); -}); -Clazz.defineMethod (c$, "getStringLike", -function () { -return this.src; -}); -Clazz.overrideMethod (c$, "toString", -function () { -var sb = new StringBuffer (); -sb.append ("match=" + this.matchedFrom () + ":" + this.charsMatched ()); -if (!this.didMatch ()) { -return sb.toString (); -}for (var i = 0; i < this.numSubs (); i++) { -var n = i + 1; -sb.append (" sub(" + n + ")=" + this.matchedFromI (n) + ":" + this.charsMatchedI (n)); -} -return sb.toString (); -}); -Clazz.defineMethod (c$, "copyOutOf", -function (r) { -if (r.marks == null) { -this.marks = null; -} else { -try { -this.marks = Clazz.newIntArray (r.marks.length, 0); -for (var i = 0; i < this.marks.length; i++) { -this.marks[i] = r.marks[i]; -} -} catch (t) { -} -}this.didMatch_ = r.didMatch_; -this.src = r.src; -this.charsMatched_ = r.charsMatched_; -this.matchFrom_ = r.matchFrom_; -this.numSubs_ = r.numSubs_; -}, "com.stevesoft.pat.RegRes"); -Clazz.defineMethod (c$, "equals", -function (r) { -if (this.charsMatched_ != r.charsMatched_ || this.matchFrom_ != r.matchFrom_ || this.didMatch_ != r.didMatch_ || this.numSubs_ != r.numSubs_ || !this.src.unwrap ().equals (r.src.unwrap ())) { -return false; -}if (this.marks == null && r.marks != null) { -return false; -}if (this.marks != null && r.marks == null) { -return false; -}for (var i = 1; i <= this.numSubs_; i++) { -if (this.matchedFromI (i) != r.matchedFromI (i)) { -return false; -} else if (this.charsMatchedI (i) != r.charsMatchedI (i)) { -return false; -}} -return true; -}, "com.stevesoft.pat.RegRes"); -Clazz.defineMethod (c$, "stringMatched", -function () { -var mf = this.matchedFrom (); -var cm = this.charsMatched (); -return !this.didMatch_ || mf < 0 || cm < 0 ? null : this.src.substring (mf, mf + cm); -}); -Clazz.defineMethod (c$, "matchedFromI", -function (i) { -if (this.marks == null || i > this.numSubs_) { -return -1; -}return this.marks[i]; -}, "~N"); -Clazz.defineMethod (c$, "charsMatchedI", -function (i) { -if (this.marks == null || i > this.numSubs_ || !this.didMatch_) { -return -1; -}var mf = this.matchedFromI (i); -return mf < 0 ? -1 : this.marks[i + this.numSubs_] - this.matchedFromI (i); -}, "~N"); -Clazz.defineMethod (c$, "matchedToI", -function (i) { -if (this.marks == null || i > this.numSubs_ || !this.didMatch_) { -return -1; -}return this.marks[i + this.numSubs_]; -}, "~N"); -Clazz.defineMethod (c$, "stringMatchedI", -function (i) { -var mf = this.matchedFromI (i); -var cm = this.charsMatchedI (i); -return !this.didMatch_ || mf < 0 || cm < 0 ? null : this.src.substring (mf, mf + cm); -}, "~N"); -Clazz.defineMethod (c$, "left", -function () { -var mf = this.matchedFrom (); -return !this.didMatch_ || (mf < 0) ? null : this.src.substring (0, mf); -}); -Clazz.defineMethod (c$, "leftI", -function (i) { -var mf = this.matchedFromI (i); -return !this.didMatch_ || (mf < 0) ? null : this.src.substring (0, mf); -}, "~N"); -Clazz.defineMethod (c$, "right", -function () { -var mf = this.matchedFrom (); -var cm = this.charsMatched (); -return !this.didMatch_ || mf < 0 || cm < 0 ? null : this.src.substring (mf + cm, this.src.length ()); -}); -Clazz.defineMethod (c$, "rightI", -function (i) { -var mf = this.matchedFromI (i); -var cm = this.charsMatchedI (i); -return !this.didMatch_ || mf < 0 || cm < 0 ? null : this.src.substring (mf + cm, this.src.length ()); -}, "~N"); -Clazz.defineMethod (c$, "matchedFrom", -function () { -return !this.didMatch_ ? -1 : this.matchFrom_; -}); -Clazz.defineMethod (c$, "charsMatched", -function () { -return !this.didMatch_ || this.matchFrom_ < 0 ? -1 : this.charsMatched_; -}); -Clazz.defineMethod (c$, "matchedTo", -function () { -return !this.didMatch_ ? -1 : this.matchFrom_ + this.charsMatched_; -}); -Clazz.defineMethod (c$, "numSubs", -function () { -return this.numSubs_; -}); -Clazz.defineMethod (c$, "didMatch", -function () { -return this.didMatch_; -}); -Clazz.defineMethod (c$, "matchFrom", -function () { -return this.matchedFrom (); -}); -Clazz.defineMethod (c$, "substring", -function () { -return this.stringMatched (); -}); -Clazz.defineMethod (c$, "matchFromI", -function (i) { -return this.matchedFromI (i); -}, "~N"); -Clazz.defineMethod (c$, "substringI", -function (i) { -return this.stringMatchedI (i); -}, "~N"); -}); +Clazz.declarePackage ("com.stevesoft.pat"); +Clazz.load (null, "com.stevesoft.pat.RegRes", ["java.lang.StringBuffer"], function () { +c$ = Clazz.decorateAsClass (function () { +this.marks = null; +this.didMatch_ = false; +this.src = null; +this.charsMatched_ = 0; +this.matchFrom_ = 0; +this.numSubs_ = 0; +Clazz.instantialize (this, arguments); +}, com.stevesoft.pat, "RegRes"); +Clazz.defineMethod (c$, "getString", +function () { +return this.src.toString (); +}); +Clazz.defineMethod (c$, "getStringLike", +function () { +return this.src; +}); +Clazz.overrideMethod (c$, "toString", +function () { +var sb = new StringBuffer (); +sb.append ("match=" + this.matchedFrom () + ":" + this.charsMatched ()); +if (!this.didMatch ()) { +return sb.toString (); +}for (var i = 0; i < this.numSubs (); i++) { +var n = i + 1; +sb.append (" sub(" + n + ")=" + this.matchedFromI (n) + ":" + this.charsMatchedI (n)); +} +return sb.toString (); +}); +Clazz.defineMethod (c$, "copyOutOf", +function (r) { +if (r.marks == null) { +this.marks = null; +} else { +try { +this.marks = Clazz.newIntArray (r.marks.length, 0); +for (var i = 0; i < this.marks.length; i++) { +this.marks[i] = r.marks[i]; +} +} catch (t) { +} +}this.didMatch_ = r.didMatch_; +this.src = r.src; +this.charsMatched_ = r.charsMatched_; +this.matchFrom_ = r.matchFrom_; +this.numSubs_ = r.numSubs_; +}, "com.stevesoft.pat.RegRes"); +Clazz.defineMethod (c$, "equals", +function (r) { +if (this.charsMatched_ != r.charsMatched_ || this.matchFrom_ != r.matchFrom_ || this.didMatch_ != r.didMatch_ || this.numSubs_ != r.numSubs_ || !this.src.unwrap ().equals (r.src.unwrap ())) { +return false; +}if (this.marks == null && r.marks != null) { +return false; +}if (this.marks != null && r.marks == null) { +return false; +}for (var i = 1; i <= this.numSubs_; i++) { +if (this.matchedFromI (i) != r.matchedFromI (i)) { +return false; +} else if (this.charsMatchedI (i) != r.charsMatchedI (i)) { +return false; +}} +return true; +}, "com.stevesoft.pat.RegRes"); +Clazz.defineMethod (c$, "stringMatched", +function () { +var mf = this.matchedFrom (); +var cm = this.charsMatched (); +return !this.didMatch_ || mf < 0 || cm < 0 ? null : this.src.substring (mf, mf + cm); +}); +Clazz.defineMethod (c$, "matchedFromI", +function (i) { +if (this.marks == null || i > this.numSubs_) { +return -1; +}return this.marks[i]; +}, "~N"); +Clazz.defineMethod (c$, "charsMatchedI", +function (i) { +if (this.marks == null || i > this.numSubs_ || !this.didMatch_) { +return -1; +}var mf = this.matchedFromI (i); +return mf < 0 ? -1 : this.marks[i + this.numSubs_] - this.matchedFromI (i); +}, "~N"); +Clazz.defineMethod (c$, "matchedToI", +function (i) { +if (this.marks == null || i > this.numSubs_ || !this.didMatch_) { +return -1; +}return this.marks[i + this.numSubs_]; +}, "~N"); +Clazz.defineMethod (c$, "stringMatchedI", +function (i) { +var mf = this.matchedFromI (i); +var cm = this.charsMatchedI (i); +return !this.didMatch_ || mf < 0 || cm < 0 ? null : this.src.substring (mf, mf + cm); +}, "~N"); +Clazz.defineMethod (c$, "left", +function () { +var mf = this.matchedFrom (); +return !this.didMatch_ || (mf < 0) ? null : this.src.substring (0, mf); +}); +Clazz.defineMethod (c$, "leftI", +function (i) { +var mf = this.matchedFromI (i); +return !this.didMatch_ || (mf < 0) ? null : this.src.substring (0, mf); +}, "~N"); +Clazz.defineMethod (c$, "right", +function () { +var mf = this.matchedFrom (); +var cm = this.charsMatched (); +return !this.didMatch_ || mf < 0 || cm < 0 ? null : this.src.substring (mf + cm, this.src.length ()); +}); +Clazz.defineMethod (c$, "rightI", +function (i) { +var mf = this.matchedFromI (i); +var cm = this.charsMatchedI (i); +return !this.didMatch_ || mf < 0 || cm < 0 ? null : this.src.substring (mf + cm, this.src.length ()); +}, "~N"); +Clazz.defineMethod (c$, "matchedFrom", +function () { +return !this.didMatch_ ? -1 : this.matchFrom_; +}); +Clazz.defineMethod (c$, "charsMatched", +function () { +return !this.didMatch_ || this.matchFrom_ < 0 ? -1 : this.charsMatched_; +}); +Clazz.defineMethod (c$, "matchedTo", +function () { +return !this.didMatch_ ? -1 : this.matchFrom_ + this.charsMatched_; +}); +Clazz.defineMethod (c$, "numSubs", +function () { +return this.numSubs_; +}); +Clazz.defineMethod (c$, "didMatch", +function () { +return this.didMatch_; +}); +Clazz.defineMethod (c$, "matchFrom", +function () { +return this.matchedFrom (); +}); +Clazz.defineMethod (c$, "substring", +function () { +return this.stringMatched (); +}); +Clazz.defineMethod (c$, "matchFromI", +function (i) { +return this.matchedFromI (i); +}, "~N"); +Clazz.defineMethod (c$, "substringI", +function (i) { +return this.stringMatchedI (i); +}, "~N"); +});