X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=unused%2Fcom%2Fstevesoft%2Fpat%2FCustom.java;fp=unused%2Fcom%2Fstevesoft%2Fpat%2FCustom.java;h=18cba7def9459c65ba1a1c711856d368751de116;hb=6319110ce33faa76ee6cf9832e78faa224510fed;hp=61879ac08e731a9a9fff5d76c893f523cff6ee8f;hpb=7301a2415adab88038b291fc54caeeb3a5a47a44;p=jalviewjs.git diff --git a/unused/com/stevesoft/pat/Custom.java b/unused/com/stevesoft/pat/Custom.java index 61879ac..18cba7d 100644 --- a/unused/com/stevesoft/pat/Custom.java +++ b/unused/com/stevesoft/pat/Custom.java @@ -1,64 +1,64 @@ -// -// 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.*; - -/** - * Simple custom patterns. See deriv2.java and deriv3.java in the - * test directory. - * - * @see com.stevesoft.pat.CustomEndpoint - */ -class Custom extends PatternSub -{ - String select; - - Validator v; - - int start; - - Custom(String s) - { - select = s; - v = (Validator) Regex.validators.get(s); - } - - public int matchInternal(int pos, Pthings pt) - { - start = pos; - return sub.matchInternal(pos, pt); - } - - public String toString() - { - String a = v.argsave == null ? "" : ":" + v.argsave; - return "(??" + select + a + ")" + nextString(); - } - - public patInt minChars() - { - return v.minChars(); - } - - public patInt maxChars() - { - return v.maxChars(); - } - - Pattern clone1(Hashtable h) - { - Custom c = new Custom(select); - h.put(c, c); - h.put(this, c); - c.sub = sub.clone(h); - return c; - } -} +// +// 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.*; + +/** + * Simple custom patterns. See deriv2.java and deriv3.java in the + * test directory. + * + * @see com.stevesoft.pat.CustomEndpoint + */ +class Custom extends PatternSub +{ + String select; + + Validator v; + + int start; + + Custom(String s) + { + select = s; + v = (Validator) Regex.validators.get(s); + } + + public int matchInternal(int pos, Pthings pt) + { + start = pos; + return sub.matchInternal(pos, pt); + } + + public String toString() + { + String a = v.argsave == null ? "" : ":" + v.argsave; + return "(??" + select + a + ")" + nextString(); + } + + public patInt minChars() + { + return v.minChars(); + } + + public patInt maxChars() + { + return v.maxChars(); + } + + Pattern clone1(Hashtable h) + { + Custom c = new Custom(select); + h.put(c, c); + h.put(this, c); + c.sub = sub.clone(h); + return c; + } +}