Package com.xffffff.wellfed.shoppingcart
Class ShoppingCartController
- java.lang.Object
-
- com.xffffff.wellfed.shoppingcart.ShoppingCartController
-
public class ShoppingCartController extends java.lang.Object
ShoppingCartIngredientController is a class that contains methods for interacting with the shopping cart
-
-
Constructor Summary
Constructors Constructor Description ShoppingCartController(android.app.Activity activity)
The constructor for the controller.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addIngredientToStorage(ShoppingCartIngredient shoppingCartIngredient, StorageIngredient storageIngredient)
addIngredientToStorage adds the given ingredient to the storage.void
generateShoppingCart()
generateShoppingCart generates the shopping cart from the given meal plan and storage ingredients.ShoppingCartIngredientAdapter
getAdapter()
Gets the adapter.void
getSearchResults(java.lang.String field)
getSearchResults returns the search results for the given query.void
setAdapter(ShoppingCartIngredientAdapter adapter)
Sets adapter to the given adapter.void
sortByField(java.lang.String field)
sortByField sorts the shopping cart by the given field.void
updateCheckedStatus(java.lang.String id, boolean isChecked)
-
-
-
Method Detail
-
getSearchResults
public void getSearchResults(java.lang.String field)
getSearchResults returns the search results for the given query.- Parameters:
field
- The field to search.
-
sortByField
public void sortByField(java.lang.String field)
sortByField sorts the shopping cart by the given field.- Parameters:
field
- The field to sort by.
-
getAdapter
public ShoppingCartIngredientAdapter getAdapter()
Gets the adapter.- Returns:
- the adapter
-
setAdapter
public void setAdapter(ShoppingCartIngredientAdapter adapter)
Sets adapter to the given adapter.- Parameters:
adapter
- the adapter to set
-
generateShoppingCart
public void generateShoppingCart()
generateShoppingCart generates the shopping cart from the given meal plan and storage ingredients.
-
updateCheckedStatus
public void updateCheckedStatus(java.lang.String id, boolean isChecked)
-
addIngredientToStorage
public void addIngredientToStorage(ShoppingCartIngredient shoppingCartIngredient, StorageIngredient storageIngredient)
addIngredientToStorage adds the given ingredient to the storage.- Parameters:
shoppingCartIngredient
- the ingredient to add.storageIngredient
- the storage ingredient to add.
-
-