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