JAL-1807 includes ?j2sdebug flag and DebugJS._(msg)
[jalviewjs.git] / bin / com / stevesoft / pat / RBuffer.js
1 Clazz.declarePackage ("com.stevesoft.pat");
2 Clazz.load (null, "com.stevesoft.pat.RBuffer", ["java.lang.StringBuffer"], function () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.done = false;
5 this.sb = null;
6 this.pos = 0;
7 this.epos = 0;
8 this.next = null;
9 Clazz.instantialize (this, arguments);
10 }, com.stevesoft.pat, "RBuffer");
11 Clazz.makeConstructor (c$, 
12 function () {
13 });
14 Clazz.makeConstructor (c$, 
15 function (sb) {
16 this.sb = sb;
17 }, "StringBuffer");
18 Clazz.overrideMethod (c$, "toString", 
19 function () {
20 return "sb=" + this.sb.toString ().$replace ('\n', ' ') + " pos=" + this.pos + " epos=" + this.epos + " sb.length()=" + this.sb.length () + "\n" + this.sp (this.pos + 3) + "^" + this.sp (this.epos - this.pos - 1) + "^";
21 });
22 Clazz.defineMethod (c$, "sp", 
23 function (n) {
24 if (n <= 0) {
25 return "";
26 }var sb =  new StringBuffer (n);
27 for (var i = 0; i < n; i++) {
28 sb.append (' ');
29 }
30 return sb.toString ();
31 }, "~N");
32 });