Merge branch 'develop' into LibrAlign
[taxeditor.git] / eu.etaxonomy.taxeditor.bulkeditor / src / main / java / eu / etaxonomy / taxeditor / bulkeditor / input / sortprovider / AbstractSortProvider.java
1 /**
2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
8 */
9
10 package eu.etaxonomy.taxeditor.bulkeditor.input.sortprovider;
11
12 import java.util.Comparator;
13 import java.util.HashMap;
14 import java.util.Map;
15 import java.util.Set;
16
17 import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorSortProvider;
18
19 /**
20 * @author n.hoffmann
21 * @created Dec 14, 2010
22 * @version 1.0
23 */
24 public class AbstractSortProvider<T> implements IBulkEditorSortProvider<T> {
25
26 Map<String, Comparator<T>> comparators = new HashMap<String, Comparator<T>>();
27
28 /* (non-Javadoc)
29 * @see eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorSortProvider#getComparators()
30 */
31 @Override
32 public Map<String, Comparator<T>> getComparators() {
33 return comparators;
34 }
35
36 /* (non-Javadoc)
37 * @see eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorSortProvider#getComparatorNames()
38 */
39 @Override
40 public Set<String> getComparatorNames() {
41 return comparators.keySet();
42 }
43
44 /* (non-Javadoc)
45 * @see eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorSortProvider#getComparatorByName(java.lang.String)
46 */
47 @Override
48 public Comparator<T> getComparatorByName(String name) {
49 return comparators.get(name);
50 }
51
52 }