eu.etaxonomy.cdm.model.taxon
Class TaxonRelationship

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.ReferencedEntityBase
                  extended by eu.etaxonomy.cdm.model.common.RelationshipBase<Taxon,Taxon,TaxonRelationshipType>
                      extended by eu.etaxonomy.cdm.model.taxon.TaxonRelationship
All Implemented Interfaces:
IAnnotatableEntity, ICdmBase, IReferencedEntity, IVersionableEntity, Serializable, Cloneable

@ChildTaxaMustBeLowerRankThanParent(groups=Level3.class)
@ChildTaxaMustNotSkipRanks(groups=Level3.class)
@ChildTaxaMustDeriveNameFromParent(groups=Level3.class)
public class TaxonRelationship
extends RelationshipBase<Taxon,Taxon,TaxonRelationshipType>

The class representing a relationship between two ("accepted/correct") taxa. This includes a taxon relationship type (for instance "congruent to" or "misapplied name for").

This class corresponds in part to:

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

Nested Class Summary
 
Nested classes/interfaces inherited from class eu.etaxonomy.cdm.model.common.RelationshipBase
RelationshipBase.Direction
 
Field Summary
 
Fields inherited from class eu.etaxonomy.cdm.model.common.RelationshipBase
deletedObjects
 
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
protected TaxonRelationship(Taxon from, Taxon to, TaxonRelationshipType type, Reference citation, String citationMicroReference)
          Class constructor: creates a new taxon relationship instance (with the given "accepted/correct" taxa, the given synonym relationship type and with the reference source on which the relationship assertion is based).
 
Method Summary
 Object clone()
          Clones this TaxonRelationship.
 Taxon getFromTaxon()
          Returns the taxon involved as a source in this taxon relationship.
protected  Taxon getRelatedFrom()
           
protected  Taxon getRelatedTo()
           
 Taxon getToTaxon()
          Returns the taxon involved as a target in this taxon relationship.
 TaxonRelationshipType getType()
           
 void setFromTaxon(Taxon fromTaxon)
          Sets the given taxon as a source in this taxon relationship.
protected  void setRelatedFrom(Taxon relatedFrom)
           
protected  void setRelatedTo(Taxon relatedTo)
           
 void setToTaxon(Taxon toTaxon)
          Sets the given taxon as a target in this taxon relationship.
 void setType(TaxonRelationshipType type)
           
 
Methods inherited from class eu.etaxonomy.cdm.model.common.RelationshipBase
getDeletedObjects, isDoubtful, isRemoved, setDoubtful
 
Methods inherited from class eu.etaxonomy.cdm.model.common.ReferencedEntityBase
getCitation, getCitationMicroReference, getOriginalNameString, setCitation, setCitationMicroReference, setOriginalNameString
 
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, invokeSetMethod, invokeSetMethodWithNull, isInstanceOf, removePropertyChangeListener, removePropertyChangeListener, setCreated, setCreatedBy, setId, setUuid, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
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

TaxonRelationship

protected TaxonRelationship(Taxon from,
                            Taxon to,
                            TaxonRelationshipType type,
                            Reference citation,
                            String citationMicroReference)
Class constructor: creates a new taxon relationship instance (with the given "accepted/correct" taxa, the given synonym relationship type and with the reference source on which the relationship assertion is based). Moreover the new taxon relationship will be added to the respective sets of taxon relationships assigned to both taxa.

Parameters:
from - the taxon instance to be involved as a source in the new taxon relationship
to - the taxon instance to be involved as a target in the new taxon relationship
type - the taxon relationship type of the new taxon relationship
citation - the reference source for the new taxon relationship
citationMicroReference - the string with the details describing the exact localisation within the reference
See Also:
RelationshipBase
Method Detail

getFromTaxon

public Taxon getFromTaxon()
Returns the taxon involved as a source in this taxon relationship.

See Also:
getToTaxon(), Taxon.getRelationsFromThisTaxon(), RelationshipBase.getRelatedFrom(), RelationshipBase.getType()

setFromTaxon

public void setFromTaxon(Taxon fromTaxon)
Sets the given taxon as a source in this taxon relationship. Therefore this taxon relationship will be added to the corresponding set of taxon relationships assigned to the given taxon. Furthermore if the given taxon replaces an "old" one this taxon relationship will be removed from the set of taxon relationships assigned to the "old" source taxon.

Parameters:
fromTaxon - the taxon instance to be set as a source in this synonym relationship
See Also:
getFromTaxon()

getToTaxon

public Taxon getToTaxon()
Returns the taxon involved as a target in this taxon relationship.

See Also:
getFromTaxon(), Taxon.getRelationsToThisTaxon(), RelationshipBase.getRelatedTo(), RelationshipBase.getType()

setToTaxon

public void setToTaxon(Taxon toTaxon)
Sets the given taxon as a target in this taxon relationship. Therefore this taxon relationship will be added to the corresponding set of taxon relationships assigned to the given taxon. Furthermore if the given taxon replaces an "old" one this taxon relationship will be removed from the set of taxon relationships assigned to the "old" target taxon.

Parameters:
toTaxon - the taxon instance to be set as a target in this synonym relationship
See Also:
getToTaxon()

getRelatedFrom

protected Taxon getRelatedFrom()
Specified by:
getRelatedFrom in class RelationshipBase<Taxon,Taxon,TaxonRelationshipType>

getRelatedTo

protected Taxon getRelatedTo()
Specified by:
getRelatedTo in class RelationshipBase<Taxon,Taxon,TaxonRelationshipType>

getType

public TaxonRelationshipType getType()
Specified by:
getType in class RelationshipBase<Taxon,Taxon,TaxonRelationshipType>

setRelatedFrom

protected void setRelatedFrom(Taxon relatedFrom)
Specified by:
setRelatedFrom in class RelationshipBase<Taxon,Taxon,TaxonRelationshipType>

setRelatedTo

protected void setRelatedTo(Taxon relatedTo)
Specified by:
setRelatedTo in class RelationshipBase<Taxon,Taxon,TaxonRelationshipType>

setType

public void setType(TaxonRelationshipType type)
Specified by:
setType in class RelationshipBase<Taxon,Taxon,TaxonRelationshipType>

clone

public Object clone()
Clones this TaxonRelationship. This is a shortcut that enables to create a new instance that differs only slightly from this TaxonRelationship by modifying only some of the attributes.

Overrides:
clone in class RelationshipBase<Taxon,Taxon,TaxonRelationshipType>
See Also:
RelationshipBase.clone(), Object.clone()


Copyright © 2007-2012 EDIT. All Rights Reserved.