1 |
|
package |
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
com.stevesoft.pat; |
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
|
|
| 31.1% |
Uncovered Elements: 31 (45) |
Complexity: 22 |
Complexity Density: 0.73 |
|
14 |
|
public class StringBufferLike implements BasicStringBufferLike |
15 |
|
{ |
16 |
|
BasicStringBufferLike sbl; |
17 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
18 |
3 |
public StringBufferLike(BasicStringBufferLike sbl)... |
19 |
|
{ |
20 |
3 |
this.sbl = sbl; |
21 |
|
} |
22 |
|
|
23 |
|
char mode = 'E', altMode = ' '; |
24 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
25 |
3 |
public StringLike toStringLike()... |
26 |
|
{ |
27 |
3 |
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 |
|
|
|
|
| 18.2% |
Uncovered Elements: 18 (22) |
Complexity: 12 |
Complexity Density: 0.6 |
|
35 |
130 |
public void append(char c)... |
36 |
|
{ |
37 |
|
|
38 |
130 |
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 |
130 |
default: |
63 |
130 |
sbl.append(c); |
64 |
130 |
break; |
65 |
|
} |
66 |
|
} |
67 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
68 |
3 |
public void append(String s)... |
69 |
|
{ |
70 |
7 |
for (int i = 0; i < s.length(); i++) |
71 |
|
{ |
72 |
4 |
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 |
|
} |