1 |
|
package |
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
com.stevesoft.pat; |
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
|
|
| 0% |
Uncovered Elements: 45 (45) |
Complexity: 22 |
Complexity Density: 0.73 |
|
14 |
|
public class StringBufferLike implements BasicStringBufferLike |
15 |
|
{ |
16 |
|
BasicStringBufferLike sbl; |
17 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
18 |
0 |
public StringBufferLike(BasicStringBufferLike sbl)... |
19 |
|
{ |
20 |
0 |
this.sbl = sbl; |
21 |
|
} |
22 |
|
|
23 |
|
char mode = 'E', altMode = ' '; |
24 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
25 |
0 |
public StringLike toStringLike()... |
26 |
|
{ |
27 |
0 |
return sbl.toStringLike(); |
28 |
|
} |
29 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
30 |
0 |
public String toString()... |
31 |
|
{ |
32 |
0 |
return sbl.toString(); |
33 |
|
} |
34 |
|
|
|
|
| 0% |
Uncovered Elements: 22 (22) |
Complexity: 12 |
Complexity Density: 0.6 |
|
35 |
0 |
public void append(char c)... |
36 |
|
{ |
37 |
|
|
38 |
0 |
switch (mode) |
39 |
|
{ |
40 |
0 |
case 'u': |
41 |
0 |
mode = altMode; |
42 |
0 |
altMode = ' '; |
43 |
0 |
case 'U': |
44 |
0 |
sbl.append(CaseMgr.toUpperCase(c)); |
45 |
0 |
break; |
46 |
0 |
case 'l': |
47 |
0 |
mode = altMode; |
48 |
0 |
altMode = ' '; |
49 |
0 |
case 'L': |
50 |
0 |
sbl.append(CaseMgr.toLowerCase(c)); |
51 |
0 |
break; |
52 |
0 |
case 'Q': |
53 |
0 |
if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') |
54 |
|
|| (c >= '0' && c <= '9')) |
55 |
|
{ |
56 |
0 |
; |
57 |
|
} |
58 |
|
else |
59 |
|
{ |
60 |
0 |
sbl.append('\\'); |
61 |
|
} |
62 |
0 |
default: |
63 |
0 |
sbl.append(c); |
64 |
0 |
break; |
65 |
|
} |
66 |
|
} |
67 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
68 |
0 |
public void append(String s)... |
69 |
|
{ |
70 |
0 |
for (int i = 0; i < s.length(); i++) |
71 |
|
{ |
72 |
0 |
append(s.charAt(i)); |
73 |
|
} |
74 |
|
} |
75 |
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 4 |
Complexity Density: 1 |
|
76 |
0 |
public void setMode(char c)... |
77 |
|
{ |
78 |
0 |
if (c == 'u' || c == 'l') |
79 |
|
{ |
80 |
0 |
if (altMode == ' ') |
81 |
|
{ |
82 |
0 |
altMode = mode; |
83 |
|
} |
84 |
|
} |
85 |
0 |
mode = c; |
86 |
|
} |
87 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
88 |
0 |
public Object unwrap()... |
89 |
|
{ |
90 |
0 |
return sbl.unwrap(); |
91 |
|
} |
92 |
|
} |