eu.etaxonomy.cdm.model.description
Class PolytomousKey

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<PolytomousKeyDefaultCacheStrategy>
                  extended by eu.etaxonomy.cdm.model.description.PolytomousKey
All Implemented Interfaces:
IAnnotatableEntity, ICdmBase, IIdentifiableEntity, ISourceable<IdentifiableSource>, IVersionableEntity, IIdentificationKey, Serializable, Cloneable

@Entity
@Indexed(index="eu.etaxonomy.cdm.model.media.FeatureTree")
public class PolytomousKey
extends IdentifiableEntity<PolytomousKeyDefaultCacheStrategy>
implements IIdentificationKey

This class represents a fixed single-access key (dichotomous or polytomous) used to identify (assign a taxon to) a specimen or observation. The key may be written manually or may be generated automatically e.g. by the PolytomousKeyGenerator. The different paths to the taxa are expressed by a decision graph consisting of PolytomousKeyNodes. The root node of such graph is accessible by getRoot(). Refer to PolytomousKeyNode for detailed documentation on the decision graph structure.

Version:
2.0 (08.11.2010)
Author:
h.fradin, a.mueller
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
protected PolytomousKey()
          Class constructor: creates a new empty multi-access key instance.
 
Method Summary
 void addCoveredTaxon(Taxon taxon)
          Adds a taxa to the set of covered taxa corresponding to this identification key.
 void addGeographicalScope(NamedArea geoScope)
          Adds a geoScope to the set of geogspatial scopes corresponding to this identification key.
 void addScopeRestriction(Scope scopeRestriction)
          Adds a scope restriction to the set of scope restrictions corresponding to this identification key.
 void addTaxonomicScope(Taxon taxon)
          Adds a taxa to the set of taxonomic scopes corresponding to this identification key.
 Object clone()
          Clones this PolytomousKey.
 Set<Taxon> getCoveredTaxa()
          Returns the set of possible taxa corresponding to this identification key.
 Set<NamedArea> getGeographicalScope()
          Returns the set of named areas indicating the geospatial data where this identification key is valid.
 PolytomousKeyNode getRoot()
          Returns the topmost polytomous key node (root node) of this polytomous key.
 Set<Scope> getScopeRestrictions()
          Returns the set of scope restrictions corresponding to this identification key
 Set<Taxon> getTaxonomicScope()
          Returns the set of taxa that define the taxonomic scope of this identification key
static PolytomousKey NewInstance()
          Creates a new empty identification multi-access key instance.
static PolytomousKey NewTitledInstance(String title)
          Creates a new empty identification polytomous key instance.
 String print(PrintStream stream)
           
 void removeCoveredTaxon(Taxon taxon)
          Removes one element from the set of covered taxa corresponding to this identification key.
 void removeGeographicalScope(NamedArea geoScope)
          Removes one element from the set of geogspatial scopes corresponding to this identification key.
 void removeScopeRestriction(Scope scopeRestriction)
          Removes one element from the set of scope restrictions corresponding to this identification key.
 void removeTaxonomicScope(Taxon taxon)
          Removes one element from the set of taxonomic scopes corresponding to this identification key.
protected  void setCoveredTaxa(Set<Taxon> coveredTaxa)
           
 void setRoot(PolytomousKeyNode root)
          This method should be used by Hibernate only.
 
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.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

PolytomousKey

protected PolytomousKey()
Class constructor: creates a new empty multi-access key instance.

Method Detail

NewInstance

public static PolytomousKey NewInstance()
Creates a new empty identification multi-access key instance.


NewTitledInstance

public static PolytomousKey NewTitledInstance(String title)
Creates a new empty identification polytomous key instance.


getRoot

public PolytomousKeyNode getRoot()
Returns the topmost polytomous key node (root node) of this polytomous key. The root node does not have any parent. Since polytomous key nodes recursively point to their child nodes the complete polytomous key is defined by its root node.


setRoot

public void setRoot(PolytomousKeyNode root)
This method should be used by Hibernate only. If we want to make this method public we have to think about biderionality and also what should happen with the old root node.

See Also:
getRoot()

getCoveredTaxa

public Set<Taxon> getCoveredTaxa()
Returns the set of possible taxa corresponding to this identification key.

Specified by:
getCoveredTaxa in interface IIdentificationKey
Returns:
set of taxa

setCoveredTaxa

protected void setCoveredTaxa(Set<Taxon> coveredTaxa)
See Also:
getCoveredTaxa()

addCoveredTaxon

public void addCoveredTaxon(Taxon taxon)
Adds a taxa to the set of covered taxa corresponding to this identification key.

Specified by:
addCoveredTaxon in interface IIdentificationKey
Parameters:
taxon - the taxon to be added to this identification key
See Also:
getCoveredTaxa()

removeCoveredTaxon

public void removeCoveredTaxon(Taxon taxon)
Removes one element from the set of covered taxa corresponding to this identification key.

Specified by:
removeCoveredTaxon in interface IIdentificationKey
Parameters:
taxon - the taxon which should be removed
See Also:
getCoveredTaxa(), addCoveredTaxon(Taxon)

getGeographicalScope

public Set<NamedArea> getGeographicalScope()
Returns the set of named areas indicating the geospatial data where this identification key is valid.

Specified by:
getGeographicalScope in interface IIdentificationKey
Returns:

addGeographicalScope

public void addGeographicalScope(NamedArea geoScope)
Adds a geoScope to the set of geogspatial scopes corresponding to this identification key.

Specified by:
addGeographicalScope in interface IIdentificationKey
Parameters:
geoScope - the named area to be added to this identification key
See Also:
#getGeoScopes()

removeGeographicalScope

public void removeGeographicalScope(NamedArea geoScope)
Removes one element from the set of geogspatial scopes corresponding to this identification key.

Specified by:
removeGeographicalScope in interface IIdentificationKey
Parameters:
geoScope - the named area which should be removed
See Also:
#getGeoScopes(), #addGeoScope(NamedArea)

getTaxonomicScope

public Set<Taxon> getTaxonomicScope()
Returns the set of taxa that define the taxonomic scope of this identification key

Specified by:
getTaxonomicScope in interface IIdentificationKey
Returns:
set of taxa

addTaxonomicScope

public void addTaxonomicScope(Taxon taxon)
Adds a taxa to the set of taxonomic scopes corresponding to this identification key.

Specified by:
addTaxonomicScope in interface IIdentificationKey
Parameters:
taxon - the taxon to be added to this identification key
See Also:
getTaxonomicScope()

removeTaxonomicScope

public void removeTaxonomicScope(Taxon taxon)
Removes one element from the set of taxonomic scopes corresponding to this identification key.

Specified by:
removeTaxonomicScope in interface IIdentificationKey
Parameters:
taxon - the taxon which should be removed
See Also:
getTaxonomicScope(), addTaxonomicScope(Taxon)

getScopeRestrictions

public Set<Scope> getScopeRestrictions()
Returns the set of scope restrictions corresponding to this identification key

Specified by:
getScopeRestrictions in interface IIdentificationKey

addScopeRestriction

public void addScopeRestriction(Scope scopeRestriction)
Adds a scope restriction to the set of scope restrictions corresponding to this identification key.

Specified by:
addScopeRestriction in interface IIdentificationKey
Parameters:
scopeRestriction - the scope restriction to be added to this identification key
See Also:
getScopeRestrictions()

removeScopeRestriction

public void removeScopeRestriction(Scope scopeRestriction)
Removes one element from the set of scope restrictions corresponding to this identification key.

Specified by:
removeScopeRestriction in interface IIdentificationKey
Parameters:
scopeRestriction - the scope restriction which should be removed
See Also:
getScopeRestrictions(), addScopeRestriction(Scope)

print

public String print(PrintStream stream)

clone

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

Overrides:
clone in class IdentifiableEntity<PolytomousKeyDefaultCacheStrategy>
See Also:
IdentifiableEntity.clone(), Object.clone()


Copyright © 2007-2013 EDIT. All Rights Reserved.