1 | /* This file is part of Aard Dictionary for Android <http://aarddict.org>. |
2 | * |
3 | * This program is free software: you can redistribute it and/or modify |
4 | * it under the terms of the GNU General Public License version 3 |
5 | * as published by the Free Software Foundation. |
6 | * |
7 | * This program is distributed in the hope that it will be useful, |
8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
10 | * GNU General Public License <http://www.gnu.org/licenses/gpl-3.0.txt> |
11 | * for more details. |
12 | * |
13 | * Copyright (C) 2010 Igor Tkach |
14 | */ |
15 | |
16 | package aarddict; |
17 | |
18 | import java.util.Comparator; |
19 | |
20 | import com.ibm.icu.text.Collator; |
21 | |
22 | public class EntryComparators { |
23 | |
24 | final static EntryComparator FULL1 = new EntryComparator(Collator.PRIMARY); |
25 | final static EntryComparator FULL2 = new EntryComparator(Collator.SECONDARY); |
26 | final static EntryComparator FULL3 = new EntryComparator(Collator.TERTIARY); |
27 | |
28 | final static EntryStartComparator START1 = new EntryStartComparator(Collator.PRIMARY); |
29 | final static EntryStartComparator START2 = new EntryStartComparator(Collator.SECONDARY); |
30 | final static EntryStartComparator START3 = new EntryStartComparator(Collator.TERTIARY); |
31 | |
32 | @SuppressWarnings("unchecked") |
33 | public static Comparator<Entry>[] ALL = new Comparator[] { |
34 | FULL3, FULL2, FULL1, START3, START2, START1 |
35 | }; |
36 | |
37 | @SuppressWarnings("unchecked") |
38 | public static Comparator<Entry>[] ALL_FULL = new Comparator[] { |
39 | FULL3, FULL2, FULL1 |
40 | }; |
41 | |
42 | @SuppressWarnings("unchecked") |
43 | public static Comparator<Entry>[] EXACT_IGNORE_CASE = new Comparator[] { |
44 | FULL3, FULL2 |
45 | }; |
46 | |
47 | @SuppressWarnings("unchecked") |
48 | public static Comparator<Entry>[] EXACT = new Comparator[] { |
49 | FULL3 |
50 | }; |
51 | } |