X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fcom%2Fstevesoft%2Fpat%2FStart.java;fp=src%2Fcom%2Fstevesoft%2Fpat%2FStart.java;h=650e7a73defff43957715d50f1eafe5635e69b14;hb=506d60f0e188723ddc91c26824b41ac7034df3fe;hp=c47ee5352716215431decf4b543d55c6301dcae6;hpb=60f2d6c034560415fd0139c8bc7df0c19cae1186;p=jalview.git diff --git a/src/com/stevesoft/pat/Start.java b/src/com/stevesoft/pat/Start.java index c47ee53..650e7a7 100755 --- a/src/com/stevesoft/pat/Start.java +++ b/src/com/stevesoft/pat/Start.java @@ -1,58 +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.*; - -/** The '^' or the '\A' Pattern, matches the start of a string. */ -class Start - extends Pattern -{ - boolean retIsStart; - Start(boolean b) - { - retIsStart = b; - } - - public int matchInternal(int pos, Pthings pt) - { - if (retIsStart - && pt.mFlag - && pos > 0 && pt.src.charAt(pos - 1) == '\n') - { - return nextMatch(pos, pt); - } - if (pos == 0) - { - return nextMatch(pos, pt); - } - return -1; - } - - public String toString() - { - if (retIsStart) - { - return "^" + nextString(); - } - else - { - return "\\A" + nextString(); - } - } - - public patInt maxChars() - { - return new patInt(0); - } - - Pattern clone1(Hashtable h) - { - return new Start(retIsStart); - } -}; +// +// 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.*; + +/** The '^' or the '\A' Pattern, matches the start of a string. */ +class Start extends Pattern +{ + boolean retIsStart; + + Start(boolean b) + { + retIsStart = b; + } + + public int matchInternal(int pos, Pthings pt) + { + if (retIsStart && pt.mFlag && pos > 0 && pt.src.charAt(pos - 1) == '\n') + { + return nextMatch(pos, pt); + } + if (pos == 0) + { + return nextMatch(pos, pt); + } + return -1; + } + + public String toString() + { + if (retIsStart) + { + return "^" + nextString(); + } + else + { + return "\\A" + nextString(); + } + } + + public patInt maxChars() + { + return new patInt(0); + } + + Pattern clone1(Hashtable h) + { + return new Start(retIsStart); + } +};