aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/list/PseudoList.java
blob: 71f91239b80fd459e7a2310df2be5b39ae0f0601 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package cgeo.geocaching.list;

import cgeo.geocaching.CgeoApplication;
import cgeo.geocaching.R;

public class PseudoList extends AbstractList {

    private static final int ALL_LIST_ID = 2;
    /**
     * list entry to show all caches
     */
    public static final PseudoList ALL_LIST = new PseudoList(ALL_LIST_ID, R.string.list_all_lists);

    private static final int NEW_LIST_ID = 3;
    /**
     * list entry to create a new list
     */
    public static final AbstractList NEW_LIST = new PseudoList(NEW_LIST_ID, R.string.list_menu_create);

    private static final int HISTORY_LIST_ID = 4;
    /**
     * list entry to create a new list
     */
    public static final AbstractList HISTORY_LIST = new PseudoList(HISTORY_LIST_ID, R.string.menu_history);

    /**
     * private constructor to have all instances as constants in the class
     */
    private PseudoList(int id, final int titleResourceId) {
        super(id, CgeoApplication.getInstance().getResources().getString(titleResourceId));
    }

    @Override
    public String getTitleAndCount() {
        return "<" + title + ">";
    }

    @Override
    public String getTitle() {
        return title;
    }

    @Override
    public int getCount() {
        return -1;
    }

    @Override
    public boolean isConcrete() {
        return false;
    }

}