diff options
| author | Bananeweizen <bananeweizen@gmx.de> | 2014-01-11 17:00:00 +0100 |
|---|---|---|
| committer | Bananeweizen <bananeweizen@gmx.de> | 2014-01-11 17:00:00 +0100 |
| commit | 9c036c506d78c4b927a91ea65326eb09424a3795 (patch) | |
| tree | cbada5c7fe6d05a7a2373cae0f8a4f9f5ca0b6c1 /main/src/cgeo/geocaching/enumerations | |
| parent | 6a8244166bf3a3eef35024df9e0818e88e80513f (diff) | |
| download | cgeo-9c036c506d78c4b927a91ea65326eb09424a3795.zip cgeo-9c036c506d78c4b927a91ea65326eb09424a3795.tar.gz cgeo-9c036c506d78c4b927a91ea65326eb09424a3795.tar.bz2 | |
refactoring: remove unused code
Diffstat (limited to 'main/src/cgeo/geocaching/enumerations')
| -rw-r--r-- | main/src/cgeo/geocaching/enumerations/CacheAttribute.java | 8 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/enumerations/LogTypeTrackable.java | 23 |
2 files changed, 8 insertions, 23 deletions
diff --git a/main/src/cgeo/geocaching/enumerations/CacheAttribute.java b/main/src/cgeo/geocaching/enumerations/CacheAttribute.java index 472bad5..0703c3c 100644 --- a/main/src/cgeo/geocaching/enumerations/CacheAttribute.java +++ b/main/src/cgeo/geocaching/enumerations/CacheAttribute.java @@ -164,15 +164,11 @@ public enum CacheAttribute { } private final static Map<String, CacheAttribute> FIND_BY_GCRAWNAME; - private final static SparseArray<CacheAttribute> FIND_BY_GCID = new SparseArray<CacheAttribute>(); private final static SparseArray<CacheAttribute> FIND_BY_OCACODE = new SparseArray<CacheAttribute>(); static { final HashMap<String, CacheAttribute> mapGcRawNames = new HashMap<String, CacheAttribute>(); for (CacheAttribute attr : values()) { mapGcRawNames.put(attr.rawName, attr); - if (attr.gcid != NO_ID) { - FIND_BY_GCID.put(attr.gcid, attr); - } if (attr.ocacode != NO_ID) { FIND_BY_OCACODE.put(attr.ocacode, attr); } @@ -184,10 +180,6 @@ public enum CacheAttribute { return rawName != null ? FIND_BY_GCRAWNAME.get(rawName) : null; } - public static CacheAttribute getByGcId(final int gcid) { - return FIND_BY_GCID.get(gcid); - } - public static CacheAttribute getByOcACode(final int ocAcode) { return FIND_BY_OCACODE.get(ocAcode); } diff --git a/main/src/cgeo/geocaching/enumerations/LogTypeTrackable.java b/main/src/cgeo/geocaching/enumerations/LogTypeTrackable.java index 68a17a5..e008294 100644 --- a/main/src/cgeo/geocaching/enumerations/LogTypeTrackable.java +++ b/main/src/cgeo/geocaching/enumerations/LogTypeTrackable.java @@ -1,29 +1,22 @@ package cgeo.geocaching.enumerations; +import cgeo.geocaching.CgeoApplication; import cgeo.geocaching.R; public enum LogTypeTrackable { - DO_NOTHING(0, "", R.string.log_tb_nothing), - VISITED(1, "_Visited", R.string.log_tb_visit), - DROPPED_OFF(2, "_DroppedOff", R.string.log_tb_drop); + DO_NOTHING("", R.string.log_tb_nothing), + VISITED("_Visited", R.string.log_tb_visit), + DROPPED_OFF("_DroppedOff", R.string.log_tb_drop); - final public int id; final public String action; - final public int resourceId; + final private int resourceId; - LogTypeTrackable(int id, String action, int resourceId) { - this.id = id; + LogTypeTrackable(String action, int resourceId) { this.action = action; this.resourceId = resourceId; } - public static LogTypeTrackable findById(int id) { - for (LogTypeTrackable logType : values()) { - if (logType.id == id) { - return logType; - } - } - return DO_NOTHING; + public String getLabel() { + return CgeoApplication.getInstance().getString(resourceId); } - } |
