diff options
| author | Bananeweizen <bananeweizen@gmx.de> | 2014-01-17 19:28:14 +0100 |
|---|---|---|
| committer | Bananeweizen <bananeweizen@gmx.de> | 2014-01-17 19:28:14 +0100 |
| commit | 7e68a081d4be9b09c59c52924c1d62775a1fb42e (patch) | |
| tree | eacfcb49a43922b05dcfdea29bc5b2498769fc0d /main/src/cgeo/geocaching/enumerations | |
| parent | 1bbb0cc2d784d0a562c9feef36d1a7b92486dfb4 (diff) | |
| download | cgeo-7e68a081d4be9b09c59c52924c1d62775a1fb42e.zip cgeo-7e68a081d4be9b09c59c52924c1d62775a1fb42e.tar.gz cgeo-7e68a081d4be9b09c59c52924c1d62775a1fb42e.tar.bz2 | |
refactoring: remove the dangerous ordinal() dependency of the loaders
Diffstat (limited to 'main/src/cgeo/geocaching/enumerations')
| -rw-r--r-- | main/src/cgeo/geocaching/enumerations/CacheListType.java | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/main/src/cgeo/geocaching/enumerations/CacheListType.java b/main/src/cgeo/geocaching/enumerations/CacheListType.java index 7efd705..1fce282 100644 --- a/main/src/cgeo/geocaching/enumerations/CacheListType.java +++ b/main/src/cgeo/geocaching/enumerations/CacheListType.java @@ -1,23 +1,32 @@ package cgeo.geocaching.enumerations; +import cgeo.geocaching.loaders.AbstractSearchLoader.CacheListLoaderType; + public enum CacheListType { - OFFLINE(true), - POCKET(false), - HISTORY(true), - NEAREST(false), - COORDINATE(false), - KEYWORD(false), - ADDRESS(false), - USERNAME(false), - OWNER(false), - MAP(false); + OFFLINE(true, CacheListLoaderType.OFFLINE), + POCKET(false, CacheListLoaderType.POCKET), + HISTORY(true, CacheListLoaderType.HISTORY), + NEAREST(false, CacheListLoaderType.NEAREST), + COORDINATE(false, CacheListLoaderType.COORDINATE), + KEYWORD(false, CacheListLoaderType.KEYWORD), + ADDRESS(false, CacheListLoaderType.ADDRESS), + FINDER(false, CacheListLoaderType.FINDER), + OWNER(false, CacheListLoaderType.OWNER), + MAP(false, CacheListLoaderType.MAP); /** * whether or not this list allows switching to another list */ public final boolean canSwitch; - CacheListType(final boolean canSwitch) { + public final CacheListLoaderType loaderType; + + CacheListType(final boolean canSwitch, final CacheListLoaderType loaderType) { this.canSwitch = canSwitch; + this.loaderType = loaderType; + } + + public int getLoaderId() { + return loaderType.getLoaderId(); } } |
