X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fcom%2Fstevesoft%2Fpat%2FSkipped.java;h=7a957e88c76ea9e034b906ad3c9be1ec6f32d010;hb=4ad2441df1220e3b1133feb3f70f00ba8b28392f;hp=9d963ae9a8d7095318258180a92af886c37526f1;hpb=c40cf903f740a72ab63dd1abc10fa33450ce660d;p=jalview.git diff --git a/src/com/stevesoft/pat/Skipped.java b/src/com/stevesoft/pat/Skipped.java index 9d963ae..7a957e8 100755 --- a/src/com/stevesoft/pat/Skipped.java +++ b/src/com/stevesoft/pat/Skipped.java @@ -1,27 +1,55 @@ -// -// 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; -import java.util.Hashtable; - -/** Implements the (?<number) Pattern, where number is - an integer telling us how far to back up in the Pattern. - Not in perl 5. */ -class Skipped extends Pattern { - String s; - Skipped(String s) { this.s = s; } - public String toString() { return s+nextString(); } - public int matchInternal(int pos,Pthings pt) { - //if(pt.no_check || s.regionMatches(pt.ignoreCase,0,pt.src,pos,s.length())) - if(pt.no_check || CaseMgr.regionMatches(s,pt.ignoreCase,0,pt.src,pos,s.length())) - return nextMatch(pos+s.length(),pt); - return -1; - } - public patInt minChars() { return new patInt(s.length()); } - public patInt maxChars() { return new patInt(s.length()); } - Pattern clone1(Hashtable h) { return new Skipped(s); } -}; +// +// 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; + +import java.util.Hashtable; + +/** + * Implements the (?<number) Pattern, where number is an integer telling us + * how far to back up in the Pattern. Not in perl 5. + */ +class Skipped extends Pattern +{ + String s; + + Skipped(String s) + { + this.s = s; + } + + public String toString() + { + return s + nextString(); + } + + public int matchInternal(int pos, Pthings pt) + { + // if(pt.no_check || s.regionMatches(pt.ignoreCase,0,pt.src,pos,s.length())) + if (pt.no_check || CaseMgr.regionMatches(s, pt.ignoreCase, 0, pt.src, + pos, s.length())) + { + return nextMatch(pos + s.length(), pt); + } + return -1; + } + + public patInt minChars() + { + return new patInt(s.length()); + } + + public patInt maxChars() + { + return new patInt(s.length()); + } + + Pattern clone1(Hashtable h) + { + return new Skipped(s); + } +};