public class Shop
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int |
id |
private java.lang.String |
name |
private Position |
position |
private Schedule |
schedule |
private java.util.Map<Product,Article> |
stock |
Constructor and Description |
---|
Shop(int id,
java.lang.String name,
Schedule schedule,
Position position)
Construct the Shop with an empty stock.
|
Shop(int id,
java.lang.String name,
Schedule schedule,
Position position,
java.util.Map<Product,Article> stock)
Construct the Shop given the ID (from the database).
|
Shop(java.lang.String name,
Schedule schedule,
Position position,
java.util.Map<Product,Article> stock)
Construct the Shop without a real ID (indicated by having ID=1).
|
Modifier and Type | Method and Description |
---|---|
void |
addToStock(Article article)
Adds an article to the stock
|
boolean |
equals(java.lang.Object o) |
java.util.List<DaySchedule> |
getDaySchedules() |
int |
getId() |
java.lang.String |
getName() |
Position |
getPosition() |
double |
getPriceOfList(GroceryList groceryList) |
double |
getProductPrice(Product product) |
java.util.Set<Product> |
getProducts() |
Schedule |
getSchedule() |
java.util.Map<Product,Article> |
getStock() |
int |
hashCode() |
boolean |
hasProduct(Product product) |
boolean |
sellAllProducts(java.util.List<Product> productsList) |
void |
setId(int id) |
void |
setName(java.lang.String name) |
void |
setSchedule(Schedule schedule) |
java.lang.String |
toString() |
private int id
private java.lang.String name
private Schedule schedule
private Position position
public Shop(int id, java.lang.String name, Schedule schedule, Position position, java.util.Map<Product,Article> stock)
id
- Unique ID of the shopname
- Name of the shopschedule
- Schedule of the shopposition
- The position (latitude, longitude)stock
- A list of articlespublic Shop(int id, java.lang.String name, Schedule schedule, Position position)
id
- ID of the shopname
- Name of the shopschedule
- Schedule of the shopposition
- The position (latitude, longitude)public Shop(java.lang.String name, Schedule schedule, Position position, java.util.Map<Product,Article> stock)
name
- Name of the shopschedule
- Schedule of the shopposition
- The position (latitude, longitude)stock
- A list of articlespublic int getId()
public void setId(int id)
public java.lang.String getName()
public void setName(java.lang.String name)
public Position getPosition()
public Schedule getSchedule()
public void setSchedule(Schedule schedule)
public java.util.Set<Product> getProducts()
public boolean sellAllProducts(java.util.List<Product> productsList)
productsList
- public double getPriceOfList(GroceryList groceryList)
groceryList
- public double getProductPrice(Product product)
public java.util.List<DaySchedule> getDaySchedules()
public void addToStock(Article article)
article
- public boolean hasProduct(Product product)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object