List<String[]> result = new ArrayList<String[]>();
if (ascending)
{
for (int i = start; i < (start + max) && i < count; i++)
{
FacetResult c = facet.get(i);
String freq = showFrequencies ? String.valueOf(c.getCount())
: "";
result.add(new String[] { c.getDisplayedValue(),
c.getAuthorityKey(), freq });
}
}
else
{
for (int i = count - start - 1; i >= count - (start + max)
&& i >= 0; i--)
{
FacetResult c = facet.get(i);
String freq = showFrequencies ? String.valueOf(c.getCount())
: "";
result.add(new String[] { c.getDisplayedValue(),
c.getAuthorityKey(), freq });
}
}
return result;
}