diff options
| author | keith.paterson <keith.paterson@saxsys.de> | 2011-09-07 21:25:39 +0200 |
|---|---|---|
| committer | keith.paterson <keith.paterson@saxsys.de> | 2011-09-07 21:25:39 +0200 |
| commit | b8f828f9eeb3036771e47ecb74bb4494223a70cd (patch) | |
| tree | 0546517e20606c80108cd5ccab83a35cf529bddd | |
| parent | db63bd6960cc6023e1a73b6c54358089ef3bfc84 (diff) | |
| download | cgeo-b8f828f9eeb3036771e47ecb74bb4494223a70cd.zip cgeo-b8f828f9eeb3036771e47ecb74bb4494223a70cd.tar.gz cgeo-b8f828f9eeb3036771e47ecb74bb4494223a70cd.tar.bz2 | |
Renamed Method and Comments
| -rw-r--r-- | src/cgeo/geocaching/cgData.java | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/cgeo/geocaching/cgData.java b/src/cgeo/geocaching/cgData.java index 16d21cb..70c7b4e 100644 --- a/src/cgeo/geocaching/cgData.java +++ b/src/cgeo/geocaching/cgData.java @@ -1744,16 +1744,16 @@ public class cgData { public ArrayList<cgCache> loadCaches(Object[] geocodes, Object[] guids, Long centerLat, Long centerLon, Long spanLat, Long spanLon, boolean loadA, boolean loadW, boolean loadS, boolean loadL, boolean loadI, boolean loadO) { init(); - +// Using more than one of the parametersets results in overly comlex wheres if (((geocodes != null && geocodes.length > 0) && (guids != null && guids.length > 0))) { - throw new IllegalArgumentException("Nur Entweder oder"); + throw new IllegalArgumentException("Please use only one parameter"); } if (((geocodes != null && geocodes.length > 0) || (guids != null && guids.length > 0)) && centerLat != null && centerLon != null && spanLat != null && spanLon != null) { - throw new IllegalArgumentException("Nur Entweder oder"); + throw new IllegalArgumentException("Please use only one parameter"); } StringBuilder where = new StringBuilder(); Cursor cursor = null; @@ -1844,13 +1844,12 @@ public class cgData { null); if (cursor != null) { - int index = 0; - if (cursor.getCount() > 0) { cursor.moveToFirst(); do { - cgCache cache = mapCache(cursor); + //Extracted Method + cgCache cache = createCacheFromDatabaseContent(cursor); if (loadA) { ArrayList<String> attributes = loadAttributes(cache.geocode); @@ -1936,8 +1935,14 @@ public class cgData { return caches; } + + /** + * maps a Cache from the cursor. Doesn't next. + * @param cursor + * @return + */ - private cgCache mapCache(Cursor cursor) { + private cgCache createCacheFromDatabaseContent(Cursor cursor) { int index; cgCache cache = new cgCache(); |
