1 | int matchesIgnoreCase(String text, int start, int limit)↵ | | 1 | int matchesIgnoreCase(char[] chars, int start, int limit)↵
|
2 | {↵ | | 2 | {↵
|
3 | int plength = this.pattern.length;↵ | | 3 | int plength = this.pattern.length;↵
|
4 | if (plength == 0)↵ | | 4 | if (plength == 0)↵
|
5 | return start;↵ | | 5 | return start;↵
|
6 | int index = start + plength;↵ | | 6 | int index = start + plength;↵
|
7 | while (index <= limit)↵ | | 7 | while (index <= limit)↵
|
8 | {↵ | | 8 | {↵
|
9 | int pindex = plength;↵ | | 9 | int pindex = plength;↵
|
10 | int nindex = index + 1;↵ | | 10 | int nindex = index + 1;↵
|
11 | char ch;↵ | | 11 | char ch;↵
|
12 | do↵ | | 12 | do↵
|
13 | {↵ | | 13 | {↵
|
14 | char ch1 = ch = text.charAt(--index);↵ | | 14 | char ch1 = ch = chars[--index];↵
|
15 | char ch2 = this.pattern[--pindex];↵ | | 15 | char ch2 = this.pattern[--pindex];↵
|
16 | if (ch1 != ch2)↵ | | 16 | if (ch1 != ch2)↵
|
17 | {↵ | | 17 | {↵
|
18 | ch1 = Character.toUpperCase(ch1);↵ | | 18 | ch1 = Character.toUpperCase(ch1);↵
|
19 | ch2 = Character.toUpperCase(ch2);↵ | | 19 | ch2 = Character.toUpperCase(ch2);↵
|
20 | if (ch1 != ch2 && Character.toLowerCase(ch1) != Character.toLowerCase(ch2))↵ | | 20 | if (ch1 != ch2 && Character.toLowerCase(ch1) != Character.toLowerCase(ch2))↵
|
21 | break;↵ | | 21 | break;↵
|
22 | }↵ | | 22 | }↵
|
23 | if (pindex == 0)↵ | | 23 | if (pindex == 0)↵
|
24 | return index;↵ | | 24 | return index;↵
|
25 | }↵ | | 25 | }↵
|
26 | while (pindex > 0);↵ | | 26 | while (pindex > 0);↵
|
27 | index += this.shiftTable[ch % this.shiftTable.length] + 1;↵ | | 27 | index += this.shiftTable[ch % this.shiftTable.length] + 1;↵
|
28 | if (index < nindex)↵ | | 28 | if (index < nindex)↵
|
29 | index = nindex;↵ | | 29 | index = nindex;↵
|
30 | }↵ | | 30 | }↵
|
31 | return -1;↵ | | 31 | return -1;↵
|
32 | | | 32 |
|