pw.print(makeLink(getTimegateUrl(ap, requestUrl), TIMEGATE));
pw.println(",");
if (first.compareTo(last) == 0) {
// special handling of single result:
CaptureSearchResult result = results.getResults().get(0);
pw.print(makeLink(ap, result.getOriginalUrl(), FIRST_LAST_MEMENTO, result));
} else {
List<CaptureSearchResult> lr = results.getResults();
int count = lr.size();
String rel;
for (int i = 0; i < count; i++) {
CaptureSearchResult result = lr.get(i);
if (i == 0) {
rel = FIRST_MEMENTO;
} else if (i == count - 1) {
pw.println(",");
rel = LAST_MEMENTO;
} else {
pw.println(",");
rel = MEMENTO;
}
pw.print(makeLink(ap, result.getOriginalUrl(), rel,
result));
}
}
// ludab nov 30 2012
if (results.getMatchingCount() > results.getReturnedCount()) {