@Transient
//TODO should return a Set<SynonymRelationshipType> since there might be more than one relation
// between the synonym and the taxon: see Taxon#removeSynonym(Synonym)
- public SynonymRelationshipType getRelationType(Taxon taxon){
+ public Set<SynonymRelationshipType> getRelationType(Taxon taxon){
+ Set<SynonymRelationshipType> result = new HashSet<SynonymRelationshipType>();
if (taxon == null ){
- return null;
+ return result;
}
- for (SynonymRelationship rel:getSynonymRelations()){
+ for (SynonymRelationship rel : getSynonymRelations()){
Taxon acceptedTaxon = rel.getAcceptedTaxon();
if (taxon.equals(acceptedTaxon)){
- return rel.getType();
+ result.add(rel.getType());
}
}
- return null;
+ return result;
}
}
\ No newline at end of file
* type to be created
* @param labelAbbrev the string identifying (in abbreviated form) the
* new synonym relationship type to be created
- * @param symmetric the boolean indicating whether the new synonym
- * relationship type to be created is symmetric
- * @param transitive the boolean indicating whether the new synonym
- * relationship type to be created is transitive
* @see #SynonymRelationshipType()
*/
- //TODO synonym relationship types can be neither symmetric nor transitive!!
- public SynonymRelationshipType(String term, String label, String labelAbbrev, boolean symmetric, boolean transitive) {
- super(term, label, labelAbbrev, symmetric, transitive);
+ public SynonymRelationshipType(String term, String label, String labelAbbrev) {
+ super(term, label, labelAbbrev, false, false);
}
//********* METHODS **************************************/