JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.git] / bin / com / stevesoft / pat / wrap / WriterWrap.js
1 Clazz.declarePackage ("com.stevesoft.pat.wrap");\r
2 Clazz.load (["com.stevesoft.pat.BasicStringBufferLike"], "com.stevesoft.pat.wrap.WriterWrap", null, function () {\r
3 c$ = Clazz.decorateAsClass (function () {\r
4 this.w = null;\r
5 Clazz.instantialize (this, arguments);\r
6 }, com.stevesoft.pat.wrap, "WriterWrap", null, com.stevesoft.pat.BasicStringBufferLike);\r
7 Clazz.makeConstructor (c$, \r
8 function (w) {\r
9 this.w = w;\r
10 }, "java.io.Writer");\r
11 Clazz.overrideMethod (c$, "appendC", \r
12 function (c) {\r
13 try {\r
14 this.w.write ((c).charCodeAt (0));\r
15 } catch (ioe) {\r
16 if (Clazz.exceptionOf (ioe, java.io.IOException)) {\r
17 } else {\r
18 throw ioe;\r
19 }\r
20 }\r
21 }, "~S");\r
22 Clazz.overrideMethod (c$, "append", \r
23 function (s) {\r
24 try {\r
25 this.w.write (s);\r
26 } catch (ioe) {\r
27 if (Clazz.exceptionOf (ioe, java.io.IOException)) {\r
28 } else {\r
29 throw ioe;\r
30 }\r
31 }\r
32 }, "~S");\r
33 Clazz.overrideMethod (c$, "toStringLike", \r
34 function () {\r
35 return null;\r
36 });\r
37 Clazz.overrideMethod (c$, "unwrap", \r
38 function () {\r
39 return this.w;\r
40 });\r
41 });\r