1 |
89ce56b3
|
Andreas Müller
|
/**
|
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 |
b3efd136
|
Katja Luther
|
package eu.etaxonomy.cdm.api.service;
|
10 |
|
|
|
11 |
|
|
import java.util.Comparator;
|
12 |
|
|
|
13 |
|
|
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
|
14 |
45cac117
|
Katja Luther
|
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDtoByNameComparator;
|
15 |
|
|
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDtoByRankAndNameComparator;
|
16 |
|
|
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDtoNaturalComparator;
|
17 |
b3efd136
|
Katja Luther
|
|
18 |
500073dd
|
Andreas Kohlbecker
|
public enum TaxonNodeDtoSortMode {
|
19 |
b3efd136
|
Katja Luther
|
|
20 |
89ce56b3
|
Andreas Müller
|
NaturalOrder(new TaxonNodeDtoNaturalComparator()),
|
21 |
b3efd136
|
Katja Luther
|
/**
|
22 |
|
|
* sorts by TaxonName titleCaches and rank associated with the taxonNodes
|
23 |
|
|
*/
|
24 |
89ce56b3
|
Andreas Müller
|
RankAndAlphabeticalOrder(new TaxonNodeDtoByRankAndNameComparator()),
|
25 |
b3efd136
|
Katja Luther
|
/**
|
26 |
|
|
* sorts by TaxonName titleCaches associated with the taxonNodes
|
27 |
|
|
*/
|
28 |
89ce56b3
|
Andreas Müller
|
AlphabeticalOrder(new TaxonNodeDtoByNameComparator());
|
29 |
b3efd136
|
Katja Luther
|
|
30 |
89ce56b3
|
Andreas Müller
|
private Comparator<TaxonNodeDto> comparator;
|
31 |
b3efd136
|
Katja Luther
|
|
32 |
89ce56b3
|
Andreas Müller
|
private TaxonNodeDtoSortMode(Comparator<TaxonNodeDto> comparator){
|
33 |
|
|
this.comparator = comparator;
|
34 |
b3efd136
|
Katja Luther
|
}
|
35 |
|
|
|
36 |
89ce56b3
|
Andreas Müller
|
public Comparator<TaxonNodeDto> comparator() {
|
37 |
|
|
return comparator;
|
38 |
b3efd136
|
Katja Luther
|
}
|
39 |
|
|
}
|