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;
}
Aggregations