Project

General

Profile

« Previous | Next » 

Revision f97ff6bc

Added by Andreas Müller over 12 years ago

change getSynonymsInGroup to synonymRelationship dependency (not sec dependency anymore).
See #2580

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/taxon/Taxon.java
1408 1408
		if (this.getHomotypicGroup() == null){
1409 1409
			return null;
1410 1410
		}else{
1411
			return this.getHomotypicGroup().getSynonymsInGroup(this.getSec());
1411
			return this.getSynonymsInGroup(this.getHomotypicGroup());
1412 1412
		}
1413 1413
	}
1414 1414
	
......
1524 1524
		//sort
1525 1525
		Map<Synonym, HomotypicalGroup> map = new HashMap<Synonym, HomotypicalGroup>();
1526 1526
		for (HomotypicalGroup homotypicalGroup: list){
1527
			List<Synonym> synonymList = homotypicalGroup.getSynonymsInGroup(getSec());
1527
			List<Synonym> synonymList = getSynonymsInGroup(homotypicalGroup);
1528 1528
			if (synonymList.size() > 0){
1529 1529
				map.put(synonymList.get(0), homotypicalGroup);
1530 1530
			}
......
1541 1541
		return result;
1542 1542
	}
1543 1543
	
1544
	/**
1545
	 * Retrieves the ordered list (depending on the date of publication) of
1546
	 * {@link taxon.Synonym synonyms} (according to a given reference)
1547
	 * the {@link TaxonNameBase taxon names} of which belong to the homotypical group.
1548
	 * If other names are part of the group that are not considered synonyms of 
1549
	 * <i>this</i> taxon, then they will not be included in
1550
	 * the result set.
1551
	 * 
1552
	 * @param homoGroup
1553
	 * @see			TaxonNameBase#getSynonyms()
1554
	 * @see			TaxonNameBase#getTaxa()
1555
	 * @see			taxon.Synonym
1556
	 */
1557
	@Transient
1558
	public List<Synonym> getSynonymsInGroup(HomotypicalGroup homoGroup){
1559
		List<Synonym> result = new ArrayList<Synonym>();
1560
		
1561
		for (TaxonNameBase<?, ?>name : homoGroup.getTypifiedNames()){
1562
			for (Synonym synonym : name.getSynonyms()){
1563
				for(SynonymRelationship synRel : synonym.getSynonymRelations()){
1564
					if (synRel.getAcceptedTaxon().equals(this)){
1565
						result.add(synRel.getSynonym());
1566
					}
1567
				}
1568
			}
1569
		}
1570
		Collections.sort(result, new TaxonComparator());
1571
		return result;
1572
	}
1573

  
1574
	
1544 1575
	/**
1545 1576
	 * Returns the image gallery description. If no image gallery exists, a new one is created using the 
1546 1577
	 * defined title and adds the string "-Image Gallery" to the title.</BR>

Also available in: Unified diff