1 Clazz.declarePackage ("com.stevesoft.pat");
2 Clazz.load (null, "com.stevesoft.pat.Pattern", ["com.stevesoft.pat.MessageManager", "$.patInf", "$.patInt", "java.lang.Error", "$.StringBuffer"], function () {
3 c$ = Clazz.decorateAsClass (function () {
7 Clazz.instantialize (this, arguments);
8 }, com.stevesoft.pat, "Pattern");
9 Clazz.defineMethod (c$, "getNext",
11 return this.next != null ? this.next : (this.parent == null ? null : this.parent.getNext ());
13 Clazz.defineMethod (c$, "setParent",
15 if (this.next != null) {
16 this.next.setParent (p);
19 }}, "com.stevesoft.pat.Pattern");
20 Clazz.defineMethod (c$, "nextMatch",
22 var p = this.getNext ();
23 return p == null ? i : p.matchInternal (i, pt);
24 }, "~N,com.stevesoft.pat.Pthings");
25 Clazz.defineMethod (c$, "nextString",
27 if (this.next == null) {
29 }return this.next.toString ();
31 c$.inString = Clazz.defineMethod (c$, "inString",
34 for (i = 0; i < s.length; i++) {
35 if (s.charAt (i) == c) {
40 c$.protect = Clazz.defineMethod (c$, "protect",
41 function (s, PROTECT_THESE, esc) {
43 var sb = new StringBuffer ();
44 var p = PROTECT_THESE + esc;
45 for (i = 0; i < s.length; i++) {
47 if (com.stevesoft.pat.Pattern.inString (c, p)) {
51 return sb.toString ();
53 Clazz.defineMethod (c$, "match",
55 return this.matchAt (s, 0, pt);
56 }, "com.stevesoft.pat.StringLike,com.stevesoft.pat.Pthings");
57 Clazz.defineMethod (c$, "matchAt",
60 var r = this.matchInternal (i, pt);
63 }this.mfrom = r < i ? r + 1 : i;
64 return r < i ? i - r - 1 : r - i;
65 }, "com.stevesoft.pat.StringLike,~N,com.stevesoft.pat.Pthings");
66 Clazz.defineMethod (c$, "Masked",
68 return pt.cbits == null ? false : pt.cbits.get (i);
69 }, "~N,com.stevesoft.pat.Pthings");
70 Clazz.defineMethod (c$, "add",
72 if (this.next == null) {
76 p.parent = this.parent;
81 }, "com.stevesoft.pat.Pattern");
82 Clazz.defineMethod (c$, "minChars",
84 return new com.stevesoft.pat.patInt (0);
86 Clazz.defineMethod (c$, "maxChars",
88 return new com.stevesoft.pat.patInf ();
90 Clazz.defineMethod (c$, "countMinChars",
93 var sum = new com.stevesoft.pat.patInt (0);
95 sum.pluseq (p.minChars ());
100 Clazz.defineMethod (c$, "countMaxChars",
103 var sum = new com.stevesoft.pat.patInt (0);
105 sum.pluseq (p.maxChars ());
110 Clazz.defineMethod (c$, "testMatch",
111 function (p, pos, pt) {
113 if (pt.marks != null) {
115 tab = Clazz.newIntArray (pt.marks.length, 0);
116 for (var i = 0; i < tab.length; i++) {
117 tab[i] = pt.marks[i];
121 }var ret = p.matchInternal (pos, pt);
125 }, "com.stevesoft.pat.Pattern,~N,com.stevesoft.pat.Pthings");
126 Clazz.defineMethod (c$, "clone1",
128 throw new Error (com.stevesoft.pat.MessageManager.formatMessage ("error.no_such_method_as_clone1_for", Clazz.newArray (-1, [this.getClass ().getName ()])));
129 }, "java.util.Hashtable");
130 Clazz.defineMethod (c$, "clone",
132 var p = h.get (this);
135 }p = this.clone1 (h);
137 throw new Error (com.stevesoft.pat.MessageManager.getString ("error.null_from_clone1"));
140 if (this.next != null) {
141 p.next = this.next.clone (h);
142 }if (this.parent != null) {
143 p.parent = this.parent.clone (h);
145 }, "java.util.Hashtable");
146 Clazz.overrideMethod (c$, "equals",
150 Clazz.defineStatics (c$,
152 "PROTECT_THESE", "[]{}(),$,-\"^.");