public class ShowResultController extends ControllerWithMenu
Modifier and Type | Field and Description |
---|---|
private java.util.List<Shop> |
allShops
All the shops contained in the database
|
private GroceryList |
groceryList
The grocery list that contains all the products that need to be sold by the shops
|
private ShowResultView |
view |
master
Constructor and Description |
---|
ShowResultController(ControllerMaster master,
GroceryList groceryList)
Class Constructor
|
Modifier and Type | Method and Description |
---|---|
private void |
computeResults()
Finds the shops with all the products of a grocery list.
|
private Shop[] |
findShopsWithAllProducts()
Finds all the shops that contain all the products of a grocery list
|
void |
goBackToGroceryList()
Go back to the groceryLists view from which we came from
|
private void |
showResultsInView(Shop[] shopsWithAllProducts,
java.util.List<java.lang.Double> pricesList,
java.util.List<java.lang.Double> distancesList,
java.util.List<java.lang.Double> autochefScores)
Tells the view to display the results.
|
onHelpViewStatusChanged, onLogout, onShowAllGroceryLists, onShowAllRecipes, onShowEditProfile, onShowHelp, onShowMap, setView
isHelpOpen
private GroceryList groceryList
private java.util.List<Shop> allShops
private ShowResultView view
public ShowResultController(ControllerMaster master, GroceryList groceryList)
master
- groceryList
- private Shop[] findShopsWithAllProducts()
private void computeResults()
private void showResultsInView(Shop[] shopsWithAllProducts, java.util.List<java.lang.Double> pricesList, java.util.List<java.lang.Double> distancesList, java.util.List<java.lang.Double> autochefScores)
shopsWithAllProducts
- pricesList
- distancesList
- autochefScores
- public void goBackToGroceryList()