1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
package com.stevesoft.pat.wrap; |
9 |
|
|
10 |
|
import com.stevesoft.pat.BasicStringBufferLike; |
11 |
|
import com.stevesoft.pat.StringLike; |
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
|
|
| 0% |
Uncovered Elements: 30 (30) |
Complexity: 12 |
Complexity Density: 0.8 |
|
16 |
|
public class CharArrayWrap implements StringLike |
17 |
|
{ |
18 |
|
char[] ca; |
19 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
20 |
0 |
public char[] getCharArray()... |
21 |
|
{ |
22 |
0 |
return ca; |
23 |
|
} |
24 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
25 |
0 |
public CharArrayWrap(char[] ca)... |
26 |
|
{ |
27 |
0 |
this.ca = ca; |
28 |
|
} |
29 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
30 |
0 |
public String toString()... |
31 |
|
{ |
32 |
0 |
return new String(ca); |
33 |
|
} |
34 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
35 |
0 |
public char charAt(int i)... |
36 |
|
{ |
37 |
0 |
return ca[i]; |
38 |
|
} |
39 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
40 |
0 |
public int length()... |
41 |
|
{ |
42 |
0 |
return ca.length; |
43 |
|
} |
44 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
45 |
0 |
public String substring(int i1, int i2)... |
46 |
|
{ |
47 |
0 |
StringBuffer sb = new StringBuffer(); |
48 |
0 |
for (int i = i1; i < i2; i++) |
49 |
|
{ |
50 |
0 |
sb.append(ca[i]); |
51 |
|
} |
52 |
0 |
return sb.toString(); |
53 |
|
} |
54 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
55 |
0 |
public Object unwrap()... |
56 |
|
{ |
57 |
0 |
return ca; |
58 |
|
} |
59 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
60 |
0 |
public BasicStringBufferLike newStringBufferLike()... |
61 |
|
{ |
62 |
0 |
return new CharArrayBufferWrap(); |
63 |
|
} |
64 |
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 3 |
Complexity Density: 0.75 |
|
65 |
0 |
public int indexOf(char c)... |
66 |
|
{ |
67 |
0 |
for (int i = 0; i < ca.length; i++) |
68 |
|
{ |
69 |
0 |
if (ca[i] == c) |
70 |
|
{ |
71 |
0 |
return i; |
72 |
|
} |
73 |
|
} |
74 |
0 |
return -1; |
75 |
|
} |
76 |
|
} |