eu.etaxonomy.cdm.model.taxon
Class Synonym

java.lang.Object
  extended by eu.etaxonomy.cdm.model.common.CdmBase
      extended by eu.etaxonomy.cdm.model.common.VersionableEntity
          extended by eu.etaxonomy.cdm.model.common.AnnotatableEntity
              extended by eu.etaxonomy.cdm.model.common.IdentifiableEntity<S>
                  extended by eu.etaxonomy.cdm.model.taxon.TaxonBase<IIdentifiableEntityCacheStrategy<Synonym>>
                      extended by eu.etaxonomy.cdm.model.taxon.Synonym
All Implemented Interfaces:
IAnnotatableEntity, ICdmBase, IIdentifiableEntity, IRelated<SynonymRelationship>, ISourceable<IdentifiableSource>, IVersionableEntity, Serializable, Cloneable

@Entity
@Indexed(index="eu.etaxonomy.cdm.model.taxon.TaxonBase")
@Configurable
public class Synonym
extends TaxonBase<IIdentifiableEntityCacheStrategy<Synonym>>
implements IRelated<SynonymRelationship>

The class for synonyms: these are taxa the taxon names of which are not used by the reference to designate a real taxon but are mentioned as taxon names that were oder are used by some other unspecified references to designate (at least to some extent) the same particular real taxon. Synonyms that are involved in no synonym relationship are actually meaningless.
Splitting taxa in "accepted/correct" and "synonyms" makes it easier to handle particular relationships between ("accepted/correct") taxa on the one hand and between ("synonym") taxa and ("accepted/correct") taxa on the other.

Version:
1.0
Author:
m.doering
See Also:
Serialized Form

Field Summary
 
Fields inherited from class eu.etaxonomy.cdm.model.common.IdentifiableEntity
cacheStrategy, NOT_PROTECTED, PROTECTED, protectedTitleCache, titleCache
 
Fields inherited from class eu.etaxonomy.cdm.model.common.AnnotatableEntity
annotations, markers
 
Fields inherited from class eu.etaxonomy.cdm.model.common.CdmBase
uuid
 
Constructor Summary
Synonym()
          Class constructor: creates a new empty synonym instance.
Synonym(TaxonNameBase taxonNameBase, Reference sec)
          Class constructor: creates a new synonym instance with the taxon name used and the reference using it as a synonym and not as an ("accepted/correct") taxon.
 
Method Summary
 void addRelationship(SynonymRelationship rel)
          Adds an existing synonym relationship to the set of synonym relationships assigned to this synonym.
protected  void addSynonymRelation(SynonymRelationship synonymRelation)
          Adds an existing synonym relationship to the set of synonym relationships assigned to this synonym.
 Object clone()
          Clones this taxon.
 Set<Taxon> getAcceptedTaxa()
          Returns the set of all ("accepted/correct") taxa involved in the same synonym relationships as this synonym.
 Set<SynonymRelationshipType> getRelationType(Taxon taxon)
          Returns the set of synonym relationship types of the synonym relationships where the synonym is this synonym and the taxon is the given one.
 Set<SynonymRelationship> getSynonymRelations()
          Returns the set of all synonym relationships in which this synonym is involved.
 boolean isOrphaned()
           
 boolean isSynonymOf(Taxon taxon)
          Returns true if this is a synonym of the given taxon.
static Synonym NewInstance(TaxonNameBase taxonName, Reference sec)
          Creates a new synonym instance with the taxon name used and the reference using it as a synonym and not as an ("accepted/correct") taxon.
 void removeSynonymRelation(SynonymRelationship synonymRelation)
          Removes one element from the set of synonym relationships assigned to this synonym.
 void replaceAcceptedTaxon(Taxon newAcceptedTaxon, SynonymRelationshipType relType, boolean copyCitationInfo, Reference citation, String microCitation)
          Replaces ALL accepted taxa of this synonym by the new accepted taxon.
protected  void setSynonymRelations(Set<SynonymRelationship> synonymRelations)
           
 
Methods inherited from class eu.etaxonomy.cdm.model.taxon.TaxonBase
getAppendedPhrase, getHomotypicGroup, getName, getSec, isDoubtful, isUseNameCache, setAppendedPhrase, setDoubtful, setName, setSec, setUseNameCache
 
Methods inherited from class eu.etaxonomy.cdm.model.common.IdentifiableEntity
addCredit, addCredit, addExtension, addExtension, addRights, addSource, addSource, compareTo, generateTitle, getCacheStrategy, getCredits, getCredits, getData, getExtensions, getExtensions, getExtensions, getLsid, getRights, getSources, getTitleCache, getTruncatedCache, initListener, isProtectedTitleCache, regenerateTitleCache, removeCredit, removeCredit, removeExtension, removeRights, removeSource, setCacheStrategy, setLsid, setProtectedTitleCache, setTitleCache, setTitleCache, toString
 
Methods inherited from class eu.etaxonomy.cdm.model.common.AnnotatableEntity
addAnnotation, addMarker, getAnnotations, getMarkers, hasMarker, hasMarker, removeAnnotation, removeMarker
 
Methods inherited from class eu.etaxonomy.cdm.model.common.VersionableEntity
equals, getUpdated, getUpdatedBy, setUpdated, setUpdatedBy
 
Methods inherited from class eu.etaxonomy.cdm.model.common.CdmBase
addPropertyChangeListener, addPropertyChangeListener, clone, deproxy, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getCreated, getCreatedBy, getId, getUuid, hashCode, hasListeners, instanceToString, invokeSetMethod, invokeSetMethodWithNull, isInstanceOf, removePropertyChangeListener, removePropertyChangeListener, setCreated, setCreatedBy, setId, setUuid
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface eu.etaxonomy.cdm.model.common.IRelated
getUuid
 
Methods inherited from interface eu.etaxonomy.cdm.model.common.IAnnotatableEntity
addAnnotation, addMarker, getAnnotations, getMarkers, hasMarker, hasMarker, removeAnnotation, removeMarker
 
Methods inherited from interface eu.etaxonomy.cdm.model.common.IVersionableEntity
getUpdated, getUpdatedBy, setUpdated, setUpdatedBy
 
Methods inherited from interface eu.etaxonomy.cdm.model.common.ICdmBase
getCreated, getCreatedBy, getId, getUuid, setCreated, setCreatedBy, setId, setUuid
 

Constructor Detail

Synonym

public Synonym()
Class constructor: creates a new empty synonym instance.

See Also:
Synonym(TaxonNameBase, Reference)

Synonym

public Synonym(TaxonNameBase taxonNameBase,
               Reference sec)
Class constructor: creates a new synonym instance with the taxon name used and the reference using it as a synonym and not as an ("accepted/correct") taxon.

Parameters:
taxonNameBase - the taxon name used
sec - the reference using the taxon name
See Also:
Synonym(TaxonNameBase, Reference)
Method Detail

NewInstance

public static Synonym NewInstance(TaxonNameBase taxonName,
                                  Reference sec)
Creates a new synonym instance with the taxon name used and the reference using it as a synonym and not as an ("accepted/correct") taxon.

Parameters:
taxonNameBase - the taxon name used
sec - the reference using the taxon name
See Also:
Synonym(TaxonNameBase, Reference)

getSynonymRelations

public Set<SynonymRelationship> getSynonymRelations()
Returns the set of all synonym relationships in which this synonym is involved. This synonym can only be the source within these synonym relationships.

See Also:
addSynonymRelation(SynonymRelationship), addRelationship(SynonymRelationship), removeSynonymRelation(SynonymRelationship)

setSynonymRelations

protected void setSynonymRelations(Set<SynonymRelationship> synonymRelations)
See Also:
getSynonymRelations()

addSynonymRelation

protected void addSynonymRelation(SynonymRelationship synonymRelation)
Adds an existing synonym relationship to the set of synonym relationships assigned to this synonym. If the source of the synonym relationship does not match with this synonym no addition will be carried out.
This methods does the same as the addRelationship method.

Parameters:
synonymRelation - the synonym relationship to be added to this synonym's synonym relationships set
See Also:
addRelationship(SynonymRelationship), getSynonymRelations(), removeSynonymRelation(SynonymRelationship)

removeSynonymRelation

public void removeSynonymRelation(SynonymRelationship synonymRelation)
Removes one element from the set of synonym relationships assigned to this synonym. Due to bidirectionality the given synonym relationship will also be removed from the set of synonym relationships assigned to the taxon involved in the relationship. Furthermore the content of the accepted taxon attribute and of the synonym attribute within the synonym relationship itself will be set to "null".

Parameters:
synonymRelation - the synonym relationship which should be deleted
See Also:
getSynonymRelations(), addRelationship(SynonymRelationship)

addRelationship

public void addRelationship(SynonymRelationship rel)
Adds an existing synonym relationship to the set of synonym relationships assigned to this synonym. If the source of the synonym relationship does not match with this synonym no addition will be carried out.
This methods does the same as the addSynonymRelation method.

Specified by:
addRelationship in interface IRelated<SynonymRelationship>
Parameters:
synonymRelation - the synonym relationship to be added to this synonym's synonym relationships set
See Also:
addSynonymRelation(SynonymRelationship), getSynonymRelations(), removeSynonymRelation(SynonymRelationship)

getAcceptedTaxa

public Set<Taxon> getAcceptedTaxa()
Returns the set of all ("accepted/correct") taxa involved in the same synonym relationships as this synonym. Each taxon is the target and this synonym is the source of a synonym relationship belonging to the set of synonym relationships assigned to this synonym. For a particular synonym there are more than one ("accepted/correct") taxon only if the "is pro parte" flag of the corresponding synonym relationships is set.

See Also:
getSynonymRelations(), getRelationType(Taxon), SynonymRelationship.isProParte()

isSynonymOf

public boolean isSynonymOf(Taxon taxon)
Returns true if this is a synonym of the given taxon.

Parameters:
taxon - the taxon to check synonym for
Returns:
true if this is a ynonms of the given taxon
See Also:
getAcceptedTaxa()

isOrphaned

public boolean isOrphaned()
Specified by:
isOrphaned in class TaxonBase<IIdentifiableEntityCacheStrategy<Synonym>>

getRelationType

public Set<SynonymRelationshipType> getRelationType(Taxon taxon)
Returns the set of synonym relationship types of the synonym relationships where the synonym is this synonym and the taxon is the given one. "Null" is returned if the given taxon is "null" or if no synonym relationship exists from this synonym to the given taxon.

Parameters:
taxon - the ("accepted/correct") taxon which a synonym relationship from this synonym should point to
See Also:
getSynonymRelations(), getAcceptedTaxa()

replaceAcceptedTaxon

public void replaceAcceptedTaxon(Taxon newAcceptedTaxon,
                                 SynonymRelationshipType relType,
                                 boolean copyCitationInfo,
                                 Reference citation,
                                 String microCitation)
Replaces ALL accepted taxa of this synonym by the new accepted taxon. The citation information (citation /microcitation) of the synonym relationship is kept.

Parameters:
newAcceptedTaxon - the new accepted taxon
relType - if not null the relationship type is changed to relType
copyCitationInfo - if true the citation and the microcitation of relationship is not changed.
citation - if copyCitationInfo is false this citation is set to the synonym relationship.
microCitation - if copyCitationInfo is false this micro citation is set to the synonym relationship.
acceptedTaxon -

clone

public Object clone()
Description copied from class: TaxonBase
Clones this taxon. This is a shortcut that enables to create a new instance with empty taxon name and sec reference.

Overrides:
clone in class TaxonBase<IIdentifiableEntityCacheStrategy<Synonym>>
See Also:
eu.etaxonomy.cdm.model.media.IdentifiableEntity#clone(), Object.clone()


Copyright © 2007-2013 EDIT. All Rights Reserved.