X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fcom%2Fstevesoft%2Fpat%2FSkipped.java;h=2d20845cc1ea105dbd6a82d249ba427cd9335c2d;hb=4b2be7cd8c14e67cc347609199e25c7f09fda988;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..2d20845 100755 --- a/src/com/stevesoft/pat/Skipped.java +++ b/src/com/stevesoft/pat/Skipped.java @@ -1,27 +1,56 @@ -// -// 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); + } +};