X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fcom%2Fstevesoft%2Fpat%2FTransPat.java;h=b9a09892d5f0d78d0f25405382fca0e01c73b01c;hb=4b2be7cd8c14e67cc347609199e25c7f09fda988;hp=4c71c1fb80b6bc30347982f7466f615f61315d39;hpb=7bc226b58110fa26d9dbd3f0c78095d06909ffc3;p=jalview.git diff --git a/src/com/stevesoft/pat/TransPat.java b/src/com/stevesoft/pat/TransPat.java index 4c71c1f..b9a0989 100755 --- a/src/com/stevesoft/pat/TransPat.java +++ b/src/com/stevesoft/pat/TransPat.java @@ -1,45 +1,51 @@ -// -// This software is now distributed according to -// the Lesser Gnu Public License. Please see -// http://www.gnu.org/copyleft/lesser.txt for -// the details. -// -- Happy Computing! -// -package com.stevesoft.pat; - -/** This class is used to implement the Transformer - @see com.stevesoft.pat.Transform - */ -class TransPat - extends Pattern -{ - Regex[] ra = new Regex[10]; - int ra_len = 0; - int pn = -1; - public String toString() - { - return "(?#TransPat)"; - } - - TransPat() - {} - - int lastMatchedTo = -1; - public int matchInternal(int pos, Pthings pt) - { - for (int i = 0; i < ra_len; i++) - { - pt.ignoreCase = ra[i].ignoreCase; - pt.mFlag = ra[i].mFlag; - pt.dotDoesntMatchCR = Regex.dotDoesntMatchCR; - int r = ra[i].thePattern.matchInternal(pos, pt); - if (r >= 0) - { - pn = i; - return r; - } - } - pn = -1; - return -1; - } -} +// +// This software is now distributed according to +// the Lesser Gnu Public License. Please see +// http://www.gnu.org/copyleft/lesser.txt for +// the details. +// -- Happy Computing! +// +package com.stevesoft.pat; + +/** + * This class is used to implement the Transformer + * + * @see com.stevesoft.pat.Transform + */ +class TransPat extends Pattern +{ + Regex[] ra = new Regex[10]; + + int ra_len = 0; + + int pn = -1; + + public String toString() + { + return "(?#TransPat)"; + } + + TransPat() + { + } + + int lastMatchedTo = -1; + + public int matchInternal(int pos, Pthings pt) + { + for (int i = 0; i < ra_len; i++) + { + pt.ignoreCase = ra[i].ignoreCase; + pt.mFlag = ra[i].mFlag; + pt.dotDoesntMatchCR = Regex.dotDoesntMatchCR; + int r = ra[i].thePattern.matchInternal(pos, pt); + if (r >= 0) + { + pn = i; + return r; + } + } + pn = -1; + return -1; + } +}