Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public List<Deposit> getDeposits() {
- List<Deposit> deposits = new LinkedList<Deposit>();
- Iterator<Operation> it = movements.iterator();
- while (it.hasNext()) {
- Operation o = it.next();
- if (d instanceof Deposit) {
- deposits.add(d);
- }
- }
- Collections.sort(deposits, new Comparator<Deposit>() {
- public int compare(Deposit a, Deposit b) { //errore
- return (int) (b.getImport() - a.getImport());
- }
- });
- return deposits;
- }
- public List<Withdrawal> getWithdrawals() {
- List<Withdrawal> withdrawals = new LinkedList<Withdrawal>();
- Iterator<Operation> it = movements.iterator();
- while (it.hasNext()) {
- Operation o = it.next();
- if (w instanceof Withdrawal) {
- withdrawals.add(w);
- }
- }
- Collections.sort(withdrawals, new Comparator<Withdrawal>() {
- public int compare(Withdrawal a, Withdrawal b) { //errore
- return (int) (b.getImport() - a.getImport());
- }
- });
- return withdrawals;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement