diff options
| author | Bananeweizen <bananeweizen@gmx.de> | 2011-09-14 07:28:14 +0200 |
|---|---|---|
| committer | Bananeweizen <bananeweizen@gmx.de> | 2011-09-14 07:28:14 +0200 |
| commit | 9ba4affde4156a66a033abe138a9c9f558bfe8a3 (patch) | |
| tree | 939f9fa516be8275735f45e659d83f8d3cbf2ea4 /src/cgeo/geocaching/apps | |
| parent | 6cbf41090bc771c8d3fd5e811f9b4d6219fea1f2 (diff) | |
| download | cgeo-9ba4affde4156a66a033abe138a9c9f558bfe8a3.zip cgeo-9ba4affde4156a66a033abe138a9c9f558bfe8a3.tar.gz cgeo-9ba4affde4156a66a033abe138a9c9f558bfe8a3.tar.bz2 | |
use static methods when possible
Diffstat (limited to 'src/cgeo/geocaching/apps')
| -rw-r--r-- | src/cgeo/geocaching/apps/AbstractLocusApp.java | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/cgeo/geocaching/apps/AbstractLocusApp.java b/src/cgeo/geocaching/apps/AbstractLocusApp.java index 3424558..041894c 100644 --- a/src/cgeo/geocaching/apps/AbstractLocusApp.java +++ b/src/cgeo/geocaching/apps/AbstractLocusApp.java @@ -30,7 +30,7 @@ import cgeo.geocaching.enumerations.WaypointType; public abstract class AbstractLocusApp extends AbstractApp { private static final String INTENT = Intent.ACTION_VIEW; private static final SimpleDateFormat ISO8601DATE = new SimpleDateFormat("yyyy-MM-dd'T'"); - + protected AbstractLocusApp(final Resources res) { super(res.getString(R.string.caches_map_locus), INTENT); } @@ -42,13 +42,13 @@ public abstract class AbstractLocusApp extends AbstractApp { /** * Display a list of caches / waypoints in Locus - * + * * @param objectsToShow which caches/waypoints to show * @param withCacheWaypoints wether to give waypoints of caches to Locus or not * @param activity * @author koem */ - protected void showInLocus(List<? extends Object> objectsToShow, boolean withCacheWaypoints, + protected void showInLocus(List<? extends Object> objectsToShow, boolean withCacheWaypoints, Activity activity) { if (objectsToShow == null) return; @@ -58,9 +58,9 @@ public abstract class AbstractLocusApp extends AbstractApp { // get icon and Point Point p = null; if (o instanceof cgCache) { - p = this.getPoint((cgCache) o, withCacheWaypoints); + p = getPoint((cgCache) o, withCacheWaypoints); } else if (o instanceof cgWaypoint) { - p = this.getPoint((cgWaypoint) o); + p = getPoint((cgWaypoint) o); } else { continue; // no cache, no waypoint => ignore } @@ -76,20 +76,20 @@ public abstract class AbstractLocusApp extends AbstractApp { ArrayList<PointsData> data = new ArrayList<PointsData>(); data.add(pd); DisplayData.sendDataCursor(activity, data, - "content://" + LocusDataStorageProvider.class.getCanonicalName().toLowerCase(), + "content://" + LocusDataStorageProvider.class.getCanonicalName().toLowerCase(), false); } } /** * This method constructs a <code>Point</code> for displaying in Locus - * + * * @param cache - * @param withWaypoints wether to give waypoints to Locus or not + * @param withWaypoints whether to give waypoints to Locus or not * @return null, when the <code>Point</code> could not be constructed * @author koem */ - private Point getPoint(cgCache cache, boolean withWaypoints) { + private static Point getPoint(cgCache cache, boolean withWaypoints) { if (cache == null || cache.coords == null) return null; // create one simple point with location @@ -146,12 +146,12 @@ public abstract class AbstractLocusApp extends AbstractApp { /** * This method constructs a <code>Point</code> for displaying in Locus - * + * * @param waypoint * @return null, when the <code>Point</code> could not be constructed * @author koem */ - private Point getPoint(cgWaypoint waypoint) { + private static Point getPoint(cgWaypoint waypoint) { if (waypoint == null || waypoint.coords == null) return null; // create one simple point with location @@ -160,12 +160,12 @@ public abstract class AbstractLocusApp extends AbstractApp { loc.setLongitude(waypoint.coords.getLongitude()); Point p = new Point(waypoint.name, loc); - p.setDescription("<a href=\"http://coord.info/" + waypoint.geocode + "\">" + p.setDescription("<a href=\"http://coord.info/" + waypoint.geocode + "\">" + waypoint.geocode + "</a>"); return p; } - + private static final int NO_LOCUS_ID = -1; private static int toLocusId(final CacheType ct) { @@ -198,7 +198,7 @@ public abstract class AbstractLocusApp extends AbstractApp { default: return NO_LOCUS_ID; } } - + private static String toLocusId(final WaypointType wt) { switch (wt) { case FLAG: return PointGeocachingData.CACHE_WAYPOINT_TYPE_FINAL; |
