X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fcom%2Fstevesoft%2Fpat%2FAny.java;fp=src%2Fcom%2Fstevesoft%2Fpat%2FAny.java;h=234c343ab566a706225c658b4bef75c360c157e7;hb=c40cf903f740a72ab63dd1abc10fa33450ce660d;hp=0000000000000000000000000000000000000000;hpb=5bcae030b489e670c6983aa97eb9b6d8a6bbbbd5;p=jalview.git diff --git a/src/com/stevesoft/pat/Any.java b/src/com/stevesoft/pat/Any.java new file mode 100755 index 0000000..234c343 --- /dev/null +++ b/src/com/stevesoft/pat/Any.java @@ -0,0 +1,28 @@ +// +// 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(); } +};