Search in sources :

Example 6 with HomotypicGroupTaxonComparator

use of eu.etaxonomy.cdm.compare.taxon.HomotypicGroupTaxonComparator in project cdmlib by cybertaxonomy.

the class TaxonServiceImpl method getSynonymsByHomotypicGroup.

@Override
public List<List<Synonym>> getSynonymsByHomotypicGroup(Taxon taxon, List<String> propertyPaths) {
    List<List<Synonym>> result = new ArrayList<>();
    taxon = (Taxon) dao.load(taxon.getUuid(), propertyPaths);
    HomotypicGroupTaxonComparator comparator = new HomotypicGroupTaxonComparator(taxon);
    // homotypic
    result.add(taxon.getHomotypicSynonymsByHomotypicGroup(comparator));
    // heterotypic
    // currently the list is sorted by the Taxon.defaultTaxonComparator
    List<HomotypicalGroup> homotypicalGroups = taxon.getHeterotypicSynonymyGroups();
    for (HomotypicalGroup homotypicalGroup : homotypicalGroups) {
        result.add(taxon.getSynonymsInGroup(homotypicalGroup, comparator));
    }
    return result;
}
Also used : HomotypicalGroup(eu.etaxonomy.cdm.model.name.HomotypicalGroup) HomotypicGroupTaxonComparator(eu.etaxonomy.cdm.compare.taxon.HomotypicGroupTaxonComparator) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List)

Aggregations

HomotypicGroupTaxonComparator (eu.etaxonomy.cdm.compare.taxon.HomotypicGroupTaxonComparator)6 ArrayList (java.util.ArrayList)5 HomotypicalGroup (eu.etaxonomy.cdm.model.name.HomotypicalGroup)3 TaxonName (eu.etaxonomy.cdm.model.name.TaxonName)3 Synonym (eu.etaxonomy.cdm.model.taxon.Synonym)3 NameTypeDesignation (eu.etaxonomy.cdm.model.name.NameTypeDesignation)2 TypeDesignationBase (eu.etaxonomy.cdm.model.name.TypeDesignationBase)2 Taxon (eu.etaxonomy.cdm.model.taxon.Taxon)2 TaxonNode (eu.etaxonomy.cdm.model.taxon.TaxonNode)2 List (java.util.List)2 TypeDesignationSetManager (eu.etaxonomy.cdm.api.service.name.TypeDesignationSetManager)1 DefaultPagerImpl (eu.etaxonomy.cdm.api.service.pager.impl.DefaultPagerImpl)1 HomotypicalGroupComparator (eu.etaxonomy.cdm.compare.name.HomotypicalGroupComparator)1 TaxonComparator (eu.etaxonomy.cdm.compare.taxon.TaxonComparator)1 CdmBase (eu.etaxonomy.cdm.model.common.CdmBase)1 IdentifiableSource (eu.etaxonomy.cdm.model.common.IdentifiableSource)1 LanguageString (eu.etaxonomy.cdm.model.common.LanguageString)1 CommonTaxonName (eu.etaxonomy.cdm.model.description.CommonTaxonName)1 IBotanicalName (eu.etaxonomy.cdm.model.name.IBotanicalName)1 INonViralName (eu.etaxonomy.cdm.model.name.INonViralName)1