1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.bin.argparser; |
22 |
|
|
23 |
|
import jalview.bin.argparser.Arg.Opt; |
24 |
|
import jalview.bin.argparser.Arg.Type; |
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
|
|
| 59.7% |
Uncovered Elements: 27 (67) |
Complexity: 22 |
Complexity Density: 0.52 |
|
29 |
|
public class ArgValue implements Comparable<ArgValue> |
30 |
|
{ |
31 |
|
private Arg arg; |
32 |
|
|
33 |
|
private int argIndex; |
34 |
|
|
35 |
|
private String value; |
36 |
|
|
37 |
|
private String givenLinkedId = null; |
38 |
|
|
39 |
|
private String assignedLinkedId = null; |
40 |
|
|
41 |
|
private boolean setByWildcardLinkedId = false; |
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
private Type type = null; |
47 |
|
|
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
|
52 |
|
private String id; |
53 |
|
|
54 |
|
private SubVals subVals; |
55 |
|
|
|
|
| 90% |
Uncovered Elements: 1 (10) |
Complexity: 2 |
Complexity Density: 0.25 |
|
56 |
157 |
protected ArgValue(Arg a, SubVals sv, Type type, String content,... |
57 |
|
int argIndex, boolean setByWildcardLinkedId, String givenLinkedId, |
58 |
|
String assignedLinkedId) |
59 |
|
{ |
60 |
157 |
this.arg = a; |
61 |
157 |
this.value = content; |
62 |
157 |
this.argIndex = argIndex; |
63 |
157 |
this.subVals = sv == null ? new SubVals("") : sv; |
64 |
157 |
this.setType(type); |
65 |
157 |
this.setByWildcardLinkedId = setByWildcardLinkedId; |
66 |
157 |
this.givenLinkedId = givenLinkedId; |
67 |
157 |
this.assignedLinkedId = assignedLinkedId; |
68 |
|
} |
69 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 1 |
Complexity Density: 0.12 |
|
70 |
169 |
protected ArgValue(Arg a, Type type, String value, int argIndex,... |
71 |
|
boolean setByWildcardLinkedId, String givenLinkedId, |
72 |
|
String assignedLinkedId) |
73 |
|
{ |
74 |
169 |
this.arg = a; |
75 |
169 |
this.argIndex = argIndex; |
76 |
169 |
this.subVals = new SubVals(value); |
77 |
169 |
this.value = getSubVals().getContent(); |
78 |
169 |
this.setType(type); |
79 |
169 |
this.setByWildcardLinkedId = setByWildcardLinkedId; |
80 |
169 |
this.givenLinkedId = givenLinkedId; |
81 |
169 |
this.assignedLinkedId = assignedLinkedId; |
82 |
|
} |
83 |
|
|
|
|
| 50% |
Uncovered Elements: 2 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
84 |
326 |
protected void setType(Type t)... |
85 |
|
{ |
86 |
326 |
if (this.getArg().hasOption(Opt.HASTYPE)) |
87 |
0 |
this.type = t; |
88 |
|
} |
89 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
90 |
0 |
public Type getType()... |
91 |
|
{ |
92 |
0 |
return type; |
93 |
|
} |
94 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
95 |
471 |
public Arg getArg()... |
96 |
|
{ |
97 |
471 |
return arg; |
98 |
|
} |
99 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
100 |
733 |
public String getValue()... |
101 |
|
{ |
102 |
733 |
return value; |
103 |
|
} |
104 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
105 |
1227 |
public int getArgIndex()... |
106 |
|
{ |
107 |
1227 |
return argIndex; |
108 |
|
} |
109 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
110 |
0 |
protected void setId(String i)... |
111 |
|
{ |
112 |
0 |
id = i; |
113 |
|
} |
114 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
115 |
0 |
public String getId()... |
116 |
|
{ |
117 |
0 |
return id; |
118 |
|
} |
119 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
120 |
478 |
public SubVals getSubVals()... |
121 |
|
{ |
122 |
478 |
return subVals; |
123 |
|
} |
124 |
|
|
|
|
| 60% |
Uncovered Elements: 2 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
125 |
12 |
public String getSubVal(String key)... |
126 |
|
{ |
127 |
12 |
if (subVals == null || !subVals.has(key)) |
128 |
12 |
return null; |
129 |
0 |
return subVals.get(key); |
130 |
|
} |
131 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
132 |
0 |
protected void putSubVal(String key, String val)... |
133 |
|
{ |
134 |
0 |
this.subVals.put(key, val); |
135 |
|
} |
136 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
137 |
12 |
@Override... |
138 |
|
public final int compareTo(ArgValue o) |
139 |
|
{ |
140 |
12 |
return this.getArgIndex() - o.getArgIndex(); |
141 |
|
} |
142 |
|
|
|
|
| 0% |
Uncovered Elements: 11 (11) |
Complexity: 2 |
Complexity Density: 0.22 |
|
143 |
0 |
@Override... |
144 |
|
public String toString() |
145 |
|
{ |
146 |
0 |
StringBuilder sb = new StringBuilder(); |
147 |
0 |
sb.append(this.getArg().argString()); |
148 |
0 |
sb.append("="); |
149 |
0 |
if (!this.getSubVals().getSubValMap().isEmpty()) |
150 |
|
{ |
151 |
0 |
sb.append(this.getSubVals().toString()); |
152 |
|
} |
153 |
0 |
sb.append("'"); |
154 |
0 |
sb.append(this.getValue()); |
155 |
0 |
sb.append("'"); |
156 |
|
|
157 |
0 |
return sb.toString(); |
158 |
|
} |
159 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
160 |
79 |
public String getGivenLinkedId()... |
161 |
|
{ |
162 |
79 |
return this.givenLinkedId; |
163 |
|
} |
164 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
165 |
0 |
public String getAssignedLinkedId()... |
166 |
|
{ |
167 |
0 |
return this.assignedLinkedId; |
168 |
|
} |
169 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
170 |
86 |
public boolean setByWildcardLinkedId()... |
171 |
|
{ |
172 |
|
|
173 |
86 |
return this.setByWildcardLinkedId && this.getGivenLinkedId() != null; |
174 |
|
} |
175 |
|
} |