1 |
|
|
2 |
|
package pl.magot.vetch.ancal.dataview; |
3 |
|
|
4 |
|
|
5 |
|
import java.util.*; |
6 |
|
import pl.magot.vetch.ancal.Prefs; |
7 |
|
import pl.magot.vetch.ancal.agenda.AgendaViewType; |
8 |
|
import pl.magot.vetch.ancal.database.DataRowNote; |
9 |
|
import pl.magot.vetch.ancal.database.Database; |
10 |
|
import android.database.Cursor; |
11 |
|
|
12 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (14) |
Complexity: 5 |
Complexity Density: 0,56 |
|
13 |
|
public class DataViewNote extends DataView |
14 |
|
{ |
15 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0,33 |
|
16 |
|
public class RowsComparator implements Comparator<DataViewItem> |
17 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0,33 |
|
18 |
3
|
public int compare(DataViewItem item1, DataViewItem item2)... |
19 |
|
{ |
20 |
3
|
String s1 = item1.sSubject; |
21 |
3
|
String s2 = item2.sSubject; |
22 |
3
|
return s1.compareTo(s2); |
23 |
|
} |
24 |
|
}; |
25 |
|
|
26 |
|
|
27 |
|
private RowsComparator fnCmp = null; |
28 |
|
|
29 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0,33 |
|
30 |
1
|
public DataViewNote(Database db, Prefs prefs)... |
31 |
|
{ |
32 |
1
|
super(db, prefs); |
33 |
1
|
sTableName = Database.sTableNameNotes; |
34 |
1
|
fnCmp = new RowsComparator(); |
35 |
|
} |
36 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0,25 |
|
37 |
8
|
@Override... |
38 |
|
public void AddItem(Cursor cr) |
39 |
|
{ |
40 |
8
|
DataViewItem item = new DataViewItem(); |
41 |
|
|
42 |
8
|
item.lID = cr.getLong(DataRowNote.fid.ID); |
43 |
8
|
item.sSubject = cr.getString(DataRowNote.fid.Subject); |
44 |
|
|
45 |
8
|
rows.add(item); |
46 |
|
} |
47 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
48 |
7
|
@Override... |
49 |
|
public void FilterDataForView(DataViewItem item, final Calendar calStartDate, final AgendaViewType agendaViewType) |
50 |
|
{ |
51 |
7
|
item.viewMode = agendaViewType; |
52 |
|
} |
53 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
54 |
25
|
@Override... |
55 |
|
protected void FilterDataPrepare(final Calendar calStartDate, final AgendaViewType agendaViewType) |
56 |
|
{ |
57 |
|
|
58 |
|
} |
59 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
60 |
6
|
@Override... |
61 |
|
public void SortView() |
62 |
|
{ |
63 |
6
|
Collections.sort(rows, fnCmp); |
64 |
|
} |
65 |
|
|
66 |
|
} |