diff options
Diffstat (limited to 'main/src/cgeo/geocaching/enumerations')
4 files changed, 20 insertions, 8 deletions
diff --git a/main/src/cgeo/geocaching/enumerations/CacheSize.java b/main/src/cgeo/geocaching/enumerations/CacheSize.java index c4e2831..3a2f379 100644 --- a/main/src/cgeo/geocaching/enumerations/CacheSize.java +++ b/main/src/cgeo/geocaching/enumerations/CacheSize.java @@ -83,7 +83,7 @@ public enum CacheSize { } } } - } catch (final NumberFormatException e) { + } catch (final NumberFormatException ignored) { // ignore, as this might be a number or not } return UNKNOWN; diff --git a/main/src/cgeo/geocaching/enumerations/CacheType.java b/main/src/cgeo/geocaching/enumerations/CacheType.java index 1d190e4..93d7098 100644 --- a/main/src/cgeo/geocaching/enumerations/CacheType.java +++ b/main/src/cgeo/geocaching/enumerations/CacheType.java @@ -48,7 +48,7 @@ public enum CacheType { private final int stringId; public final int markerId; - CacheType(String id, String pattern, String guid, int stringId, int markerId) { + CacheType(final String id, final String pattern, final String guid, final int stringId, final int markerId) { this.id = id; this.pattern = pattern; this.guid = guid; @@ -63,7 +63,7 @@ public enum CacheType { final HashMap<String, CacheType> mappingId = new HashMap<>(); final HashMap<String, CacheType> mappingPattern = new HashMap<>(); final HashMap<String, CacheType> mappingGuid = new HashMap<>(); - for (CacheType ct : values()) { + for (final CacheType ct : values()) { mappingId.put(ct.id, ct); mappingPattern.put(ct.pattern.toLowerCase(Locale.US), ct); mappingGuid.put(ct.guid, ct); @@ -72,6 +72,8 @@ public enum CacheType { mappingPattern.put("Mystery Cache".toLowerCase(Locale.US), MYSTERY); // This pattern briefly appeared on gc.com in 2014-08. mappingPattern.put("Traditional Geocache".toLowerCase(Locale.US), TRADITIONAL); + // map lab caches to the virtual type for the time being + mappingPattern.put("Lab Cache".toLowerCase(Locale.US), VIRTUAL); FIND_BY_ID = Collections.unmodifiableMap(mappingId); FIND_BY_PATTERN = Collections.unmodifiableMap(mappingPattern); @@ -121,7 +123,7 @@ public enum CacheType { * @param cache * @return true if this is the ALL type or if this type equals the type of the cache. */ - public boolean contains(ICache cache) { + public boolean contains(final ICache cache) { if (cache == null) { return false; } diff --git a/main/src/cgeo/geocaching/enumerations/LocationProviderType.java b/main/src/cgeo/geocaching/enumerations/LocationProviderType.java index f2c79fe..a6f0114 100644 --- a/main/src/cgeo/geocaching/enumerations/LocationProviderType.java +++ b/main/src/cgeo/geocaching/enumerations/LocationProviderType.java @@ -5,6 +5,8 @@ import cgeo.geocaching.R; public enum LocationProviderType { GPS(R.string.loc_gps), NETWORK(R.string.loc_net), + FUSED(R.string.loc_fused), + LOW_POWER(R.string.loc_low_power), LAST(R.string.loc_last); public final int resourceId; diff --git a/main/src/cgeo/geocaching/enumerations/LogType.java b/main/src/cgeo/geocaching/enumerations/LogType.java index 84ab7b9..5345611 100644 --- a/main/src/cgeo/geocaching/enumerations/LogType.java +++ b/main/src/cgeo/geocaching/enumerations/LogType.java @@ -52,7 +52,7 @@ public enum LogType { private final int stringId; public final int markerId; - LogType(int id, String iconName, String type, String oc_type, int stringId, int markerId) { + LogType(final int id, final String iconName, final String type, final String oc_type, final int stringId, final int markerId) { this.id = id; this.iconName = iconName; this.type = type; @@ -61,7 +61,7 @@ public enum LogType { this.markerId = markerId; } - LogType(int id, String iconName, String type, String oc_type, int stringId) { + LogType(final int id, final String iconName, final String type, final String oc_type, final int stringId) { this(id, iconName, type, oc_type, stringId, R.drawable.mark_gray); } @@ -70,7 +70,7 @@ public enum LogType { static { final HashMap<String, LogType> mappingPattern = new HashMap<>(); final HashMap<String, LogType> mappingType = new HashMap<>(); - for (LogType lt : values()) { + for (final LogType lt : values()) { if (lt.iconName != null) { mappingPattern.put(lt.iconName, lt); } @@ -81,7 +81,7 @@ public enum LogType { } public static LogType getById(final int id) { - for (LogType logType : values()) { + for (final LogType logType : values()) { if (logType.id == id) { return logType; } @@ -113,4 +113,12 @@ public enum LogType { public final String getL10n() { return CgeoApplication.getInstance().getBaseContext().getResources().getString(stringId); } + + public final boolean isFoundLog() { + return this == LogType.FOUND_IT || this == LogType.ATTENDED || this == LogType.WEBCAM_PHOTO_TAKEN; + } + + public boolean mustConfirmLog() { + return this == ARCHIVE || this == NEEDS_ARCHIVE; + } } |
