Skip to content
Snippets Groups Projects
Commit 726c57de authored by Christopher Schankula's avatar Christopher Schankula :earth_africa:
Browse files

rename some variables in BasicSearch

parent 12ac6314
No related branches found
No related tags found
No related merge requests found
...@@ -30,36 +30,36 @@ public class BasicSearch { ...@@ -30,36 +30,36 @@ public class BasicSearch {
* @return * @return
*/ */
public static BasicSearchResult range(Integer taxonId, Integer yearLo, Integer yearHi, Double latLo, Double latHi, Double longLo, Double longHi){ public static BasicSearchResult range(Integer taxonId, Integer yearLo, Integer yearHi, Double latLo, Double latHi, Double longLo, Double longHi){
GeneralRange<Record> a0 = RangeHelper.date(Bound.ANY); GeneralRange<Record> dateRange = RangeHelper.date(Bound.ANY);
if ((yearLo != null) && (yearHi != null)) { if ((yearLo != null) && (yearHi != null)) {
Date lower = new Date(yearLo,01,01); Date lower = new Date(yearLo,01,01);
Date upper = new Date(yearHi+1,01,01); Date upper = new Date(yearHi+1,01,01);
a0 = RangeHelper.date(Bound.LOWHIGH, lower, upper); dateRange = RangeHelper.date(Bound.LOWHIGH, lower, upper);
} }
GeneralRange<Record> a2 = RangeHelper.latitude(Bound.ANY); GeneralRange<Record> latRange = RangeHelper.latitude(Bound.ANY);
GeneralRange<Record> a3 = RangeHelper.longitude(Bound.ANY); GeneralRange<Record> longRange = RangeHelper.longitude(Bound.ANY);
if ((latLo != null) && (latHi != null)) { if ((latLo != null) && (latHi != null)) {
a2 = RangeHelper.latitude(Bound.LOWHIGH, latLo, latHi); latRange = RangeHelper.latitude(Bound.LOWHIGH, latLo, latHi);
} }
if ((longLo != null) && (longHi != null)) { if ((longLo != null) && (longHi != null)) {
a3 = RangeHelper.longitude(Bound.LOWHIGH, longLo, longHi); longRange = RangeHelper.longitude(Bound.LOWHIGH, longLo, longHi);
} }
GeneralRange<Record> a1; GeneralRange<Record> taxonRange;
Iterable<Integer> searches = BioTree.getNonEmptyChildren(taxonId); Iterable<Integer> searches = BioTree.getNonEmptyChildren(taxonId);
Stopwatch sw = new Stopwatch(); Stopwatch sw = new Stopwatch();
ArrayList<Record> results = new ArrayList<Record>(); ArrayList<Record> results = new ArrayList<Record>();
for (Integer txId: searches) { for (Integer txId: searches) {
a1 = RangeHelper.taxonID(Bound.EQUALS, txId); taxonRange = RangeHelper.taxonID(Bound.EQUALS, txId);
ArrayList<GeneralRange<Record>> axes = new ArrayList<GeneralRange<Record>>(); ArrayList<GeneralRange<Record>> axes = new ArrayList<GeneralRange<Record>>();
axes.add(a0);axes.add(a1);axes.add(a2);axes.add(a3); axes.add(dateRange);axes.add(taxonRange);axes.add(latRange);axes.add(longRange);
results.addAll((Collection<? extends Record>) DataStore.records.rangeSearch(axes)); results.addAll((Collection<? extends Record>) DataStore.records.rangeSearch(axes));
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment