| 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 |
168 |
boolean isAChar(char c)... |
| 21 |
|
{ |
| 22 |
168 |
if (c >= 'a' && c <= 'z') |
| 23 |
|
{ |
| 24 |
0 |
return true; |
| 25 |
|
} |
| 26 |
168 |
if (c >= 'A' && c <= 'Z') |
| 27 |
|
{ |
| 28 |
0 |
return true; |
| 29 |
|
} |
| 30 |
168 |
if (c >= '0' && c <= '9') |
| 31 |
|
{ |
| 32 |
0 |
return true; |
| 33 |
|
} |
| 34 |
168 |
if (c == '_') |
| 35 |
|
{ |
| 36 |
0 |
return true; |
| 37 |
|
} |
| 38 |
168 |
return false; |
| 39 |
|
} |
| 40 |
|
|
| |
|
| 33.3% |
Uncovered Elements: 6 (9) |
Complexity: 4 |
Complexity Density: 0.8 |
|
| 41 |
388 |
boolean matchLeft(int pos, Pthings pt)... |
| 42 |
|
{ |
| 43 |
388 |
if (pos <= 0) |
| 44 |
|
{ |
| 45 |
388 |
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 |
556 |
boolean matchRight(int pos, Pthings pt)... |
| 55 |
|
{ |
| 56 |
556 |
if (pos < 0) |
| 57 |
|
{ |
| 58 |
388 |
return false; |
| 59 |
|
} |
| 60 |
168 |
if (pos + 1 >= pt.src.length()) |
| 61 |
|
{ |
| 62 |
0 |
return true; |
| 63 |
|
} |
| 64 |
168 |
if (isAChar(pt.src.charAt(pos)) && isAChar(pt.src.charAt(pos + 1))) |
| 65 |
|
{ |
| 66 |
0 |
return false; |
| 67 |
|
} |
| 68 |
168 |
return true; |
| 69 |
|
} |
| 70 |
|
|
| |
|
| 60% |
Uncovered Elements: 2 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
| 71 |
556 |
public int matchInternal(int pos, Pthings pt)... |
| 72 |
|
{ |
| 73 |
556 |
if (matchRight(pos - 1, pt) || matchLeft(pos, pt)) |
| 74 |
|
{ |
| 75 |
556 |
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 |
|
}; |