eu.etaxonomy.cdm.model.description
Class Distribution

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.description.DescriptionElementBase
                  extended by eu.etaxonomy.cdm.model.description.Distribution
All Implemented Interfaces:
IAnnotatableEntity, ICdmBase, IMultiLanguageTextHolder, ISourceable<DescriptionElementSource>, IVersionableEntity, IModifiable, Serializable, Cloneable

@Entity
@Indexed(index="eu.etaxonomy.cdm.model.description.DescriptionElementBase")
public class Distribution
extends DescriptionElementBase
implements Cloneable

This class represents elementary distribution data for a taxon. Only taxon descriptions may contain distributions. A distribution instance consist of a named area and of a status describing the absence or the presence of a taxon (like "extinct" or "introduced") in this named area.

This class corresponds partially to:

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

Field Summary
 
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 Distribution()
          Class constructor: creates a new empty distribution instance.
 
Method Summary
 Object clone()
          Clones this distribution.
 boolean equalsForTree(Distribution dist)
          Special equal method for building an sorted distribution tree
 NamedArea getArea()
          Returns the named area this distribution applies to.
 PresenceAbsenceTermBase<?> getStatus()
          Returns the presence or absence term for this distribution.
 boolean isDifferentSources(Distribution dist)
          Special function for building the sorted distribution tree.
static Distribution NewInstance()
          Creates an empty distribution instance.
static Distribution NewInstance(NamedArea area, PresenceAbsenceTermBase<?> status)
          Creates a distribution instance with the given named area and status.
 void setArea(NamedArea area)
           
 void setFeature(Feature feature)
          Deprecated. Deprecated because feature should always be DISTRIBUTION for all distribution instances and therefore it should not be changed.
 void setStatus(PresenceAbsenceTermBase<?> status)
           
 String toString()
          Implementation of the toString() function
 
Methods inherited from class eu.etaxonomy.cdm.model.description.DescriptionElementBase
addMedia, addModifier, addModifyingText, addModifyingText, addSource, addSource, addSource, clone, getFeature, getInDescription, getMedia, getModifiers, getModifiers, getModifyingText, getSources, makeModifierMap, putModifyingText, putModifyingText, removeMedia, removeModifier, removeModifyingText, removeSource, setInDescription
 
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.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

Distribution

protected Distribution()
Class constructor: creates a new empty distribution instance. The corresponding feature is set to DISTRIBUTION.

Method Detail

NewInstance

public static Distribution NewInstance()
Creates an empty distribution instance. The corresponding feature is set to DISTRIBUTION.

See Also:
NewInstance(NamedArea, PresenceAbsenceTermBase)

NewInstance

public static Distribution NewInstance(NamedArea area,
                                       PresenceAbsenceTermBase<?> status)
Creates a distribution instance with the given named area and status. The corresponding feature is set to DISTRIBUTION.

Parameters:
area - the named area for the new distribution
status - the presence or absence term for the new distribution
See Also:
NewInstance()

setFeature

@Deprecated
public void setFeature(Feature feature)
Deprecated. Deprecated because feature should always be DISTRIBUTION for all distribution instances and therefore it should not be changed.

Overrides:
setFeature in class DescriptionElementBase
See Also:
DescriptionElementBase.getFeature()

getArea

public NamedArea getArea()
Returns the named area this distribution applies to.


setArea

public void setArea(NamedArea area)
See Also:
getArea()

getStatus

public PresenceAbsenceTermBase<?> getStatus()
Returns the presence or absence term for this distribution.


setStatus

public void setStatus(PresenceAbsenceTermBase<?> status)
See Also:
getStatus()

equalsForTree

public boolean equalsForTree(Distribution dist)
Special equal method for building an sorted distribution tree

Parameters:
dist -
Returns:

isDifferentSources

public boolean isDifferentSources(Distribution dist)
Special function for building the sorted distribution tree. The function returns true if the sources of the two different objects are different

Parameters:
dist -
Returns:

clone

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

Overrides:
clone in class DescriptionElementBase
See Also:
DescriptionElementBase.clone(), Object.clone()

toString

public String toString()
Implementation of the toString() function

Overrides:
toString in class CdmBase
See Also:
Object.toString()


Copyright © 2007-2013 EDIT. All Rights Reserved.