@SuppressWarnings("deprecation")
@Override
public final String finishRow()
{
int listindex = ((List<ReportableListObject>) getDecoratedObject()).indexOf(this.getCurrentRowObject());
ReportableListObject reportableObject = (ReportableListObject) this.getCurrentRowObject();
String nextCity = null;
this.cityTotal += reportableObject.getAmount();
this.grandTotal += reportableObject.getAmount();
if (listindex != ((List<ReportableListObject>) getDecoratedObject()).size() - 1)
{
nextCity = (((List<ReportableListObject>) getDecoratedObject()).get(listindex + 1)).getCity();
}
this.buffer = new StringBuffer(1000);
// City subtotals...
if (!ObjectUtils.equals(nextCity, reportableObject.getCity()))
{
writeCityTotal(reportableObject.getCity(), this.cityTotal);
this.cityTotal = 0;
}
// Grand totals...
if (getViewIndex() == ((List<ReportableListObject>) getDecoratedObject()).size() - 1)