JAL-1807 test
[jalviewjs.git] / bin / com / stevesoft / pat / wrap / CharArrayBufferWrap.js
1 Clazz.declarePackage ("com.stevesoft.pat.wrap");
2 Clazz.load (["com.stevesoft.pat.BasicStringBufferLike", "java.lang.StringBuffer"], "com.stevesoft.pat.wrap.CharArrayBufferWrap", ["com.stevesoft.pat.wrap.CharArrayWrap"], function () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.sb = null;
5 Clazz.instantialize (this, arguments);
6 }, com.stevesoft.pat.wrap, "CharArrayBufferWrap", 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.overrideMethod (c$, "toStringLike", 
19 function () {
20 var ca =  Clazz.newCharArray (this.sb.length (), '\0');
21 for (var i = 0; i < ca.length; i++) {
22 ca[i] = this.sb.charAt (i);
23 }
24 return  new com.stevesoft.pat.wrap.CharArrayWrap (ca);
25 });
26 Clazz.defineMethod (c$, "length", 
27 function () {
28 return this.sb.length ();
29 });
30 Clazz.overrideMethod (c$, "toString", 
31 function () {
32 return this.sb.toString ();
33 });
34 Clazz.overrideMethod (c$, "unwrap", 
35 function () {
36 return this.sb;
37 });
38 });