| Class | Line # | Actions | |||
|---|---|---|---|---|---|
| Skipped | 16 | 8 | 8 |
| 1 | // | |
| 2 | // This software is now distributed according to | |
| 3 | // the Lesser Gnu Public License. Please see | |
| 4 | // http://www.gnu.org/copyleft/lesser.txt for | |
| 5 | // the details. | |
| 6 | // -- Happy Computing! | |
| 7 | // | |
| 8 | package com.stevesoft.pat; | |
| 9 | ||
| 10 | import java.util.Hashtable; | |
| 11 | ||
| 12 | /** | |
| 13 | * Implements the (?<number) Pattern, where number is an integer telling us | |
| 14 | * how far to back up in the Pattern. Not in perl 5. | |
| 15 | */ | |
| 16 | class Skipped extends Pattern | |
| 17 | { | |
| 18 | String s; | |
| 19 | ||
| 20 | 0 | Skipped(String s) |
| 21 | { | |
| 22 | 0 | this.s = s; |
| 23 | } | |
| 24 | ||
| 25 | 0 | public String toString() |
| 26 | { | |
| 27 | 0 | return s + nextString(); |
| 28 | } | |
| 29 | ||
| 30 | 0 | public int matchInternal(int pos, Pthings pt) |
| 31 | { | |
| 32 | // if(pt.no_check || s.regionMatches(pt.ignoreCase,0,pt.src,pos,s.length())) | |
| 33 | 0 | if (pt.no_check || CaseMgr.regionMatches(s, pt.ignoreCase, 0, pt.src, |
| 34 | pos, s.length())) | |
| 35 | { | |
| 36 | 0 | return nextMatch(pos + s.length(), pt); |
| 37 | } | |
| 38 | 0 | return -1; |
| 39 | } | |
| 40 | ||
| 41 | 0 | public patInt minChars() |
| 42 | { | |
| 43 | 0 | return new patInt(s.length()); |
| 44 | } | |
| 45 | ||
| 46 | 0 | public patInt maxChars() |
| 47 | { | |
| 48 | 0 | return new patInt(s.length()); |
| 49 | } | |
| 50 | ||
| 51 | 0 | Pattern clone1(Hashtable h) |
| 52 | { | |
| 53 | 0 | return new Skipped(s); |
| 54 | } | |
| 55 | }; |