Package com.xffffff.wellfed.storage
Class IngredientStorageController
- java.lang.Object
-
- com.xffffff.wellfed.storage.IngredientStorageController
-
public class IngredientStorageController extends java.lang.ObjectThe IngredientStorageController class is a controller for the IngredientStorageActivity.
-
-
Constructor Summary
Constructors Constructor Description IngredientStorageController(androidx.fragment.app.FragmentActivity activity)Creates ingredients list that represents an empty food storage.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddIngredient(StorageIngredient storageIngredient)Adds an StorageIngredient to adaptervoiddeleteIngredient(StorageIngredient storageIngredient)Deletes StorageIngredient from adapterStorageIngredientAdaptergetAdapter()Gets the adapter that is used to display the ingredients in the list view.voidgetSearchResults(java.lang.String field)Get the search results from the DBvoidgetSortedResults(java.lang.String field)Gets the DB of ingredients sorted by fieldvoidupdateIngredient(StorageIngredient storageIngredient)Update StorageIngredient in adapter
-
-
-
Method Detail
-
getAdapter
public StorageIngredientAdapter getAdapter()
Gets the adapter that is used to display the ingredients in the list view.- Returns:
- the adapter that is used to display the ingredients in the list view
-
deleteIngredient
public void deleteIngredient(StorageIngredient storageIngredient)
Deletes StorageIngredient from adapter- Parameters:
storageIngredient- the StorageIngredient object to delete
-
addIngredient
public void addIngredient(StorageIngredient storageIngredient)
Adds an StorageIngredient to adapter- Parameters:
storageIngredient- the StorageIngredient object to add
-
updateIngredient
public void updateIngredient(StorageIngredient storageIngredient)
Update StorageIngredient in adapter- Parameters:
storageIngredient- the StorageIngredient object to update
-
getSortedResults
public void getSortedResults(java.lang.String field)
Gets the DB of ingredients sorted by field- Parameters:
field- the field to sort by description | category | expiration
-
getSearchResults
public void getSearchResults(java.lang.String field)
Get the search results from the DB- Parameters:
field- the field to search by
-
-