|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectProduct
public class Product
Represents a product to be stored in a vending machine and purchased by a customer
| Constructor Summary | |
|---|---|
Product(java.lang.String productName,
int productPrice,
int productQuantity)
Constructs a new Product object |
|
| Method Summary | |
|---|---|
void |
decrementQuantity()
Reduces this Product's quantity count by one, if it is not zero |
java.lang.String |
dispenseProduct()
Returns a String representation of the dispensed form of this Product |
java.lang.String |
getName()
Returns the name of this Product |
int |
getPrice()
Returns the number of coins required to purchase this Product |
int |
getQuantity()
Returns the number of this Product in stock |
void |
increaseQuantity(int count)
Increases the stock quantity of this Product by a given amount |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Product(java.lang.String productName,
int productPrice,
int productQuantity)
productName - the name of this ProductproductPrice - the number of coins required to purchase this ProductproductQuantity - the number of this Product in stock| Method Detail |
|---|
public java.lang.String getName()
public int getPrice()
public int getQuantity()
public void increaseQuantity(int count)
count - the amount to increase this Products quantity bypublic void decrementQuantity()
public java.lang.String dispenseProduct()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||