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 |
|
|
|
|
| 0% |
Uncovered Elements: 67 (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 |
|
|
|
|
| 0% |
Uncovered Elements: 10 (10) |
Complexity: 2 |
Complexity Density: 0.25 |
|
56 |
0 |
protected ArgValue(Arg a, SubVals sv, Type type, String content,... |
57 |
|
int argIndex, boolean setByWildcardLinkedId, String givenLinkedId, |
58 |
|
String assignedLinkedId) |
59 |
|
{ |
60 |
0 |
this.arg = a; |
61 |
0 |
this.value = content; |
62 |
0 |
this.argIndex = argIndex; |
63 |
0 |
this.subVals = sv == null ? new SubVals("") : sv; |
64 |
0 |
this.setType(type); |
65 |
0 |
this.setByWildcardLinkedId = setByWildcardLinkedId; |
66 |
0 |
this.givenLinkedId = givenLinkedId; |
67 |
0 |
this.assignedLinkedId = assignedLinkedId; |
68 |
|
} |
69 |
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 1 |
Complexity Density: 0.12 |
|
70 |
0 |
protected ArgValue(Arg a, Type type, String value, int argIndex,... |
71 |
|
boolean setByWildcardLinkedId, String givenLinkedId, |
72 |
|
String assignedLinkedId) |
73 |
|
{ |
74 |
0 |
this.arg = a; |
75 |
0 |
this.argIndex = argIndex; |
76 |
0 |
this.subVals = new SubVals(value); |
77 |
0 |
this.value = getSubVals().getContent(); |
78 |
0 |
this.setType(type); |
79 |
0 |
this.setByWildcardLinkedId = setByWildcardLinkedId; |
80 |
0 |
this.givenLinkedId = givenLinkedId; |
81 |
0 |
this.assignedLinkedId = assignedLinkedId; |
82 |
|
} |
83 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
84 |
0 |
protected void setType(Type t)... |
85 |
|
{ |
86 |
0 |
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 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
95 |
0 |
public Arg getArg()... |
96 |
|
{ |
97 |
0 |
return arg; |
98 |
|
} |
99 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
100 |
0 |
public String getValue()... |
101 |
|
{ |
102 |
0 |
return value; |
103 |
|
} |
104 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
105 |
0 |
public int getArgIndex()... |
106 |
|
{ |
107 |
0 |
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 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
120 |
0 |
public SubVals getSubVals()... |
121 |
|
{ |
122 |
0 |
return subVals; |
123 |
|
} |
124 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
125 |
0 |
public String getSubVal(String key)... |
126 |
|
{ |
127 |
0 |
if (subVals == null || !subVals.has(key)) |
128 |
0 |
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 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
137 |
0 |
@Override... |
138 |
|
public final int compareTo(ArgValue o) |
139 |
|
{ |
140 |
0 |
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 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
160 |
0 |
public String getGivenLinkedId()... |
161 |
|
{ |
162 |
0 |
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 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
170 |
0 |
public boolean setByWildcardLinkedId()... |
171 |
|
{ |
172 |
|
|
173 |
0 |
return this.setByWildcardLinkedId && this.getGivenLinkedId() != null; |
174 |
|
} |
175 |
|
} |