COMP2396
Loading...
Searching...
No Matches
Product Class Reference
Collaboration diagram for Product:

Public Member Functions

 Product (String name, int price, int quantity)
 
String getName ()
 
int getPrice ()
 
int getQuantity ()
 
void setQuantity (int quantity)
 

Private Attributes

String name
 
int price
 
int quantity
 

Detailed Description

Definition at line 1 of file Product.java.

Constructor & Destructor Documentation

◆ Product()

Product.Product ( String name,
int price,
int quantity )
inline

Definition at line 7 of file Product.java.

7 {
8 this.name = name;
9 this.price = price;
10 this.quantity = quantity;
11 }
int price
Definition Product.java:4
String name
Definition Product.java:3
int quantity
Definition Product.java:5

References name, price, and quantity.

Member Function Documentation

◆ getName()

String Product.getName ( )
inline

Definition at line 16 of file Product.java.

16 {
17 return name;
18 }

References name.

Referenced by CmdCheckProductInfo.execute().

Here is the caller graph for this function:

◆ getPrice()

int Product.getPrice ( )
inline

Definition at line 20 of file Product.java.

20 {
21 return price;
22 }

References price.

Referenced by CmdCheckProductInfo.execute(), and CmdPurchase.execute().

Here is the caller graph for this function:

◆ getQuantity()

int Product.getQuantity ( )
inline

Definition at line 24 of file Product.java.

24 {
25 return quantity;
26 }

References quantity.

Referenced by VendingMachine.deductProductQuantity(), CmdCheckProductInfo.execute(), and CmdPurchase.execute().

Here is the caller graph for this function:

◆ setQuantity()

void Product.setQuantity ( int quantity)
inline

Definition at line 29 of file Product.java.

29 {
30 this.quantity = quantity;
31 }

References quantity.

Referenced by VendingMachine.deductProductQuantity().

Here is the caller graph for this function:

Member Data Documentation

◆ name

String Product.name
private

Definition at line 3 of file Product.java.

Referenced by Product(), and getName().

◆ price

int Product.price
private

Definition at line 4 of file Product.java.

Referenced by Product(), and getPrice().

◆ quantity

int Product.quantity
private

Definition at line 5 of file Product.java.

Referenced by Product(), getQuantity(), and setQuantity().


The documentation for this class was generated from the following file: