-
Notifications
You must be signed in to change notification settings - Fork 519
ListSortingRecipes
Demonstrates how to sort lists using Comparator Interface
Group Collection Recipes
See AccountShippingCountryComparator
See AccountNumberOfEmployeesComparator
Demonstrates how to sort a list of Account using Comparator Interface In this example we pass in the implementation class AccountShippingCountryComparator as a parameter to the sort method of a list. This method sorts Accounts by shipping address in ascending alphabetical order
| Param | Description |
|---|---|
accounts |
a list of accounts that will be sorted in place |
Demonstrates how to sort a list of Account using Comparator Interface In this example we pass in the implementation class AccountShippingCountryComparator as a parameter to the sort method of a list. This method sorts Accounts by shipping address in descending alphabetical order
| Param | Description |
|---|---|
accounts |
a list of accounts that will be sorted in place |
Demonstrates how to sort a list of Account using Comparator Interface In this example we pass in the implementation class AccountNumberOfEmployeesComparator as a parameter to the sort method of a list.This method sorts Accounts by employee number in the ascending order
| Param | Description |
|---|---|
accounts |
a list of accounts that will be sorted in place |