void sortTransactionByDate() { List<Transaction> tr = new ArrayList<Transaction>(transactions.values()); tr.sort(Transaction.DateComparator); for (Transaction t : tr) { t.displayTransaction(); } }
void sortbyAccount() { List<Accounts> ac = new ArrayList<Accounts>(accounts.values()); ac.sort(Accounts.AccountComparator); for (Accounts a : ac) { a.dispaly(); } }
void sortAccountByType() { List<Accounts> ac = new ArrayList<Accounts>(accounts.values()); ac.sort(Accounts.TypeComparator); ac.stream() .forEach( (a) -> { a.dispaly(); }); }
void sortAccountByCustomer() { List<Customer> cl = new ArrayList<Customer>(customers.values()); cl.sort(Customer.CustomerComparatorByName); for (Customer c : cl) { System.out.println("Customer Name: " + c.CustomerName); Accounts a = accounts.get(c.AccountId); a.dispaly(); } }