|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectItem
public class Item
Represents a grocery item: stores item name, unit name, buying price, selling price, and stock
Constructor Summary | |
---|---|
Item(String aName,
String aUnitName,
double bPrice,
double sPrice)
Constructor for Item objects. |
Method Summary | |
---|---|
void |
addStock(int qty)
Increases stock for this item. |
double |
getBuyPrice()
Returns the buying price of the item |
int |
getCurrentStock()
Returns the current stock the item |
String |
getName()
Returns the name of the item |
double |
getSellPrice()
Returns the selling price of the item |
String |
getUnitName()
Returns unit name for the item |
void |
subtractStock(int qty)
Decreases stock for this item. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Item(String aName, String aUnitName, double bPrice, double sPrice)
aName
- name of the item (e.g., "Coke" )aUnitName
- name of unit for the item (e.g., "cans")bPrice
- buying pricesPrice
- selling priceMethod Detail |
---|
public void addStock(int qty)
qty
- increase stock by qtypublic double getBuyPrice()
public int getCurrentStock()
public String getName()
public double getSellPrice()
public String getUnitName()
public void subtractStock(int qty)
qty
- decrease stock by qty
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |