1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.util.matcher; |
22 |
|
|
23 |
|
import jalview.util.MessageManager; |
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
|
|
| 84.2% |
Uncovered Elements: 3 (19) |
Complexity: 7 |
Complexity Density: 0.64 |
|
29 |
|
public enum Condition |
30 |
|
{ |
31 |
|
Contains(false, true, "Contains"), |
32 |
|
NotContains(false, true, "NotContains"), Matches(false, true, "Matches"), |
33 |
|
NotMatches(false, true, "NotMatches"), Present(false, false, "Present"), |
34 |
|
NotPresent(false, false, "NotPresent"), EQ(true, true, "EQ"), |
35 |
|
NE(true, true, "NE"), LT(true, true, "LT"), LE(true, true, "LE"), |
36 |
|
GT(true, true, "GT"), GE(true, true, "GE"); |
37 |
|
|
38 |
|
private boolean numeric; |
39 |
|
|
40 |
|
private boolean needsAPattern; |
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
private String stableName; |
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
|
52 |
|
|
53 |
|
@param |
54 |
|
@return |
55 |
|
|
|
|
| 83.3% |
Uncovered Elements: 1 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
56 |
5 |
public static Condition fromString(String stableName)... |
57 |
|
{ |
58 |
5 |
for (Condition c : values()) |
59 |
|
{ |
60 |
31 |
if (c.stableName.equalsIgnoreCase(stableName)) |
61 |
|
{ |
62 |
5 |
return c; |
63 |
|
} |
64 |
|
} |
65 |
0 |
return null; |
66 |
|
} |
67 |
|
|
68 |
|
|
69 |
|
|
70 |
|
|
71 |
|
@param |
72 |
|
@param |
73 |
|
@param |
74 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
75 |
12 |
Condition(boolean isNumeric, boolean needsPattern, String stablename)... |
76 |
|
{ |
77 |
12 |
numeric = isNumeric; |
78 |
12 |
needsAPattern = needsPattern; |
79 |
12 |
stableName = stablename; |
80 |
|
} |
81 |
|
|
82 |
|
|
83 |
|
|
84 |
|
|
85 |
|
|
86 |
|
@return |
87 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
88 |
22 |
public boolean isNumeric()... |
89 |
|
{ |
90 |
22 |
return numeric; |
91 |
|
} |
92 |
|
|
93 |
|
|
94 |
|
|
95 |
|
|
96 |
|
|
97 |
|
@return |
98 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
99 |
5 |
public boolean needsAPattern()... |
100 |
|
{ |
101 |
5 |
return needsAPattern; |
102 |
|
} |
103 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
104 |
10 |
public String getStableName()... |
105 |
|
{ |
106 |
10 |
return stableName; |
107 |
|
} |
108 |
|
|
109 |
|
|
110 |
|
|
111 |
|
|
112 |
|
|
113 |
|
|
114 |
|
@return |
115 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
116 |
0 |
@Override... |
117 |
|
public String toString() |
118 |
|
{ |
119 |
0 |
return MessageManager.getStringOrReturn("label.matchCondition_", |
120 |
|
name()); |
121 |
|
} |
122 |
|
} |