1234567891011121314151617181920212223242526272829303132333435 |
-
-
- /**
- * Created by leon on 1/10/18.
- */
- public class Product {
- private float price;
- private int quantity;
- final private String id;
-
- public Product(float price, int quantity, String id) {
- this.price = price;
- this.quantity = quantity;
- this.id = id;
- }
- public void setPrice(float newPrice) {
- this.price = newPrice;
- }
- public float getPrice() {
- return price;
- }
- public void addUnits(int numUnits) {
- quantity += numUnits;
- }
- public void removeUnits(int numUnits) {
- quantity -= numUnits;
- }
- public int getOnHandQuantity() {
- return quantity;
- }
- public String getID() {
- return id;
- }
- }
|