1 Clazz.declarePackage ("com.stevesoft.pat");
2 Clazz.load (["com.stevesoft.pat.StringLike"], "com.stevesoft.pat.PartialBuffer", ["java.lang.StringBuffer"], function () {
3 c$ = Clazz.decorateAsClass (function () {
5 this.allowOverRun = true;
8 Clazz.instantialize (this, arguments);
9 }, com.stevesoft.pat, "PartialBuffer", null, com.stevesoft.pat.StringLike);
10 Clazz.makeConstructor (c$,
14 Clazz.overrideMethod (c$, "charAt",
17 if (n == this.sb.length ()) {
19 return String.fromCharCode (0);
20 }return this.sb.charAt (n);
22 Clazz.overrideMethod (c$, "length",
24 return this.allowOverRun ? this.sb.length () + 1 : this.sb.length ();
26 Clazz.overrideMethod (c$, "indexOf",
28 for (var i = 0; i < this.sb.length (); i++) {
29 if (this.sb.charAt (i) == c) {
34 Clazz.overrideMethod (c$, "unwrap",
38 Clazz.overrideMethod (c$, "substring",
40 var sb = new StringBuffer (i2 - i1);
41 for (var i = i1; i < i2; i++) {
42 sb.append (this.charAt (i));
44 return sb.toString ();
46 Clazz.overrideMethod (c$, "newStringBufferLike",