public class Inventory extends Object
Modifier and Type | Field and Description |
---|---|
(package private) Vector<Product> |
inventory |
Constructor and Description |
---|
Inventory() |
Modifier and Type | Method and Description |
---|---|
void |
addProduct(Product product) |
boolean |
contains(String productName)
Is the product contained in this inventory?
|
Inventory |
getCollectables()
Retrieve inventory items that are not for sale
|
Object[][] |
getCollectionArray() |
TreeMap<String,Integer> |
getMap()
Retrieves a tree map of all the items in this agent's inventory.
|
Product |
getProduct(Product product)
Retrieves the first instance of this product from the inventory Vector.
|
Product |
getProduct(String productName)
Retrieves the first instance of this product from the inventory Vector.
|
Vector<Product> |
getProducts() |
Inventory |
getSellables()
Retrieve inventory items that are for sale
|
Object[][] |
getSellablesArray() |
void |
removeProduct(Product product)
Removes the first instance of this product (by name only) from the inventory Vector
|
void |
setProducts(Vector<Product> products) |
void |
update(Product product)
Updates all instances of products that share the same name as the parameter passed
|
void |
update(Product product,
int index) |
public Object[][] getCollectionArray()
public Object[][] getSellablesArray()
public Inventory getSellables()
public Inventory getCollectables()
public void addProduct(Product product)
public void update(Product product, int index)
public void update(Product product)
product
- public void removeProduct(Product product)
product
- public Product getProduct(Product product)
product
- public Product getProduct(String productName)
productName
- public boolean contains(String productName)
productName
-