for (String s : p.getHasSubjects()) {
if (needSubjects.contains(s)) {
matchingSubs.add(s);
}
}
has.add(new SearchResult(ValueObjectGenerator.create(p), true,
matchingSubs, GeocellUtils
.distance(pt, p.getLocation())));
}
temp = System.currentTimeMillis();
participants = pm.searchParticipantsBySubjects(hasSubs, location,
false);
LOG.info("For TOME searchParticipantsBySubjects(hasSubs, location, false) "
+ (System.currentTimeMillis() - temp));
for (Participant p : participants) {
List<String> matchingSubs = new ArrayList<String>();
for (String s : p.getNeedSubjects()) {
if (hasSubjects.contains(s)) {
matchingSubs.add(s);
}
}
need.add(new SearchResult(ValueObjectGenerator.create(p),
false, matchingSubs, GeocellUtils.distance(pt, p
.getLocation())));
}
temp = System.currentTimeMillis();
List<Opportunity> opportunities = om.searchOpportunities(location,
hasSubs);
LOG.info("For TOME searchOpportunities(location, hasSubs) "
+ (System.currentTimeMillis() - temp));
for (Opportunity o : opportunities) {
List<String> matchingSubs = new ArrayList<String>();
for (String s : o.getSubjects()) {
if (hasSubjects.contains(s)) {
matchingSubs.add(s);
}
}
need.add(new SearchResult(ValueObjectGenerator.create(o),
matchingSubs, GeocellUtils
.distance(pt, o.getLocation())));
}
for(SearchResult s: need) {