Changeset 5900


Ignore:
Timestamp:
2003-11-19T15:10:31+13:00 (20 years ago)
Author:
jmt12
Message:

Added a new method to provide a TreeSet of the current languages in use. We use a tree set so each language only appears once, and is automatically available in natural ordering

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/cdm/CollectionMetaManager.java

    r5590 r5900  
    7070    public CollectionMeta get(int i) {
    7171    return (CollectionMeta) getElementAt(i);
     72    }
     73
     74    /** Retrieve the languages in use for the metadata assigned to this collection
     75     * @return an TreeSet containing the languages used
     76     */
     77    public TreeSet getLanguages() {
     78    TreeSet result = new TreeSet();
     79    int size = getSize();
     80    for(int i = 0; i < size; i++) {
     81        CollectionMeta metadata = (CollectionMeta) getElementAt(i);
     82        String language = metadata.getLanguage();
     83        result.add(language);
     84    }
     85    return result;
    7286    }
    7387
Note: See TracChangeset for help on using the changeset viewer.