| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
|
| 20 |
|
|
| 21 |
|
package jalview.datamodel; |
| 22 |
|
|
| 23 |
|
import java.util.Collections; |
| 24 |
|
import java.util.Enumeration; |
| 25 |
|
import java.util.Hashtable; |
| 26 |
|
|
| 27 |
|
import jalview.io.DataSourceType; |
| 28 |
|
import jalview.io.StructureFile; |
| 29 |
|
import jalview.structure.StructureImportSettings.TFType; |
| 30 |
|
import jalview.util.CaseInsensitiveString; |
| 31 |
|
|
| |
|
| 81.9% |
Uncovered Elements: 51 (281) |
Complexity: 119 |
Complexity Density: 0.82 |
|
| 32 |
|
public class PDBEntry |
| 33 |
|
{ |
| 34 |
|
|
| 35 |
|
|
| 36 |
|
|
| 37 |
|
|
| 38 |
|
private static final String CHAIN_ID = "chain_code"; |
| 39 |
|
|
| 40 |
|
private Hashtable<String, Object> properties; |
| 41 |
|
|
| 42 |
|
private static final int PDB_ID_LENGTH = 4; |
| 43 |
|
|
| 44 |
|
|
| 45 |
|
|
| 46 |
|
|
| 47 |
|
|
| 48 |
|
private static final String FAKED_ID = "faked_pdbid"; |
| 49 |
|
|
| 50 |
|
|
| 51 |
|
|
| 52 |
|
|
| 53 |
|
|
| 54 |
|
private static final String AUTHORITATIVE_ID = "authoritative_pdbid"; |
| 55 |
|
|
| 56 |
|
private String file; |
| 57 |
|
|
| 58 |
|
private String type; |
| 59 |
|
|
| 60 |
|
private String id; |
| 61 |
|
|
| 62 |
|
private StructureFile sf = null; |
| 63 |
|
|
| |
|
| 75% |
Uncovered Elements: 4 (16) |
Complexity: 6 |
Complexity Density: 0.67 |
|
| 64 |
|
public enum Type |
| 65 |
|
{ |
| 66 |
|
|
| 67 |
|
|
| 68 |
|
PDB("pdb", "pdb"), MMCIF("mmcif", "cif"), BCIF("bcif", "bcif"), |
| 69 |
|
FILE("?", "?"); |
| 70 |
|
|
| 71 |
|
|
| 72 |
|
|
| 73 |
|
|
| 74 |
|
@see |
| 75 |
|
|
| 76 |
|
String ext; |
| 77 |
|
|
| 78 |
|
|
| 79 |
|
|
| 80 |
|
@see |
| 81 |
|
|
| 82 |
|
String format; |
| 83 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 84 |
220 |
private Type(String fmt, String ex)... |
| 85 |
|
{ |
| 86 |
220 |
format = fmt; |
| 87 |
220 |
ext = ex; |
| 88 |
|
} |
| 89 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 90 |
0 |
public String getFormat()... |
| 91 |
|
{ |
| 92 |
0 |
return format; |
| 93 |
|
} |
| 94 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 95 |
0 |
public String getExtension()... |
| 96 |
|
{ |
| 97 |
0 |
return ext; |
| 98 |
|
} |
| 99 |
|
|
| 100 |
|
|
| 101 |
|
|
| 102 |
|
|
| 103 |
|
@param |
| 104 |
|
@return |
| 105 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
| 106 |
288 |
public static Type getType(String value)... |
| 107 |
|
{ |
| 108 |
288 |
for (Type t : Type.values()) |
| 109 |
|
{ |
| 110 |
468 |
if (t.toString().equalsIgnoreCase(value)) |
| 111 |
|
{ |
| 112 |
287 |
return t; |
| 113 |
|
} |
| 114 |
|
} |
| 115 |
1 |
return null; |
| 116 |
|
} |
| 117 |
|
|
| 118 |
|
|
| 119 |
|
|
| 120 |
|
|
| 121 |
|
@param |
| 122 |
|
@return |
| 123 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 124 |
4 |
public boolean matches(String t)... |
| 125 |
|
{ |
| 126 |
4 |
return (this.toString().equalsIgnoreCase(t)); |
| 127 |
|
} |
| 128 |
|
} |
| 129 |
|
|
| 130 |
|
|
| 131 |
|
|
| 132 |
|
|
| 133 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (17) |
Complexity: 7 |
Complexity Density: 0.64 |
|
| 134 |
17878 |
@Override... |
| 135 |
|
public boolean equals(Object obj) |
| 136 |
|
{ |
| 137 |
17878 |
if (obj == null || !(obj instanceof PDBEntry)) |
| 138 |
|
{ |
| 139 |
2 |
return false; |
| 140 |
|
} |
| 141 |
17876 |
if (obj == this) |
| 142 |
|
{ |
| 143 |
11 |
return true; |
| 144 |
|
} |
| 145 |
17865 |
PDBEntry o = (PDBEntry) obj; |
| 146 |
|
|
| 147 |
|
|
| 148 |
|
|
| 149 |
|
|
| 150 |
|
|
| 151 |
|
|
| 152 |
17865 |
boolean idMatches = id == o.id |
| 153 |
|
|| (id != null && id.equalsIgnoreCase(o.id)); |
| 154 |
17865 |
boolean fileMatches = file == o.file |
| 155 |
|
|| (file != null && file.equals(o.file)); |
| 156 |
17865 |
boolean typeMatches = type == o.type |
| 157 |
|
|| (type != null && type.equals(o.type)); |
| 158 |
17865 |
if (idMatches && fileMatches && typeMatches) |
| 159 |
|
{ |
| 160 |
496 |
return properties == o.properties |
| 161 |
|
|| (properties != null && properties.equals(o.properties)); |
| 162 |
|
} |
| 163 |
17369 |
return false; |
| 164 |
|
} |
| 165 |
|
|
| 166 |
|
|
| 167 |
|
|
| 168 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 169 |
992 |
public PDBEntry()... |
| 170 |
|
{ |
| 171 |
|
} |
| 172 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 173 |
91 |
public PDBEntry(String pdbId, String chain, PDBEntry.Type type,... |
| 174 |
|
String filePath) |
| 175 |
|
{ |
| 176 |
91 |
init(pdbId, chain, type, filePath); |
| 177 |
|
} |
| 178 |
|
|
| 179 |
|
|
| 180 |
|
@param |
| 181 |
|
@param |
| 182 |
|
@param |
| 183 |
|
@param |
| 184 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
| 185 |
303 |
void init(String pdbId, String chain, PDBEntry.Type entryType,... |
| 186 |
|
String filePath) |
| 187 |
|
{ |
| 188 |
303 |
this.id = pdbId; |
| 189 |
303 |
this.type = entryType == null ? null : entryType.toString(); |
| 190 |
303 |
this.file = filePath; |
| 191 |
303 |
setChainCode(chain); |
| 192 |
|
} |
| 193 |
|
|
| 194 |
|
|
| 195 |
|
|
| 196 |
|
|
| 197 |
|
@param |
| 198 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
| 199 |
146 |
public PDBEntry(PDBEntry entry)... |
| 200 |
|
{ |
| 201 |
146 |
file = entry.file; |
| 202 |
146 |
type = entry.type; |
| 203 |
146 |
id = entry.id; |
| 204 |
146 |
if (entry.properties != null) |
| 205 |
|
{ |
| 206 |
6 |
properties = (Hashtable<String, Object>) entry.properties.clone(); |
| 207 |
|
} |
| 208 |
|
} |
| 209 |
|
|
| 210 |
|
|
| 211 |
|
|
| 212 |
|
|
| 213 |
|
|
| 214 |
|
|
| 215 |
|
@param |
| 216 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (16) |
Complexity: 7 |
Complexity Density: 0.7 |
|
| 217 |
213 |
public PDBEntry(DBRefEntry dbr)... |
| 218 |
|
{ |
| 219 |
213 |
if (!DBRefSource.PDB.equals(dbr.getSource())) |
| 220 |
|
{ |
| 221 |
1 |
throw new IllegalArgumentException( |
| 222 |
|
"Invalid source: " + dbr.getSource()); |
| 223 |
|
} |
| 224 |
|
|
| 225 |
212 |
String pdbId = dbr.getAccessionId(); |
| 226 |
212 |
String chainCode = null; |
| 227 |
212 |
if (pdbId.length() == PDB_ID_LENGTH + 1) |
| 228 |
|
{ |
| 229 |
17 |
char chain = pdbId.charAt(PDB_ID_LENGTH); |
| 230 |
17 |
if (('a' <= chain && chain <= 'z') || ('A' <= chain && chain <= 'Z')) |
| 231 |
|
{ |
| 232 |
15 |
pdbId = pdbId.substring(0, PDB_ID_LENGTH); |
| 233 |
15 |
chainCode = String.valueOf(chain); |
| 234 |
|
} |
| 235 |
|
} |
| 236 |
212 |
init(pdbId, chainCode, null, null); |
| 237 |
|
} |
| 238 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 239 |
671 |
public void setFile(String f)... |
| 240 |
|
{ |
| 241 |
671 |
this.file = f; |
| 242 |
|
} |
| 243 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 244 |
20716 |
public String getFile()... |
| 245 |
|
{ |
| 246 |
20716 |
return file; |
| 247 |
|
} |
| 248 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 249 |
381 |
public void setType(String t)... |
| 250 |
|
{ |
| 251 |
381 |
this.type = t; |
| 252 |
|
} |
| 253 |
|
|
| |
|
| 66.7% |
Uncovered Elements: 1 (3) |
Complexity: 2 |
Complexity Density: 2 |
|
| 254 |
251 |
public void setType(PDBEntry.Type type)... |
| 255 |
|
{ |
| 256 |
251 |
this.type = type == null ? null : type.toString(); |
| 257 |
|
} |
| 258 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 259 |
499 |
public String getType()... |
| 260 |
|
{ |
| 261 |
499 |
return type; |
| 262 |
|
} |
| 263 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 264 |
992 |
public void setId(String id)... |
| 265 |
|
{ |
| 266 |
992 |
this.id = id; |
| 267 |
|
} |
| 268 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 269 |
53221 |
public String getId()... |
| 270 |
|
{ |
| 271 |
53221 |
return id; |
| 272 |
|
} |
| 273 |
|
|
| |
|
| 70% |
Uncovered Elements: 3 (10) |
Complexity: 4 |
Complexity Density: 0.67 |
|
| 274 |
1272 |
public void setProperty(String key, Object value)... |
| 275 |
|
{ |
| 276 |
1272 |
if (this.properties == null) |
| 277 |
|
{ |
| 278 |
683 |
this.properties = new Hashtable<String, Object>(); |
| 279 |
|
} |
| 280 |
1272 |
if (key!=null && value==null) |
| 281 |
|
{ |
| 282 |
0 |
properties.remove(key); |
| 283 |
0 |
return; |
| 284 |
|
} |
| 285 |
|
|
| 286 |
1272 |
properties.put(key, value); |
| 287 |
|
} |
| 288 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 2 |
Complexity Density: 2 |
|
| 289 |
1101 |
public Object getProperty(String key)... |
| 290 |
|
{ |
| 291 |
1101 |
return properties == null ? null : properties.get(key); |
| 292 |
|
} |
| 293 |
|
|
| 294 |
|
|
| 295 |
|
|
| 296 |
|
|
| 297 |
|
|
| 298 |
|
@return |
| 299 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
| 300 |
309 |
public Enumeration<String> getProperties()... |
| 301 |
|
{ |
| 302 |
309 |
if (properties == null) |
| 303 |
|
{ |
| 304 |
172 |
return Collections.emptyEnumeration(); |
| 305 |
|
} |
| 306 |
137 |
return properties.keys(); |
| 307 |
|
} |
| 308 |
|
|
| 309 |
|
|
| 310 |
|
|
| 311 |
|
@return |
| 312 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 3 |
Complexity Density: 3 |
|
| 313 |
445 |
public String getChainCode()... |
| 314 |
|
{ |
| 315 |
445 |
return (properties == null || properties.get(CHAIN_ID) == null) ? null |
| 316 |
|
: properties.get(CHAIN_ID).toString(); |
| 317 |
|
} |
| 318 |
|
|
| 319 |
|
|
| 320 |
|
|
| 321 |
|
|
| 322 |
|
|
| 323 |
|
|
| 324 |
|
@param |
| 325 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
| 326 |
721 |
public void setChainCode(String chainCode)... |
| 327 |
|
{ |
| 328 |
721 |
if (chainCode == null) |
| 329 |
|
{ |
| 330 |
227 |
deleteProperty(CHAIN_ID); |
| 331 |
|
} |
| 332 |
|
else |
| 333 |
|
{ |
| 334 |
494 |
setProperty(CHAIN_ID, new CaseInsensitiveString(chainCode)); |
| 335 |
|
} |
| 336 |
|
} |
| 337 |
|
|
| 338 |
|
|
| 339 |
|
|
| 340 |
|
|
| 341 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
| 342 |
227 |
Object deleteProperty(String key)... |
| 343 |
|
{ |
| 344 |
227 |
Object result = null; |
| 345 |
227 |
if (properties != null) |
| 346 |
|
{ |
| 347 |
1 |
result = properties.remove(key); |
| 348 |
|
} |
| 349 |
227 |
return result; |
| 350 |
|
} |
| 351 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 352 |
26 |
@Override... |
| 353 |
|
public String toString() |
| 354 |
|
{ |
| 355 |
26 |
return id; |
| 356 |
|
} |
| 357 |
|
|
| 358 |
|
|
| 359 |
|
|
| 360 |
|
|
| 361 |
|
|
| 362 |
|
@deprecated |
| 363 |
|
@see |
| 364 |
|
@see |
| 365 |
|
@see |
| 366 |
|
@return |
| 367 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 368 |
0 |
@Deprecated... |
| 369 |
|
public Hashtable<String, Object> getProps() |
| 370 |
|
{ |
| 371 |
0 |
return properties; |
| 372 |
|
} |
| 373 |
|
|
| 374 |
|
|
| 375 |
|
|
| 376 |
|
|
| 377 |
|
|
| 378 |
|
@deprecated |
| 379 |
|
@return |
| 380 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 381 |
0 |
@Deprecated... |
| 382 |
|
public void setProps(Hashtable<String, Object> props) |
| 383 |
|
{ |
| 384 |
0 |
properties = props; |
| 385 |
|
} |
| 386 |
|
|
| 387 |
|
|
| 388 |
|
|
| 389 |
|
|
| 390 |
|
|
| 391 |
|
|
| 392 |
|
|
| 393 |
|
|
| 394 |
|
|
| 395 |
|
@param |
| 396 |
|
@return |
| 397 |
|
|
| |
|
| 93.7% |
Uncovered Elements: 4 (63) |
Complexity: 27 |
Complexity Density: 0.77 |
|
| 398 |
17831 |
public boolean updateFrom(PDBEntry newEntry)... |
| 399 |
|
{ |
| 400 |
17831 |
if (this.equals(newEntry)) |
| 401 |
|
{ |
| 402 |
446 |
return true; |
| 403 |
|
} |
| 404 |
|
|
| 405 |
17385 |
String newId = newEntry.getId(); |
| 406 |
17385 |
if (newId == null || getId() == null) |
| 407 |
|
{ |
| 408 |
0 |
return false; |
| 409 |
|
} |
| 410 |
|
|
| 411 |
17385 |
boolean idMatches = getId().equalsIgnoreCase(newId); |
| 412 |
|
|
| 413 |
|
|
| 414 |
|
|
| 415 |
|
|
| 416 |
17385 |
String newFile = newEntry.getFile(); |
| 417 |
17385 |
if (newFile != null && getFile() != null) |
| 418 |
|
{ |
| 419 |
293 |
if (!newFile.equals(getFile())) |
| 420 |
|
{ |
| 421 |
185 |
return false; |
| 422 |
|
} |
| 423 |
|
else |
| 424 |
|
{ |
| 425 |
|
|
| 426 |
108 |
if (!idMatches) |
| 427 |
|
{ |
| 428 |
|
|
| 429 |
|
|
| 430 |
|
|
| 431 |
2 |
if (!newEntry.fakedPDBId() && !isAuthoritative()) |
| 432 |
|
{ |
| 433 |
0 |
return false; |
| 434 |
|
} |
| 435 |
|
} |
| 436 |
|
} |
| 437 |
|
} |
| 438 |
|
else |
| 439 |
|
{ |
| 440 |
|
|
| 441 |
17092 |
if (!idMatches) |
| 442 |
|
{ |
| 443 |
17019 |
return false; |
| 444 |
|
} |
| 445 |
|
} |
| 446 |
|
|
| 447 |
|
|
| 448 |
|
|
| 449 |
|
|
| 450 |
181 |
String newChain = newEntry.getChainCode(); |
| 451 |
181 |
if (newChain != null && newChain.length() > 0 && getChainCode() != null |
| 452 |
|
&& getChainCode().length() > 0 |
| 453 |
|
&& !getChainCode().equalsIgnoreCase(newChain)) |
| 454 |
|
{ |
| 455 |
8 |
return false; |
| 456 |
|
} |
| 457 |
|
|
| 458 |
|
|
| 459 |
|
|
| 460 |
|
|
| 461 |
173 |
String newType = newEntry.getType(); |
| 462 |
173 |
if (getFile() == null && newFile != null) |
| 463 |
|
{ |
| 464 |
3 |
setFile(newFile); |
| 465 |
3 |
setType(newType); |
| 466 |
|
} |
| 467 |
|
|
| 468 |
|
|
| 469 |
|
|
| 470 |
|
|
| 471 |
|
|
| 472 |
173 |
if (getType() == null && newType != null) |
| 473 |
|
{ |
| 474 |
7 |
setType(newType); |
| 475 |
|
} |
| 476 |
|
|
| 477 |
|
|
| 478 |
|
|
| 479 |
|
|
| 480 |
|
|
| 481 |
173 |
if (newChain != null && newChain.length() > 0 |
| 482 |
|
&& !newChain.equalsIgnoreCase(getChainCode())) |
| 483 |
|
{ |
| 484 |
18 |
setChainCode(newChain); |
| 485 |
|
} |
| 486 |
|
|
| 487 |
|
|
| 488 |
|
|
| 489 |
|
|
| 490 |
173 |
Enumeration<String> newProps = newEntry.getProperties(); |
| 491 |
218 |
while (newProps.hasMoreElements()) |
| 492 |
|
{ |
| 493 |
|
|
| 494 |
|
|
| 495 |
|
|
| 496 |
|
|
| 497 |
45 |
String key = newProps.nextElement(); |
| 498 |
45 |
Object value = newEntry.getProperty(key); |
| 499 |
45 |
if (FAKED_ID.equals(key) || AUTHORITATIVE_ID.equals(key)) |
| 500 |
|
{ |
| 501 |
|
|
| 502 |
1 |
continue; |
| 503 |
|
} |
| 504 |
44 |
if (!value.equals(getProperty(key))) |
| 505 |
|
{ |
| 506 |
11 |
setProperty(key, value); |
| 507 |
|
} |
| 508 |
|
} |
| 509 |
173 |
return true; |
| 510 |
|
} |
| 511 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 512 |
4 |
public void setAuthoritative(boolean isAuthoritative)... |
| 513 |
|
{ |
| 514 |
4 |
setProperty(AUTHORITATIVE_ID, Boolean.valueOf(isAuthoritative)); |
| 515 |
|
} |
| 516 |
|
|
| 517 |
|
|
| 518 |
|
|
| 519 |
|
@return |
| 520 |
|
|
| 521 |
|
|
| |
|
| 87.5% |
Uncovered Elements: 1 (8) |
Complexity: 3 |
Complexity Density: 0.75 |
|
| 522 |
3 |
public boolean isAuthoritative()... |
| 523 |
|
{ |
| 524 |
3 |
if (_hasProperty(AUTHORITATIVE_ID)) |
| 525 |
|
{ |
| 526 |
2 |
Object authId = getProperty(AUTHORITATIVE_ID); |
| 527 |
2 |
return (authId instanceof Boolean) ? (Boolean) authId |
| 528 |
|
: Boolean.valueOf(authId.toString()); |
| 529 |
|
} |
| 530 |
1 |
return false; |
| 531 |
|
} |
| 532 |
|
|
| 533 |
|
|
| 534 |
|
|
| 535 |
|
|
| 536 |
|
@return |
| 537 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
| 538 |
4 |
public boolean fakedPDBId()... |
| 539 |
|
{ |
| 540 |
4 |
if (_hasProperty(FAKED_ID)) |
| 541 |
|
{ |
| 542 |
2 |
return true; |
| 543 |
|
} |
| 544 |
2 |
return false; |
| 545 |
|
} |
| 546 |
|
|
| |
|
| 75% |
Uncovered Elements: 2 (8) |
Complexity: 3 |
Complexity Density: 0.75 |
|
| 547 |
372 |
public void setFakedPDBId(boolean faked)... |
| 548 |
|
{ |
| 549 |
372 |
if (faked) |
| 550 |
|
{ |
| 551 |
127 |
setProperty(FAKED_ID, Boolean.TRUE); |
| 552 |
|
} |
| 553 |
|
else |
| 554 |
|
{ |
| 555 |
245 |
if (properties != null) |
| 556 |
|
{ |
| 557 |
0 |
properties.remove(FAKED_ID); |
| 558 |
|
} |
| 559 |
|
} |
| 560 |
|
} |
| 561 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 562 |
171 |
private boolean _hasProperty(final String key)... |
| 563 |
|
{ |
| 564 |
171 |
return (properties != null && properties.containsKey(key)); |
| 565 |
|
} |
| 566 |
|
|
| 567 |
|
private static final String RETRIEVE_FROM = "RETRIEVE_FROM"; |
| 568 |
|
|
| 569 |
|
private static final String PROVIDER = "PROVIDER"; |
| 570 |
|
|
| 571 |
|
private static final String MODELPAGE = "PROVIDERPAGE"; |
| 572 |
|
|
| 573 |
|
private static final String PROVIDERCATEGORY = "PROVIDERCATEGORY"; |
| 574 |
|
|
| 575 |
|
|
| 576 |
|
private static final String MODELCONFIDENCE = "MODELCONFIDENCE"; |
| 577 |
|
|
| 578 |
|
private static final String MODELCONFTYPE = "MODELCONFTYPE"; |
| 579 |
|
|
| 580 |
|
private static final String MODELCONFVER = "MODELCONFVER"; |
| 581 |
|
|
| 582 |
|
|
| 583 |
|
private static final String TEMPFACTYPE = "TFType"; |
| 584 |
|
private static final String PAEFILE = "PAEFile"; |
| 585 |
|
private final static String PROTOCOL="protocol"; |
| 586 |
|
|
| 587 |
|
|
| 588 |
|
|
| 589 |
|
|
| 590 |
|
@param |
| 591 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 592 |
2 |
public void setRetrievalUrl(String urlStr)... |
| 593 |
|
{ |
| 594 |
2 |
setProperty(RETRIEVE_FROM, urlStr); |
| 595 |
|
} |
| 596 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 597 |
0 |
public boolean hasRetrievalUrl()... |
| 598 |
|
{ |
| 599 |
0 |
return _hasProperty(RETRIEVE_FROM); |
| 600 |
|
} |
| 601 |
|
|
| 602 |
|
|
| 603 |
|
|
| 604 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 605 |
0 |
public String getRetrievalUrl()... |
| 606 |
|
{ |
| 607 |
0 |
return (String) getProperty(RETRIEVE_FROM); |
| 608 |
|
} |
| 609 |
|
|
| 610 |
|
|
| 611 |
|
|
| 612 |
|
|
| 613 |
|
@param |
| 614 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 615 |
5 |
public void setProvider(String provider)... |
| 616 |
|
{ |
| 617 |
5 |
setProperty(PROVIDER, provider); |
| 618 |
|
} |
| 619 |
|
|
| 620 |
|
|
| 621 |
|
|
| 622 |
|
|
| 623 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 624 |
314 |
public String getProvider()... |
| 625 |
|
{ |
| 626 |
314 |
return (String) getProperty(PROVIDER); |
| 627 |
|
} |
| 628 |
|
|
| 629 |
|
|
| 630 |
|
|
| 631 |
|
|
| 632 |
|
@param |
| 633 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 634 |
3 |
public void setProviderPage(String urlStr)... |
| 635 |
|
{ |
| 636 |
3 |
setProperty(MODELPAGE, urlStr); |
| 637 |
|
} |
| 638 |
|
|
| 639 |
|
|
| 640 |
|
|
| 641 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 642 |
0 |
public String getProviderPage()... |
| 643 |
|
{ |
| 644 |
0 |
return (String) getProperty(MODELPAGE); |
| 645 |
|
} |
| 646 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 647 |
0 |
public boolean hasProviderPage()... |
| 648 |
|
{ |
| 649 |
0 |
return _hasProperty(MODELPAGE); |
| 650 |
|
} |
| 651 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 652 |
0 |
public boolean hasProvider()... |
| 653 |
|
{ |
| 654 |
0 |
return _hasProperty(PROVIDER); |
| 655 |
|
} |
| 656 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 657 |
0 |
public StructureFile getStructureFile()... |
| 658 |
|
{ |
| 659 |
0 |
return sf; |
| 660 |
|
} |
| 661 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 662 |
87 |
public void setStructureFile(StructureFile f)... |
| 663 |
|
{ |
| 664 |
87 |
sf = f; |
| 665 |
|
} |
| 666 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 667 |
0 |
public boolean hasStructureFile()... |
| 668 |
|
{ |
| 669 |
0 |
return sf != null && sf.inFile != null && sf.inFile.exists(); |
| 670 |
|
} |
| 671 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 672 |
3 |
public void setProviderCategory(String providerCategory)... |
| 673 |
|
{ |
| 674 |
3 |
setProperty(PROVIDERCATEGORY, providerCategory); |
| 675 |
|
} |
| 676 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 677 |
0 |
public String getProviderCategory()... |
| 678 |
|
{ |
| 679 |
0 |
return (String) getProperty(PROVIDERCATEGORY); |
| 680 |
|
} |
| 681 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 682 |
0 |
public boolean hasProviderCategory()... |
| 683 |
|
{ |
| 684 |
0 |
return _hasProperty(PROVIDERCATEGORY); |
| 685 |
|
} |
| 686 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 687 |
56 |
public void setTempFacType(TFType tempfactype)... |
| 688 |
|
{ |
| 689 |
56 |
setProperty(TEMPFACTYPE, tempfactype.name()); |
| 690 |
|
} |
| 691 |
|
|
| 692 |
|
|
| 693 |
|
|
| 694 |
|
@return |
| 695 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 696 |
0 |
public String getTempFacType()... |
| 697 |
|
{ |
| 698 |
0 |
return (String) getProperty(TEMPFACTYPE); |
| 699 |
|
} |
| |
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
| 700 |
84 |
public TFType getTempFacTypeTFType()... |
| 701 |
|
{ |
| 702 |
84 |
if (_hasProperty(TEMPFACTYPE)) { |
| 703 |
38 |
return TFType.valueOf((String) getProperty(TEMPFACTYPE)); |
| 704 |
|
} |
| 705 |
46 |
return null; |
| 706 |
|
} |
| 707 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 708 |
0 |
public boolean hasTempFacType()... |
| 709 |
|
{ |
| 710 |
0 |
return _hasProperty(TEMPFACTYPE); |
| 711 |
|
} |
| 712 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 713 |
2 |
public void setModelConfidenceType(String modelConfType2)... |
| 714 |
|
{ |
| 715 |
2 |
setProperty(MODELCONFTYPE, modelConfType2); |
| 716 |
|
} |
| 717 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 718 |
0 |
public boolean hasModelConfidenceType()... |
| 719 |
|
{ |
| 720 |
0 |
return _hasProperty(MODELCONFTYPE); |
| 721 |
|
} |
| 722 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 723 |
2 |
public String getModelConfidenceType()... |
| 724 |
|
{ |
| 725 |
2 |
return (String) getProperty(MODELCONFTYPE); |
| 726 |
|
} |
| 727 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 728 |
1 |
public void setModelConfidenceVersion(String modelConfVer2)... |
| 729 |
|
{ |
| 730 |
1 |
setProperty(MODELCONFVER, modelConfVer2); |
| 731 |
|
} |
| 732 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 733 |
0 |
public boolean hasModelConfidenceVersion()... |
| 734 |
|
{ |
| 735 |
0 |
return _hasProperty(MODELCONFVER); |
| 736 |
|
} |
| 737 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 738 |
1 |
public String getModelConfidenceVersion()... |
| 739 |
|
{ |
| 740 |
1 |
return (String) getProperty(MODELCONFVER); |
| 741 |
|
} |
| 742 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 743 |
2 |
public void setModelConfidence(Double modelConf)... |
| 744 |
|
{ |
| 745 |
2 |
setProperty(MODELCONFIDENCE, modelConf); |
| 746 |
|
} |
| 747 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 748 |
0 |
public boolean hasModelConfidence()... |
| 749 |
|
{ |
| 750 |
0 |
return _hasProperty(MODELCONFIDENCE); |
| 751 |
|
} |
| 752 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 753 |
3 |
public Double getModelConfidence()... |
| 754 |
|
{ |
| 755 |
3 |
return (Double) getProperty(MODELCONFIDENCE); |
| 756 |
|
} |
| 757 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 758 |
39 |
public void setPAEFile(String paeFilename)... |
| 759 |
|
{ |
| 760 |
39 |
setProperty(PAEFILE,paeFilename); |
| 761 |
|
} |
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 762 |
80 |
public String getPAEFile()... |
| 763 |
|
{ |
| 764 |
80 |
return (String) getProperty(PAEFILE); |
| 765 |
|
} |
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 766 |
0 |
public boolean hasPAEFile()... |
| 767 |
|
{ |
| 768 |
0 |
return _hasProperty(PAEFILE); |
| 769 |
|
} |
| 770 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 771 |
0 |
public void setProtocol(DataSourceType protocol)... |
| 772 |
|
{ |
| 773 |
0 |
setProperty(PROTOCOL, protocol.name()); |
| 774 |
|
} |
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 775 |
0 |
public boolean hasProtocol()... |
| 776 |
|
{ |
| 777 |
0 |
return _hasProperty(PROTOCOL); |
| 778 |
|
} |
| |
|
| 60% |
Uncovered Elements: 2 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
| 779 |
80 |
public DataSourceType getProtocol()... |
| 780 |
|
{ |
| 781 |
80 |
if (_hasProperty(PROTOCOL)) |
| 782 |
|
{ |
| 783 |
0 |
return DataSourceType.valueOf((String) getProperty(PROTOCOL)); |
| 784 |
|
} |
| 785 |
|
|
| 786 |
80 |
return DataSourceType.FILE; |
| 787 |
|
} |
| 788 |
|
} |