public void calculateGrandTotal() { grandTotal = 0; if (items == null) { return; } for (ReportItem item : items) { grandTotal += item.getTotal(); } }
public Object getValueAt(int rowIndex, int columnIndex) { ReportItem item = items.get(rowIndex); switch (columnIndex) { case 0: return item.getName(); case 1: return currencySymbol + " " + formatter.format(item.getPrice()); case 2: return String.valueOf(item.getQuantity()); case 3: return String.valueOf(item.getTaxRate()) + "%"; case 4: return currencySymbol + " " + formatter.format(item.getTotal()); } return null; }
public ReportComposite addItem(ReportItem e) { e.setParent(this); items.add(e); return this; }