Remove redundancy in Eclipse
[jalview.git] / src / com / stevesoft / pat / TransPat.java
1 //\r
2 // This software is now distributed according to\r
3 // the Lesser Gnu Public License.  Please see\r
4 // http://www.gnu.org/copyleft/lesser.txt for\r
5 // the details.\r
6 //    -- Happy Computing!\r
7 //\r
8 package com.stevesoft.pat;\r
9 \r
10 \r
11 /** This class is used to implement the Transformer\r
12     @see com.stevesoft.pat.Transform\r
13     */\r
14 class TransPat extends Pattern {\r
15     Regex[] ra = new Regex[10];\r
16     int ra_len = 0;\r
17     int pn = -1;\r
18     public String toString() {\r
19         return "(?#TransPat)";\r
20     }\r
21 \r
22     TransPat() {}\r
23 \r
24     int lastMatchedTo = -1;\r
25     public int matchInternal(int pos,Pthings pt) {\r
26         for(int i=0;i<ra_len;i++) {\r
27             pt.ignoreCase = ra[i].ignoreCase;\r
28             pt.mFlag = ra[i].mFlag;\r
29             pt.dotDoesntMatchCR = Regex.dotDoesntMatchCR;\r
30             int r = ra[i].thePattern.matchInternal(pos,pt);\r
31             if(r >= 0) {\r
32                 pn = i;\r
33                 return r;\r
34             }\r
35         }\r
36         pn = -1;\r
37         return -1;\r
38     }\r
39 }\r