aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/list/AbstractList.java
blob: 5836e6cdf186f52fb6dc161f67954185dd961d47 (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
package cgeo.geocaching.list;

import org.eclipse.jdt.annotation.Nullable;

import android.util.SparseArray;

public abstract class AbstractList {

    public final int id;
    public final String title;
    private final static SparseArray<AbstractList> LISTS = new SparseArray<>();

    public AbstractList(final int id, final String title) {
        this.id = id;
        this.title = title;
        LISTS.put(id, this);
    }

    public abstract String getTitleAndCount();

    public abstract boolean isConcrete();

    public abstract String getTitle();

    public abstract int getNumberOfCaches();

    @Nullable
    public static AbstractList getListById(final int listId) {
        return LISTS.get(listId);
    }

}