Changed confusing names

This commit is contained in:
misaochan 2016-01-06 18:08:05 +13:00
parent c8773101d5
commit 3b1a8e2c97

View file

@ -14,7 +14,6 @@ public class CacheController {
private double x;
private double y;
private QuadTree quadTree;
private List<String> categoryList;
private Point[] pointsFound;
public CacheController() {
@ -32,26 +31,24 @@ public class CacheController {
public void cacheCategory() {
List<String> pointCatList = new ArrayList<String>();
if (MwVolleyApi.GpsCatExists.getGpsCatExists() == true) {
categoryList = new ArrayList<String>(MwVolleyApi.getGpsCat());
Log.d("Cache", "Categories being cached: " + categoryList);
pointCatList.addAll(MwVolleyApi.getGpsCat());
Log.d("Cache", "Categories being cached: " + pointCatList);
} else {
Log.d("Cache", "No categories found, so no categories cached");
}
//categoryList = new ArrayList<String>();
//categoryList.add("UK");
//categoryList.add("US");
quadTree.set(x, y, categoryList);
quadTree.set(x, y, pointCatList);
}
public void findCategory() {
//TODO: Convert decLatitude and decLongitude to a range with proper formula, for testing just use 10
pointsFound = quadTree.searchWithin(x-10, y-10, x+10, y+10);
ArrayList catList = new ArrayList();
ArrayList displayCatList = new ArrayList();
Log.d("Cache", "Points found in quadtree: " + pointsFound);
//TODO: Potentially flatten catList and iterate thru it to convert into unique Set? But currently just displays one point...
if (pointsFound.length != 0) {
Log.d("Cache", "Entering for loop");
@ -60,7 +57,7 @@ public class CacheController {
Log.d("Cache", "Nearby point: " + point.toString());
Object cat = point.getValue();
Log.d("Cache", "Nearby cat: " + cat);
catList.add(index, cat);
displayCatList.add(index, cat);
index++;
}