1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
package com.stevesoft.pat; |
9 |
|
|
10 |
|
import java.util.Hashtable; |
11 |
|
|
12 |
|
|
|
|
| 51.9% |
Uncovered Elements: 26 (54) |
Complexity: 23 |
Complexity Density: 0.85 |
|
13 |
|
class Boundary extends Pattern |
14 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
15 |
0 |
public String toString()... |
16 |
|
{ |
17 |
0 |
return "\\b" + nextString(); |
18 |
|
} |
19 |
|
|
|
|
| 52.9% |
Uncovered Elements: 8 (17) |
Complexity: 8 |
Complexity Density: 0.89 |
|
20 |
26 |
boolean isAChar(char c)... |
21 |
|
{ |
22 |
26 |
if (c >= 'a' && c <= 'z') |
23 |
|
{ |
24 |
0 |
return true; |
25 |
|
} |
26 |
26 |
if (c >= 'A' && c <= 'Z') |
27 |
|
{ |
28 |
0 |
return true; |
29 |
|
} |
30 |
26 |
if (c >= '0' && c <= '9') |
31 |
|
{ |
32 |
0 |
return true; |
33 |
|
} |
34 |
26 |
if (c == '_') |
35 |
|
{ |
36 |
0 |
return true; |
37 |
|
} |
38 |
26 |
return false; |
39 |
|
} |
40 |
|
|
|
|
| 33.3% |
Uncovered Elements: 6 (9) |
Complexity: 4 |
Complexity Density: 0.8 |
|
41 |
62 |
boolean matchLeft(int pos, Pthings pt)... |
42 |
|
{ |
43 |
62 |
if (pos <= 0) |
44 |
|
{ |
45 |
62 |
return true; |
46 |
|
} |
47 |
0 |
if (isAChar(pt.src.charAt(pos)) && isAChar(pt.src.charAt(pos - 1))) |
48 |
|
{ |
49 |
0 |
return false; |
50 |
|
} |
51 |
0 |
return true; |
52 |
|
} |
53 |
|
|
|
|
| 69.2% |
Uncovered Elements: 4 (13) |
Complexity: 5 |
Complexity Density: 0.71 |
|
54 |
88 |
boolean matchRight(int pos, Pthings pt)... |
55 |
|
{ |
56 |
88 |
if (pos < 0) |
57 |
|
{ |
58 |
62 |
return false; |
59 |
|
} |
60 |
26 |
if (pos + 1 >= pt.src.length()) |
61 |
|
{ |
62 |
0 |
return true; |
63 |
|
} |
64 |
26 |
if (isAChar(pt.src.charAt(pos)) && isAChar(pt.src.charAt(pos + 1))) |
65 |
|
{ |
66 |
0 |
return false; |
67 |
|
} |
68 |
26 |
return true; |
69 |
|
} |
70 |
|
|
|
|
| 60% |
Uncovered Elements: 2 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
71 |
88 |
public int matchInternal(int pos, Pthings pt)... |
72 |
|
{ |
73 |
88 |
if (matchRight(pos - 1, pt) || matchLeft(pos, pt)) |
74 |
|
{ |
75 |
88 |
return nextMatch(pos, pt); |
76 |
|
} |
77 |
0 |
return -1; |
78 |
|
} |
79 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
80 |
0 |
public patInt maxChars()... |
81 |
|
{ |
82 |
0 |
return new patInt(0); |
83 |
|
} |
84 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
85 |
0 |
public Pattern clone1(Hashtable h)... |
86 |
|
{ |
87 |
0 |
return new Boundary(); |
88 |
|
} |
89 |
|
}; |