eu.etaxonomy.cdm.model.description
Class DescriptionElementBase

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
All Implemented Interfaces:
IAnnotatableEntity, ICdmBase, IMultiLanguageTextHolder, ISourceable<DescriptionElementSource>, IVersionableEntity, IModifiable, Serializable, Cloneable
Direct Known Subclasses:
CategoricalData, CommonTaxonName, Distribution, IndividualsAssociation, QuantitativeData, TaxonInteraction, TextData

@Entity
public abstract class DescriptionElementBase
extends AnnotatableEntity
implements ISourceable<DescriptionElementSource>, IModifiable, IMultiLanguageTextHolder

The upmost (abstract) class for a piece of information) about a specimen, a taxon or even a taxon name. A concrete description element assigns descriptive data to one feature.
Experts use the word feature for the property itself but not for the actual description element. Therefore naming this class FeatureBase would have leaded to confusion.

This class corresponds 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 DescriptionElementBase()
          Class constructor: creates a new empty description element instance.
protected DescriptionElementBase(Feature feature)
          Class constructor: creates a new description element instance with the given feature that is described or measured.
 
Method Summary
 void addMedia(Media media)
          Adds a media to the list of media this description element is based on.
 void addModifier(Modifier modifier)
          Adds a modifier to the set of modifiers used to qualify the validity of this description element.
 LanguageString addModifyingText(LanguageString description)
          Deprecated. should follow the put semantic of maps, this method will be removed in v4.0 Use the putModifyingText method
 LanguageString addModifyingText(String text, Language language)
          Deprecated. should follow the put semantic of maps, this method will be removed in v4.0 Use the putModifyingText method
 void addSource(DescriptionElementSource source)
          Adds a source to this object
 DescriptionElementSource addSource(String id, String idNamespace, Reference citation, String microCitation)
          Adds a source that is newly created by its components.
 void addSource(String id, String idNamespace, Reference citation, String microReference, TaxonNameBase nameUsedInSource, String originalNameString)
           
 Object clone()
          Clones the description element.
 DescriptionElementBase clone(DescriptionBase description)
          Clones the description element.
The new element is added to the description.
 Feature getFeature()
          Returns the feature this description element is for.
 DescriptionBase getInDescription()
          Returns the description that this DescriptionElement is part of.
 List<Media> getMedia()
          Returns the list of media (that is pictures, movies, recorded sounds ...) this description element is based on.
 Set<Modifier> getModifiers()
          Returns the set of modifiers used to qualify the validity of this description element.
 List<Modifier> getModifiers(TermVocabulary voc)
           
 Map<Language,LanguageString> getModifyingText()
          Returns the multilanguage text used to qualify the validity of this description element.
 Set<DescriptionElementSource> getSources()
          Returns the set of original sources (citations) for this sourceable object
protected  Map<TermVocabulary,List<Modifier>> makeModifierMap()
           
 LanguageString putModifyingText(LanguageString description)
          Adds a translated text in a particular language to the multilanguage text used to qualify the validity of this description element.
 LanguageString putModifyingText(Language language, String text)
          Creates a language string based on the given text string and the given language and adds it to the multilanguage text used to qualify the validity of this description element.
 void removeMedia(Media media)
          Removes one element from the list of media this description element is based on.
 void removeModifier(Modifier modifier)
          Removes one element from the set of modifiers used to qualify the validity of this description element.
 LanguageString removeModifyingText(Language language)
          Removes from the multilanguage text used to qualify the validity of this description element the one language string with the given language.
 void removeSource(DescriptionElementSource source)
          Removes a source from this object
 void setFeature(Feature feature)
           
protected  void setInDescription(DescriptionBase inDescription)
           
 
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, 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

DescriptionElementBase

protected DescriptionElementBase()
Class constructor: creates a new empty description element instance.

See Also:
DescriptionElementBase(Feature)

DescriptionElementBase

protected DescriptionElementBase(Feature feature)
Class constructor: creates a new description element instance with the given feature that is described or measured.

Parameters:
feature - the feature described or measured
See Also:
DescriptionElementBase()
Method Detail

getMedia

public List<Media> getMedia()
Returns the list of media (that is pictures, movies, recorded sounds ...) this description element is based on.


addMedia

public void addMedia(Media media)
Adds a media to the list of media this description element is based on.

Parameters:
media - the media to be added to this description element
See Also:
getMedia()

removeMedia

public void removeMedia(Media media)
Removes one element from the list of media this description element is based on.

Parameters:
media - the media which should be removed
See Also:
getMedia(), addMedia(Media)

getInDescription

public DescriptionBase getInDescription()
Returns the description that this DescriptionElement is part of.

Returns:

setInDescription

protected void setInDescription(DescriptionBase inDescription)
See Also:
#setInDescription()

getFeature

public Feature getFeature()
Returns the feature this description element is for. A feature is a property that can be described or measured but not the description or the measurement itself.


setFeature

public void setFeature(Feature feature)
See Also:
getFeature()

getModifiers

public Set<Modifier> getModifiers()
Returns the set of modifiers used to qualify the validity of this description element. This is only metainformation.

Specified by:
getModifiers in interface IModifiable

addModifier

public void addModifier(Modifier modifier)
Adds a modifier to the set of modifiers used to qualify the validity of this description element.

Specified by:
addModifier in interface IModifiable
Parameters:
modifier - the modifier to be added to this description element
See Also:
getModifiers()

removeModifier

public void removeModifier(Modifier modifier)
Removes one element from the set of modifiers used to qualify the validity of this description element.

Specified by:
removeModifier in interface IModifiable
Parameters:
modifier - the modifier which should be removed
See Also:
getModifiers(), addModifier(Modifier)

getModifyingText

public Map<Language,LanguageString> getModifyingText()
Returns the multilanguage text used to qualify the validity of this description element. The different language strings contained in the multilanguage text should all have the same meaning.
A multilanguage text does not belong to a controlled term vocabulary as a modifier does.

NOTE: the actual content of this description element is NOT stored in the modifying text. This is only metainformation (like "Some experts express doubt about this assertion").


addModifyingText

public LanguageString addModifyingText(LanguageString description)
Deprecated. should follow the put semantic of maps, this method will be removed in v4.0 Use the putModifyingText method

Adds a translated text in a particular language to the multilanguage text used to qualify the validity of this description element.

Parameters:
description - the language string describing the validity in a particular language
See Also:
getModifyingText(), putModifyingText(Language, String)

putModifyingText

public LanguageString putModifyingText(LanguageString description)
Adds a translated text in a particular language to the multilanguage text used to qualify the validity of this description element.

Parameters:
description - the language string describing the validity in a particular language
See Also:
getModifyingText(), putModifyingText(Language, String)

addModifyingText

public LanguageString addModifyingText(String text,
                                       Language language)
Deprecated. should follow the put semantic of maps, this method will be removed in v4.0 Use the putModifyingText method

Creates a language string based on the given text string and the given language and adds it to the multilanguage text used to qualify the validity of this description element.

Parameters:
text - the string describing the validity in a particular language
language - the language in which the text string is formulated
See Also:
getModifyingText(), putModifyingText(LanguageString)

putModifyingText

public LanguageString putModifyingText(Language language,
                                       String text)
Creates a language string based on the given text string and the given language and adds it to the multilanguage text used to qualify the validity of this description element.

Parameters:
language - the language in which the text string is formulated
text - the string describing the validity in a particular language
See Also:
getModifyingText(), putModifyingText(LanguageString)

removeModifyingText

public LanguageString removeModifyingText(Language language)
Removes from the multilanguage text used to qualify the validity of this description element the one language string with the given language.

Parameters:
language - the language in which the language string to be removed has been formulated
See Also:
getModifyingText()

getSources

public Set<DescriptionElementSource> getSources()
Description copied from interface: ISourceable
Returns the set of original sources (citations) for this sourceable object

Specified by:
getSources in interface ISourceable<DescriptionElementSource>
Returns:

addSource

public void addSource(DescriptionElementSource source)
Description copied from interface: ISourceable
Adds a source to this object

Specified by:
addSource in interface ISourceable<DescriptionElementSource>

addSource

public DescriptionElementSource addSource(String id,
                                          String idNamespace,
                                          Reference citation,
                                          String microCitation)
Description copied from interface: ISourceable
Adds a source that is newly created by its components. If all components are null no source is added.

Specified by:
addSource in interface ISourceable<DescriptionElementSource>

addSource

public void addSource(String id,
                      String idNamespace,
                      Reference citation,
                      String microReference,
                      TaxonNameBase nameUsedInSource,
                      String originalNameString)

removeSource

public void removeSource(DescriptionElementSource source)
Description copied from interface: ISourceable
Removes a source from this object

Specified by:
removeSource in interface ISourceable<DescriptionElementSource>

makeModifierMap

protected Map<TermVocabulary,List<Modifier>> makeModifierMap()

getModifiers

public List<Modifier> getModifiers(TermVocabulary voc)

clone

public Object clone()
             throws CloneNotSupportedException
Clones the description element. The element is not added to the same description as the orginal element (inDescription is set to null).

Overrides:
clone in class AnnotatableEntity
Throws:
CloneNotSupportedException
See Also:
AnnotatableEntity.clone()

clone

public DescriptionElementBase clone(DescriptionBase description)
                             throws CloneNotSupportedException
Clones the description element.
The new element is added to the description.

Throws:
CloneNotSupportedException
See Also:
AnnotatableEntity.clone()


Copyright © 2007-2013 EDIT. All Rights Reserved.