JAL-1807 test
[jalviewjs.git] / bin / com / stevesoft / pat / StringBufferLike.js
1 Clazz.declarePackage ("com.stevesoft.pat");
2 Clazz.load (["com.stevesoft.pat.BasicStringBufferLike"], "com.stevesoft.pat.StringBufferLike", ["com.stevesoft.pat.CaseMgr"], function () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.sbl = null;
5 this.mode = 'E';
6 this.altMode = ' ';
7 Clazz.instantialize (this, arguments);
8 }, com.stevesoft.pat, "StringBufferLike", null, com.stevesoft.pat.BasicStringBufferLike);
9 Clazz.makeConstructor (c$, 
10 function (sbl) {
11 this.sbl = sbl;
12 }, "com.stevesoft.pat.BasicStringBufferLike");
13 Clazz.defineMethod (c$, "toStringLike", 
14 function () {
15 return this.sbl.toStringLike ();
16 });
17 Clazz.defineMethod (c$, "toString", 
18 function () {
19 return this.sbl.toString ();
20 });
21 Clazz.defineMethod (c$, "appendC", 
22 function (c) {
23 switch (this.mode) {
24 case 'u':
25 this.mode = this.altMode;
26 this.altMode = ' ';
27 case 'U':
28 this.sbl.appendC (com.stevesoft.pat.CaseMgr.toUpperCaseC (c));
29 break;
30 case 'l':
31 this.mode = this.altMode;
32 this.altMode = ' ';
33 case 'L':
34 this.sbl.appendC (com.stevesoft.pat.CaseMgr.toLowerCaseC (c));
35 break;
36 case 'Q':
37 if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9')) {
38 ;} else {
39 this.sbl.appendC ('\\');
40 }default:
41 this.sbl.appendC (c);
42 break;
43 }
44 }, "~S");
45 Clazz.overrideMethod (c$, "append", 
46 function (s) {
47 for (var i = 0; i < s.length; i++) {
48 this.appendC (s.charAt (i));
49 }
50 }, "~S");
51 Clazz.defineMethod (c$, "setMode", 
52 function (c) {
53 if (c == 'u' || c == 'l') {
54 if (this.altMode == ' ') {
55 this.altMode = this.mode;
56 }}this.mode = c;
57 }, "~S");
58 Clazz.defineMethod (c$, "unwrap", 
59 function () {
60 return this.sbl.unwrap ();
61 });
62 });