JAL-1807 test
[jalviewjs.git] / bin / com / stevesoft / pat / Skip2.js
1 Clazz.declarePackage ("com.stevesoft.pat");
2 Clazz.load (["com.stevesoft.pat.Skip"], "com.stevesoft.pat.Skip2", ["com.stevesoft.pat.CaseMgr"], function () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.c1 = 0;
5 this.mask1 = 0;
6 Clazz.instantialize (this, arguments);
7 }, com.stevesoft.pat, "Skip2", com.stevesoft.pat.Skip);
8 Clazz.makeConstructor (c$, 
9 function (s, ign, offset) {
10 Clazz.superConstructor (this, com.stevesoft.pat.Skip2, [s, ign, offset]);
11 this.c1 = s.charCodeAt (1);
12 this.m1 = 2 == s.length;
13 if (ign) {
14 this.mask1 = com.stevesoft.pat.Skip.mkmask (this.c1);
15 } else {
16 this.mask1 = 0;
17 }}, "~S,~B,~N");
18 Clazz.defineMethod (c$, "find", 
19 function (s, start, end) {
20 if (start > end) {
21 return -1;
22 }start += this.$offset;
23 var vend = com.stevesoft.pat.Skip.min (s.length () - 2, end + this.$offset);
24 for (var i = start; i <= vend; i++) {
25 if (0 == (s.charCodeAt (i) & this.mask) && 0 == (s.charCodeAt (i + 1) & this.mask1)) {
26 if (this.m1 || com.stevesoft.pat.CaseMgr.regionMatchesLike2 (s, this.ign, i, this.src, 0, this.src.length)) {
27 return i - this.$offset;
28 }}}
29 return -1;
30 }, "com.stevesoft.pat.StringLike,~N,~N");
31 });