JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.git] / site / j2s / com / stevesoft / pat / wrap / StringBufferWrap.js
1 Clazz.declarePackage ("com.stevesoft.pat.wrap");\r
2 Clazz.load (["com.stevesoft.pat.BasicStringBufferLike", "java.lang.StringBuffer"], "com.stevesoft.pat.wrap.StringBufferWrap", ["com.stevesoft.pat.wrap.StringWrap"], function () {\r
3 c$ = Clazz.decorateAsClass (function () {\r
4 this.sb = null;\r
5 Clazz.instantialize (this, arguments);\r
6 }, com.stevesoft.pat.wrap, "StringBufferWrap", null, com.stevesoft.pat.BasicStringBufferLike);\r
7 Clazz.prepareFields (c$, function () {\r
8 this.sb =  new StringBuffer ();\r
9 });\r
10 Clazz.overrideMethod (c$, "appendC", \r
11 function (c) {\r
12 this.sb.append (c);\r
13 }, "~S");\r
14 Clazz.overrideMethod (c$, "append", \r
15 function (s) {\r
16 this.sb.append (s);\r
17 }, "~S");\r
18 Clazz.defineMethod (c$, "length", \r
19 function () {\r
20 return this.sb.length ();\r
21 });\r
22 Clazz.overrideMethod (c$, "toString", \r
23 function () {\r
24 return this.sb.toString ();\r
25 });\r
26 Clazz.overrideMethod (c$, "toStringLike", \r
27 function () {\r
28 return  new com.stevesoft.pat.wrap.StringWrap (this.sb.toString ());\r
29 });\r
30 Clazz.overrideMethod (c$, "unwrap", \r
31 function () {\r
32 return this.sb;\r
33 });\r
34 });\r