- added support for term retrieval by TermVocabulary
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / store / TermStore.java
index 3db2afee30791caa4bcc6a7f23c1b70ab0a6c410..fe8016fc1f7a565f868798730d0b4db3e26cd607 100644 (file)
@@ -23,6 +23,7 @@ import eu.etaxonomy.cdm.api.service.exception.ReferencedObjectUndeletableExcepti
 import eu.etaxonomy.cdm.model.common.DefinedTermBase;
 import eu.etaxonomy.cdm.model.common.MarkerType;
 import eu.etaxonomy.cdm.model.common.TermType;
+import eu.etaxonomy.cdm.model.common.TermVocabulary;
 import eu.etaxonomy.cdm.model.description.AbsenceTerm;
 import eu.etaxonomy.cdm.model.description.Feature;
 import eu.etaxonomy.cdm.model.description.PresenceAbsenceTermBase;
@@ -65,6 +66,17 @@ public class TermStore {
         return getTermsFromService(termType, comparator);
        }
 
+       /**
+        * Returns an alphabetically sorted list of terms (anything that extends {@link DefinedTermBase}) of the given {@link TermType})
+        * currently available in the system.
+        *
+        * @param termType the term type
+        * @return an alphabetically sorted list of terms
+        */
+       public static <TERM extends DefinedTermBase> Set<TERM> getTerms(TermVocabulary<TERM> termVocabulary, Comparator<DefinedTermBase<?>> comparator){
+           return termVocabulary.getTerms();
+       }
+
        /**
         * Returns a list of terms of the given type currently available in the system.
         * If <code>filtered</code> is set to <code>true</code>, all terms for certain types will be