Project

General

Profile

« Previous | Next » 

Revision 531fc7bc

Added by Andreas Müller almost 8 years ago

Remove generics from Reference in cdmlib (except for cdmlib-model) #5830

View differences:

cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/specimen/excel/in/SpecimenRow.java
1 1
/**
2 2
* Copyright (C) 2009 EDIT
3
* European Distributed Institute of Taxonomy 
3
* European Distributed Institute of Taxonomy
4 4
* http://www.e-taxonomy.eu
5
* 
5
*
6 6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7 7
* See LICENSE.TXT at the top of this package for the full license terms.
8 8
*/
......
55 55

  
56 56
	private String accessionNumber;
57 57
	private String barcode;
58
	
58

  
59 59
	//	private String author;
60 60

  
61 61
//	private String family;
......
63 63
//	private String specificEpithet;
64 64
	private String collectionCode;
65 65
	private String collection;
66
	
67
	
66

  
67

  
68 68
	private TreeMap<Integer, IdentifiableSource> sources = new TreeMap<Integer, IdentifiableSource>();
69 69
	private TreeMap<Integer, String> collectors = new TreeMap<Integer, String>();
70 70
	private TreeMap<Integer, String> unitNotes = new TreeMap<Integer, String>();
71 71
	private TreeMap<Integer, SpecimenTypeDesignation> types = new TreeMap<Integer, SpecimenTypeDesignation>();
72 72
	private TreeMap<Integer, DeterminationLight> determinations = new TreeMap<Integer, DeterminationLight>();
73
	private List<PostfixTerm> levels  = new ArrayList<PostfixTerm>(); 
74
	
73
	private List<PostfixTerm> levels  = new ArrayList<PostfixTerm>();
74

  
75

  
75 76

  
76
	
77 77
	public SpecimenRow() {
78 78
	}
79
	
80 79

  
81
	
80

  
81

  
82 82
	//	may be public if necessary
83 83
	protected class DeterminationLight{
84 84
		String taxonUuid;
......
93 93
		String determinedBy;
94 94
		String determinedWhen;
95 95
		String notes;
96
		
96

  
97 97
		public boolean hasTaxonInformation() {
98
			boolean result = StringUtils.isNotBlank(taxonUuid) 
99
			 	|| StringUtils.isNotBlank(family) 	
98
			boolean result = StringUtils.isNotBlank(taxonUuid)
99
			 	|| StringUtils.isNotBlank(family)
100 100
			 	|| StringUtils.isNotBlank(genus)
101 101
			 	|| StringUtils.isNotBlank(rank)
102 102
			 	|| StringUtils.isNotBlank(fullName)
......
107 107
		}
108 108

  
109 109
	}
110
	
111
	
112
// **************************** GETTER / SETTER *********************************/	
113
	
110

  
111

  
112
// **************************** GETTER / SETTER *********************************/
113

  
114 114
	public void setBasisOfRecord(String basisOfRecord) {
115 115
		this.basisOfRecord = basisOfRecord;
116 116
	}
......
174 174
	public void setBarcode(String barcode) {
175 175
		this.barcode = barcode;
176 176
	}
177
//	
177
//
178 178
//	/**
179 179
//	 * @return the author
180 180
//	 */
......
311 311
	}
312 312

  
313 313

  
314
	public void putIdInSource(int key, String id){
314
	@Override
315
    public void putIdInSource(int key, String id){
315 316
		IdentifiableSource source = getOrMakeSource(key, OriginalSourceType.Import);
316 317
		source.setIdInSource(id);
317 318
	}
318
	public void putSourceReference(int key, Reference<?> reference){
319
	@Override
320
    public void putSourceReference(int key, Reference reference){
319 321
		IdentifiableSource source = getOrMakeSource(key, OriginalSourceType.Unknown);
320 322
		source.setCitation(reference);
321 323
	}
322 324

  
323
	public List<IdentifiableSource> getSources() {
325
	@Override
326
    public List<IdentifiableSource> getSources() {
324 327
		return getOrdered(sources);
325 328
	}
326 329

  
......
347 350
			}
348 351
		}
349 352
	}
350
	
353

  
351 354
	public void putCollector(int key, String collector){
352 355
		this.collectors.put(key, collector);
353 356
	}
......
355 358
	public List<String> getCollectors() {
356 359
		return getOrdered(collectors);
357 360
	}
358
	
361

  
359 362
	public void putUnitNote(int key, String unitNote){
360 363
		this.unitNotes.put(key, unitNote);
361 364
	}
......
363 366
	public List<String> getUnitNotes() {
364 367
		return getOrdered(unitNotes);
365 368
	}
366
	
367
	
368
	
369

  
370

  
371

  
369 372
	/**
370 373
	 * @param key
371 374
	 * @return
......
378 381
		}
379 382
		return source;
380 383
	}
381
	
382 384

  
383
	public void putTypeCategory(int key, SpecimenTypeDesignationStatus status){
385

  
386
	@Override
387
    public void putTypeCategory(int key, SpecimenTypeDesignationStatus status){
384 388
		SpecimenTypeDesignation designation = getOrMakeTypeDesignation(key);
385 389
		designation.setTypeStatus(status);
386 390
	}
387
	public void putTypifiedName(int key, TaxonNameBase<?,?> name){
391
	@Override
392
    public void putTypifiedName(int key, TaxonNameBase<?,?> name){
388 393
		if (name != null){
389 394
			SpecimenTypeDesignation designation = getOrMakeTypeDesignation(key);
390 395
			name.addTypeDesignation(designation, false);
391 396
		}
392 397
	}
393 398

  
394
	public List<SpecimenTypeDesignation> getTypeDesignations() {
399
	@Override
400
    public List<SpecimenTypeDesignation> getTypeDesignations() {
395 401
		return getOrdered(types);
396 402
	}
397 403

  
......
404 410
		}
405 411
		return designation;
406 412
	}
407
	
413

  
408 414
	public void putDeterminationFamily(int key, String family){
409 415
		DeterminationLight determinationEvent = getOrMakeDetermination(key);
410 416
		determinationEvent.family = family;
......
414 420
		DeterminationLight determinationEvent = getOrMakeDetermination(key);
415 421
		determinationEvent.fullName = fullName;
416 422
	}
417
	
423

  
418 424
	public void putDeterminationTaxonUuid(int key, String taxonUuid){
419 425
		DeterminationLight determinationEvent = getOrMakeDetermination(key);
420 426
		determinationEvent.taxonUuid = taxonUuid;
......
429 435
		DeterminationLight determinationEvent = getOrMakeDetermination(key);
430 436
		determinationEvent.genus = genus;
431 437
	}
432
	
438

  
433 439
	public void putDeterminationSpeciesEpi(int key, String speciesEpi){
434 440
		DeterminationLight determinationEvent = getOrMakeDetermination(key);
435 441
		determinationEvent.speciesEpi = speciesEpi;
......
459 465
		DeterminationLight determinationEvent = getOrMakeDetermination(key);
460 466
		determinationEvent.notes = notes;
461 467
	}
462
	
468

  
463 469
	public void putDeterminationDeterminationModifier(int key, String modifier){
464 470
		DeterminationLight determinationEvent = getOrMakeDetermination(key);
465 471
		determinationEvent.modifier = modifier;
466 472
	}
467
	
468
	
473

  
474

  
469 475
	public List<DeterminationLight> getDetermination() {
470 476
		List<DeterminationLight> result = getOrdered(determinations);
471 477
		if (determinations.size() > 1 && getCommonDetermination()!= null ){
......
473 479
		}
474 480
		return result;
475 481
	}
476
	
482

  
477 483
	/**
478 484
	 * Returns the determination with key "0".
479 485
	 * @return
......
484 490
		}
485 491
		return null;
486 492
	}
487
	
488
	
489
	
493

  
494

  
495

  
490 496
	private DeterminationLight getOrMakeDetermination(int key) {
491 497
		DeterminationLight determination = this.determinations.get(key);
492 498
		if (determination == null){
......
495 501
		}
496 502
		return determination;
497 503
	}
498
	
504

  
499 505

  
500 506
	private<T extends Object> List<T> getOrdered(TreeMap<?, T> tree) {
501 507
		List<T> result = new ArrayList<T>();
......
504 510
		}
505 511
		return result;
506 512
	}
507
	
513

  
508 514
	public void setSex(String sex) {
509 515
		this.sex = sex;
510 516
	}
......
563 569
		area.postfix = levelPostfix;
564 570
		this.levels.add(area);
565 571
	}
566
	
572

  
567 573
	public List<PostfixTerm> getLeveledAreas(){
568 574
		return levels;
569 575
	}
570
	
576

  
571 577
	public void setAltitudeMax(String altitudeMax) {
572 578
		this.altitudeMax = altitudeMax;
573 579
	}
......
602 608
	public void setLanguage(String language) {
603 609
		this.language = language;
604 610
	}
605
	
611

  
606 612
}

Also available in: Unified diff