Package bookstore
Class CD
java.lang.Object
bookstore.CD
Represents a CD
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the value of the artist field.getName()Gets the value of the name fielddoublegetPrice()Gets the value of the price fieldintgetStock()Gets the value of the stock fieldvoidAssigns the given value to the artist 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
-
CD
Constructor for CD class- Parameters:
name- the name or title of the productartist- artist or band name as a Stringprice- the price of the productstock- the amount of this product currently in stock
-
-
Method Details
-
getArtist
Gets the value of the artist field.- Returns:
- the artist or band's name
-
setArtist
Assigns the given value to the artist field- Parameters:
artist- the artist or band's name
-
getName
Gets the value of the name field- Returns:
- the value of name
-
setName
Assigns the given value to the name field- Parameters:
name- the 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- the 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- the stock
-