* This file is part of MoLe.
* MoLe is free software: you can distribute it and/or modify it
* under the term of the GNU General Public License as published by
* This file is part of MoLe.
* MoLe is free software: you can distribute it and/or modify it
* under the term of the GNU General Public License as published by
import net.ktnx.mobileledger.model.LedgerTransaction;
import net.ktnx.mobileledger.model.TransactionListItem;
import net.ktnx.mobileledger.ui.MainModel;
import net.ktnx.mobileledger.utils.SimpleDate;
import java.util.ArrayList;
import net.ktnx.mobileledger.model.LedgerTransaction;
import net.ktnx.mobileledger.model.TransactionListItem;
import net.ktnx.mobileledger.ui.MainModel;
import net.ktnx.mobileledger.utils.SimpleDate;
import java.util.ArrayList;
public class TransactionAccumulator {
private final ArrayList<TransactionListItem> list = new ArrayList<>();
private final MainModel model;
public class TransactionAccumulator {
private final ArrayList<TransactionListItem> list = new ArrayList<>();
private final MainModel model;
+
+ boldAccountName = model.getAccountFilter()
+ .getValue();
+
+ list.add(new TransactionListItem()); // head item
+ }
+ public void put(LedgerTransaction transaction) {
+ put(transaction, transaction.getDate());
}
public void put(LedgerTransaction transaction, SimpleDate date) {
if (done)
throw new IllegalStateException("Can't put new items after done()");
// first item
}
public void put(LedgerTransaction transaction, SimpleDate date) {
if (done)
throw new IllegalStateException("Can't put new items after done()");
// first item
boolean showMonth = date.month != lastDate.month || date.year != lastDate.year;
list.add(new TransactionListItem(date, showMonth));
}
boolean showMonth = date.month != lastDate.month || date.year != lastDate.year;
list.add(new TransactionListItem(date, showMonth));
}