Project

General

Profile

« Previous | Next » 

Revision 00e1ad00

Added by Katja Luther about 11 years ago

some changes for object deletion, especially the implementation of the childhandling.

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/TaxonNameBase.java
647 647
        }
648 648
        return false;
649 649
    }
650
    
651
    /**
652
     * Indicates <i>this</i> taxon name is a {@link NameRelationshipType#REPLACED_SYNONYM() replaced synonym}
653
     * of any other taxon name. Returns "true", if a replaced
654
     * synonym {@link NameRelationship relationship} from <i>this</i> taxon name to another taxon name exists,
655
     * false otherwise (also in case <i>this</i> taxon name is the only one in the
656
     * homotypical group).
657
     */
658
    @Transient
659
    public boolean isReplacedSynonym(){
660
        Set<NameRelationship> relationsFromThisName = this.getRelationsFromThisName();
661
        for (NameRelationship relation : relationsFromThisName) {
662
            if (relation.getType().isReplacedSynonymRelation()) {
663
                return true;
664
            }
665
        }
666
        return false;
667
    }
650 668

  
651 669
    /**
652 670
     * Returns the taxon name which is the {@link NameRelationshipType#BASIONYM() basionym} of <i>this</i> taxon name.
......
724 742
            return null;
725 743
        }
726 744
    }
745
    
746
    /**
747
     * Returns the set of taxon names which are the {@link NameRelationshipType#REPLACED_SYNONYM() replaced synonyms} of <i>this</i> taxon name.
748
     *  
749
     */
750
    @Transient
751
    public Set<TaxonNameBase> getReplacedSynonyms(){
752
        Set<TaxonNameBase> result = new HashSet<TaxonNameBase>();
753
        Set<NameRelationship> rels = this.getRelationsToThisName();
754
        for (NameRelationship rel : rels){
755
            if (rel.getType().isReplacedSynonymRelation()){
756
                TaxonNameBase replacedSynonym = rel.getFromName();
757
                result.add(replacedSynonym);
758
            }
759
        }
760
        return result;
761
    }
727 762

  
728 763
    /**
729 764
     * Assigns a taxon name as {@link NameRelationshipType#REPLACED_SYNONYM() replaced synonym} of <i>this</i> taxon name

Also available in: Unified diff