eu.etaxonomy.cdm.model.common
Class TermVocabulary<T extends DefinedTermBase>

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

@Entity
@Indexed(index="eu.etaxonomy.cdm.model.common.TermVocabulary")
public class TermVocabulary<T extends DefinedTermBase>
extends TermBase
implements Iterable<T>

A single enumeration must only contain DefinedTerm instances of one kind (this means a subclass of DefinedTerm).

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

Field Summary
protected  Set<T> terms
           
 
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 TermVocabulary()
           
protected TermVocabulary(String term, String label, String labelAbbrev, URI termSourceUri)
           
 
Method Summary
 void addTerm(T term)
           
 Object clone()
          Clones this TermVocabulary.
 T findTermByUuid(UUID uuid)
           
 Set<T> getTerms()
           
 SortedSet<T> getTermsOrderedByLabels(Language language)
          Returns all terms of this vocabulary sorted by their representation defined by the given language.
 URI getTermSourceUri()
           
 Iterator<T> iterator()
           
static TermVocabulary NewInstance(String description, String label, String abbrev, URI termSourceUri)
           
 TermVocabulary<T> readCsvLine(List<String> csvLine)
           
 TermVocabulary<T> readCsvLine(List<String> csvLine, Language lang)
           
 void removeTerm(T term)
           
 void setTermSourceUri(URI vocabularyUri)
           
 int size()
           
 
Methods inherited from class eu.etaxonomy.cdm.model.common.TermBase
addRepresentation, equals, getDescription, getDescription, getLabel, getLabel, getPreferredRepresentation, getPreferredRepresentation, getRepresentation, getRepresentations, getUri, removeRepresentation, setLabel, setLabel, setUri, 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, regenerateTitleCache, 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, 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
 

Field Detail

terms

@IndexedEmbedded(depth=2)
protected Set<T extends DefinedTermBase> terms
Constructor Detail

TermVocabulary

protected TermVocabulary()

TermVocabulary

protected TermVocabulary(String term,
                         String label,
                         String labelAbbrev,
                         URI termSourceUri)
Method Detail

NewInstance

public static TermVocabulary NewInstance(String description,
                                         String label,
                                         String abbrev,
                                         URI termSourceUri)

findTermByUuid

public T findTermByUuid(UUID uuid)

getTerms

public Set<T> getTerms()

addTerm

public void addTerm(T term)

removeTerm

public void removeTerm(T term)

getTermSourceUri

public URI getTermSourceUri()

setTermSourceUri

public void setTermSourceUri(URI vocabularyUri)

iterator

public Iterator<T> iterator()
Specified by:
iterator in interface Iterable<T extends DefinedTermBase>

size

public int size()

getTermsOrderedByLabels

public SortedSet<T> getTermsOrderedByLabels(Language language)
Returns all terms of this vocabulary sorted by their representation defined by the given language. If such an representation does not exist, the representation of the default language is testing instead for ordering.

Parameters:
language -
Returns:

readCsvLine

public TermVocabulary<T> readCsvLine(List<String> csvLine)

readCsvLine

public TermVocabulary<T> readCsvLine(List<String> csvLine,
                                     Language lang)

clone

public Object clone()
Clones this TermVocabulary. This is a shortcut that enables to create a new instance that differs only slightly from this TermVocabulary. The terms of the original vocabulary are cloned

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


Copyright © 2007-2013 EDIT. All Rights Reserved.