X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fcom%2Fstevesoft%2Fpat%2FCustom.java;fp=src%2Fcom%2Fstevesoft%2Fpat%2FCustom.java;h=72aebc7011bef5657b833f9cef0c52dda97b9736;hb=7bc226b58110fa26d9dbd3f0c78095d06909ffc3;hp=e7621a1774be323c3dc4b569820d7298ac1701ac;hpb=dd74fc4938723fe5ec48d4e5fdcfbe58ac42a48d;p=jalview.git diff --git a/src/com/stevesoft/pat/Custom.java b/src/com/stevesoft/pat/Custom.java index e7621a1..72aebc7 100755 --- a/src/com/stevesoft/pat/Custom.java +++ b/src/com/stevesoft/pat/Custom.java @@ -6,7 +6,8 @@ // -- Happy Computing! // package com.stevesoft.pat; -import java.util.Hashtable; + +import java.util.*; /** Simple custom patterns. See deriv2.java @@ -14,29 +15,46 @@ import java.util.Hashtable; 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; - } +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; + } }