JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.git] / bin / com / stevesoft / pat / Custom.js
1 Clazz.declarePackage ("com.stevesoft.pat");\r
2 Clazz.load (["com.stevesoft.pat.PatternSub"], "com.stevesoft.pat.Custom", ["com.stevesoft.pat.Regex"], function () {\r
3 c$ = Clazz.decorateAsClass (function () {\r
4 this.select = null;\r
5 this.v = null;\r
6 this.start = 0;\r
7 Clazz.instantialize (this, arguments);\r
8 }, com.stevesoft.pat, "Custom", com.stevesoft.pat.PatternSub);\r
9 Clazz.makeConstructor (c$, \r
10 function (s) {\r
11 Clazz.superConstructor (this, com.stevesoft.pat.Custom, []);\r
12 this.select = s;\r
13 this.v = com.stevesoft.pat.Regex.validators.get (s);\r
14 }, "~S");\r
15 Clazz.defineMethod (c$, "matchInternal", \r
16 function (pos, pt) {\r
17 this.start = pos;\r
18 return this.sub.matchInternal (pos, pt);\r
19 }, "~N,com.stevesoft.pat.Pthings");\r
20 Clazz.overrideMethod (c$, "toString", \r
21 function () {\r
22 var a = this.v.argsave == null ? "" : ":" + this.v.argsave;\r
23 return "(??" + this.select + a + ")" + this.nextString ();\r
24 });\r
25 Clazz.overrideMethod (c$, "minChars", \r
26 function () {\r
27 return this.v.minChars ();\r
28 });\r
29 Clazz.overrideMethod (c$, "maxChars", \r
30 function () {\r
31 return this.v.maxChars ();\r
32 });\r
33 Clazz.overrideMethod (c$, "clone1", \r
34 function (h) {\r
35 var c =  new com.stevesoft.pat.Custom (this.select);\r
36 h.put (c, c);\r
37 h.put (this, c);\r
38 c.sub = this.sub.clone (h);\r
39 return c;\r
40 }, "java.util.Hashtable");\r
41 });\r