Package bookstore
Class DVD
java.lang.Object
bookstore.DVD
Represents a DVD
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the value of the categorygetName()Gets the value of the name fielddoublegetPrice()Gets the value of the price fieldintgetStock()Gets the value of the stock fieldvoidsetCategory(String category) Assigns the given value to the category fieldvoidAssigns the given value to the name fieldvoidsetPrice(double price) Assigns the given value to the price fieldvoidsetStock(int stock) Assigns the given value to the stock field
-
Constructor Details
-
DVD
Constructor for DVD class- Parameters:
name- the title of this DVDcategory- the category of this DVDprice- the price of this DVDstock- the amount of this item in stock
-
-
Method Details
-
getCategory
Gets the value of the category- Returns:
- the value of category
-
setCategory
Assigns the given value to the category field- Parameters:
category- new value for category
-
getName
Gets the value of the name field- Returns:
- the value of name
-
setName
Assigns the given value to the name field- Parameters:
name- new value for name
-
getPrice
public double getPrice()Gets the value of the price field- Returns:
- the value of price
-
setPrice
public void setPrice(double price) Assigns the given value to the price field- Parameters:
price- new value for price
-
getStock
public int getStock()Gets the value of the stock field- Returns:
- the value of stock
-
setStock
public void setStock(int stock) Assigns the given value to the stock field- Parameters:
stock- new value for stock
-