1 package net.ktnx.mobileledger;
3 import java.util.ArrayList;
4 import java.util.Iterator;
7 class LedgerTransaction {
9 private String description;
10 private List<LedgerTransactionItem> items;
12 LedgerTransaction(String date, String description) {
14 this.description = description;
15 this.items = new ArrayList<LedgerTransactionItem>();
18 void add_item(LedgerTransactionItem item) {
22 public String getDate() {
26 public void setDate(String date) {
30 public String getDescription() {
34 public void setDescription(String description) {
35 this.description = description;
38 public Iterator<LedgerTransactionItem> getItemsIterator() {
39 return new Iterator<LedgerTransactionItem>() {
40 private int pointer = 0;
42 public boolean hasNext() {
43 return pointer < items.size();
47 public LedgerTransactionItem next() {
48 return hasNext() ? items.get(pointer++) : null;