1 Clazz.declarePackage ("com.stevesoft.pat");
2 Clazz.load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.Or", ["com.stevesoft.pat.patInt", "java.lang.StringBuffer", "java.util.Vector"], function () {
3 c$ = Clazz.decorateAsClass (function () {
6 Clazz.instantialize (this, arguments);
7 }, com.stevesoft.pat, "Or", com.stevesoft.pat.Pattern);
8 Clazz.makeConstructor (c$,
10 Clazz.superConstructor (this, com.stevesoft.pat.Or, []);
11 this.v = new java.util.Vector ();
13 Clazz.defineMethod (c$, "leftForm",
17 Clazz.defineMethod (c$, "rightForm",
21 Clazz.defineMethod (c$, "sepForm",
25 Clazz.defineMethod (c$, "addOr",
28 this.v.addElement (p);
31 }, "com.stevesoft.pat.Pattern");
32 Clazz.defineMethod (c$, "toString",
35 var sb = new StringBuffer ();
36 sb.append (this.leftForm ());
37 if (this.v.size () > 0) {
38 sb.append ((this.v.elementAt (0)).toString ());
39 }for (i = 1; i < this.v.size (); i++) {
40 sb.append (this.sepForm ());
41 sb.append ((this.v.elementAt (i)).toString ());
43 sb.append (this.rightForm ());
44 sb.append (this.nextString ());
45 return sb.toString ();
47 Clazz.defineMethod (c$, "matchInternal",
49 if (this.pv == null) {
50 this.pv = new Array (this.v.size ());
51 this.v.copyInto (this.pv);
52 }for (var i = 0; i < this.v.size (); i++) {
54 var r = p.matchInternal (pos, pt);
59 }, "~N,com.stevesoft.pat.Pthings");
60 Clazz.overrideMethod (c$, "minChars",
62 if (this.v.size () == 0) {
63 return new com.stevesoft.pat.patInt (0);
64 }var m = (this.v.elementAt (0)).countMinChars ();
65 for (var i = 1; i < this.v.size (); i++) {
66 var p = this.v.elementAt (i);
67 m.mineq (p.countMinChars ());
71 Clazz.overrideMethod (c$, "maxChars",
73 if (this.v.size () == 0) {
74 return new com.stevesoft.pat.patInt (0);
75 }var m = (this.v.elementAt (0)).countMaxChars ();
76 for (var i = 1; i < this.v.size (); i++) {
77 var p = this.v.elementAt (i);
78 m.maxeq (p.countMaxChars ());
82 Clazz.overrideMethod (c$, "clone1",
84 var o = new com.stevesoft.pat.Or ();
87 for (var i = 0; i < this.v.size (); i++) {
88 o.v.addElement ((this.v.elementAt (i)).clone (h));
91 }, "java.util.Hashtable");