+
+ static private class ConverterThread extends Thread {
+ private final List<TransactionWithAccounts> list;
+ private final MainModel model;
+ private final String accFilter;
+ public ConverterThread(@NonNull MainModel model,
+ @NonNull List<TransactionWithAccounts> list, String accFilter) {
+ this.model = model;
+ this.list = list;
+ this.accFilter = accFilter;
+ }
+ @Override
+ public void run() {
+ TransactionAccumulator accumulator = new TransactionAccumulator(accFilter, accFilter);
+
+ for (TransactionWithAccounts tr : list) {
+ if (isInterrupted()) {
+ Logger.debug(TAG, "ConverterThread bailing out on interrupt");
+ return;
+ }
+ accumulator.put(new LedgerTransaction(tr));
+ }
+
+ if (isInterrupted()) {
+ Logger.debug(TAG, "ConverterThread bailing out on interrupt");
+ return;
+ }
+
+ Logger.debug(TAG, "ConverterThread publishing results");
+
+ Misc.onMainThread(() -> accumulator.publishResults(model));
+ }
+ }