123456789101112131415161718192021222324252627282930313233 |
-
- import java.util.*;
- public class Inventry
- {
- private ArrayList<Product> products;
- private int totalQuantity;
- public Inventry(ArrayList<Product> products){
- this.products = products;
- }
-
- public ArrayList<Product> getInventry(){
- return products;
- }
-
- public void addToInventry(Product product){
- products.add(product);
- totalQuantity += product.getQuantity();
- }
-
- public void removeFromInventry(Product product){
- products.remove(product);
- totalQuantity -= product.getQuantity();
- }
-
- public int getSize(){
- return products.size();
- }
-
- public int getTotalQuantity(){
- return totalQuantity;
- }
- }
|