eu.etaxonomy.cdm.model.common
Class TermBase

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
                  extended by eu.etaxonomy.cdm.model.common.TermBase
All Implemented Interfaces:
IAnnotatableEntity, ICdmBase, IIdentifiableEntity, ISourceable<IdentifiableSource>, IVersionableEntity, Serializable, Cloneable
Direct Known Subclasses:
DefinedTermBase, FeatureTree, TermVocabulary

public abstract class TermBase
extends IdentifiableEntity

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
TermBase()
           
TermBase(String term, String label, String labelAbbrev)
           
 
Method Summary
 void addRepresentation(Representation representation)
           
 Object clone()
          Clones this TermBase.
 boolean equals(Object obj)
          Is true if UUID and created timestamp are the same for the passed Object and this one.
 String getDescription()
           
 String getDescription(Language lang)
           
 String getLabel()
           
 String getLabel(Language lang)
           
 Representation getPreferredRepresentation(Language language)
           
 Representation getPreferredRepresentation(List<Language> languages)
          Returns the Representation in the preferred language.
 Representation getRepresentation(Language lang)
           
 Set<Representation> getRepresentations()
           
 URI getUri()
           
 void removeRepresentation(Representation representation)
           
 void setLabel(String label)
           
 void setLabel(String label, Language language)
           
 void setUri(URI uri)
           
 String toString()
          Overrides Object.toString().
 
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, removeCredit, removeCredit, removeExtension, removeRights, removeSource, setCacheStrategy, setLsid, setProtectedTitleCache, setTitleCache, setTitleCache
 
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
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
 
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

TermBase

public TermBase()

TermBase

public TermBase(String term,
                String label,
                String labelAbbrev)
Method Detail

getRepresentations

public Set<Representation> getRepresentations()

addRepresentation

public void addRepresentation(Representation representation)

removeRepresentation

public void removeRepresentation(Representation representation)

getRepresentation

public Representation getRepresentation(Language lang)

getPreferredRepresentation

public Representation getPreferredRepresentation(Language language)
Parameters:
language -
Returns:
See Also:
getPreferredRepresentation(Language)

getPreferredRepresentation

public Representation getPreferredRepresentation(List<Language> languages)
Returns the Representation in the preferred language. Preferred languages are specified by the parameter languages, which receives a list of Language instances in the order of preference. If no representation in any preferred languages is found the method falls back to return the Representation in Language.DEFAULT() and if necessary further falls back to return the first element found if any. TODO think about this fall-back strategy & see also TextData.getPreferredLanguageString(List)

Parameters:
languages -
Returns:

getUri

public URI getUri()

setUri

public void setUri(URI uri)

getLabel

public String getLabel()

getLabel

public String getLabel(Language lang)

setLabel

public void setLabel(String label)

setLabel

public void setLabel(String label,
                     Language language)

getDescription

public String getDescription()

getDescription

public String getDescription(Language lang)

equals

public boolean equals(Object obj)
Description copied from class: VersionableEntity
Is true if UUID and created timestamp are the same for the passed Object and this one.

Overrides:
equals in class VersionableEntity
See Also:
See {@link http://www.hibernate.org/109.html hibernate109}, {@link http://www.geocities.com/technofundo/tech/java/equalhash.html geocities} or {@link http://www.ibm.com/developerworks/java/library/j-jtp05273.html ibm} for more information about equals and hashcode.

toString

public String toString()
Description copied from class: CdmBase
Overrides Object.toString(). This returns an String that identifies the object well without beeing necessarily unique. Specification: This method should never call other object' methods so it can be well used for debugging without problems like lazy loading, unreal states etc. Note: If overriding this method's javadoc always copy or link the above requirement. If not overwritten by a subclass method returns the class, id and uuid as a string for any CDM object. For example: Taxon#13

Specified by:
toString in interface IIdentifiableEntity
Overrides:
toString in class IdentifiableEntity
See Also:
Object.toString()

clone

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

Overrides:
clone in class IdentifiableEntity
Throws:
CloneNotSupportedException
See Also:
IdentifiableEntity.clone(), Object.clone()


Copyright © 2007-2012 EDIT. All Rights Reserved.