X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fcom%2Fstevesoft%2Fpat%2FAny.java;h=dbaa961e63b8802d94e92771fbb501ef51208a30;hb=4b2be7cd8c14e67cc347609199e25c7f09fda988;hp=234c343ab566a706225c658b4bef75c360c157e7;hpb=c40cf903f740a72ab63dd1abc10fa33450ce660d;p=jalview.git diff --git a/src/com/stevesoft/pat/Any.java b/src/com/stevesoft/pat/Any.java index 234c343..dbaa961 100755 --- a/src/com/stevesoft/pat/Any.java +++ b/src/com/stevesoft/pat/Any.java @@ -1,28 +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; - -/** This is the '.' character in a Pattern. It - matches any character. */ -class Any extends Pattern { - public int matchInternal(int pos,Pthings pt) { - if(pos < pt.src.length()) - if(pt.dotDoesntMatchCR) { - if(pt.src.charAt(pos) != '\n') - return nextMatch(pos+1,pt); - } else return nextMatch(pos+1,pt); - return -1; - } - public String toString() { - return "."+nextString(); - } - public patInt minChars() { return new patInt(1); } - public patInt maxChars() { return new patInt(1); } - public Pattern clone1(Hashtable h) { return new Any(); } -}; +// +// 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; + +/** + * This is the '.' character in a Pattern. It matches any character. + */ +class Any extends Pattern +{ + public int matchInternal(int pos, Pthings pt) + { + if (pos < pt.src.length()) + { + if (pt.dotDoesntMatchCR) + { + if (pt.src.charAt(pos) != '\n') + { + return nextMatch(pos + 1, pt); + } + } + else + { + return nextMatch(pos + 1, pt); + } + } + return -1; + } + + public String toString() + { + return "." + nextString(); + } + + public patInt minChars() + { + return new patInt(1); + } + + public patInt maxChars() + { + return new patInt(1); + } + + public Pattern clone1(Hashtable h) + { + return new Any(); + } +};