Back to project page DisposableIncome-OldJava.
The source code is released under:
MIT License
If you think the Android project DisposableIncome-OldJava listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package uk.co.wilka.disposableincome; /*w ww . j a v a2 s . c o m*/ import java.util.ArrayList; public class WithdrawalForMonthCalculator { private Cash totalActual; private Cash totalPredicted; // TODO: Unit test for this public WithdrawalForMonthCalculator(WithdrawDateComparer dateComparer, ArrayList<CashWithdraw> withdraws) { totalActual = Cash.fromPence(0); totalPredicted = Cash.fromPence(0); for (CashWithdraw withdraw : withdraws) { if(dateComparer.isThisMonth(withdraw)) { if(withdraw.getWithdrawType() == WithdrawType.Actual) { totalActual = totalActual.plus(withdraw.getAmount()); } if(withdraw.getWithdrawType() == WithdrawType.Predicted) { totalPredicted = totalPredicted.plus(withdraw.getAmount()); } } } } public Cash getTotalActual() { return totalActual; } public Cash getTotalPredicted() { return totalPredicted; } }