public double getSubTotal() { double sum = 0.0; for (TicketLineInfo line : m_aLines) { sum += line.getSubValue(); } return sum; }
public TicketTaxInfo[] getTaxLines() { Map<String, TicketTaxInfo> m = new HashMap<String, TicketTaxInfo>(); TicketLineInfo oLine; for (Iterator<TicketLineInfo> i = m_aLines.iterator(); i.hasNext(); ) { oLine = i.next(); TicketTaxInfo t = m.get(oLine.getTaxInfo().getId()); if (t == null) { t = new TicketTaxInfo(oLine.getTaxInfo()); m.put(t.getTaxInfo().getId(), t); } t.add(oLine.getSubValue()); } // return dSuma; Collection<TicketTaxInfo> avalues = m.values(); return avalues.toArray(new TicketTaxInfo[avalues.size()]); }