public class ShopFilterer
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.List<Shop> |
filteredShops |
private java.util.List<Shop> |
shops |
private Position |
userPosition |
Constructor and Description |
---|
ShopFilterer(java.util.List<Shop> shops,
Position userPosition) |
Modifier and Type | Method and Description |
---|---|
private void |
filterShopByDistance(int distance)
Removes the shops that are farther than a given distance
|
java.util.List<Shop> |
filterShops(FilterData filterData)
Filters shops
|
private void |
filterShopsByDay(Day day)
Removes the shops that aren't open on a given day
|
private void |
filterShopsByName(java.lang.String name)
Removes the shops if their name don't match a given name (non case sensitive)
|
private void |
filterShopsByProducts(java.util.List<Product> productList)
Removes the shops that don't contains all the productList
|
private void |
filterShopsByTime(Time time)
Removes the shops that aren't open at the given time
|
private java.util.List<Shop> shops
private java.util.List<Shop> filteredShops
private Position userPosition
public java.util.List<Shop> filterShops(FilterData filterData)
filterData
- Contains all the information on which the shops are filteredprivate void filterShopByDistance(int distance)
distance
- The maximum distanceprivate void filterShopsByName(java.lang.String name)
name
- Name on which the shops are filteredprivate void filterShopsByDay(Day day)
day
- The day on which the shops must be openprivate void filterShopsByTime(Time time)
time
- The time at which the shops must be openprivate void filterShopsByProducts(java.util.List<Product> productList)
productList
- The list of products that need to be in the shop