Question: Package mediaRentalManager Interface MediaRentalManagerInt public interface MediaRentalManagerInt Interface that defines the functionality expected from the media rental manager. The two possible media we can have

Package mediaRentalManager
Interface MediaRentalManagerInt
public interface MediaRentalManagerInt
Interface that defines the functionality expected from the media rental manager. The two possible media we can have are movies and music albums. A movie has a title, a number of copies that are available for rent, and a rating (e.g.,"PG"). An album has a title, a number of copies, an artist, and a list of songs (String with title of songs separated by commas).
IMPORTANT:The database of the media rental manager, must define and use two ArrayList. One stores the media (both Movies and Album information) and one stores Customer information. You will lose significant credit if you do not define and use these ArrayList objects.
Author:
cmsc131
Method Summary
All MethodsInstance MethodsAbstract Methods
Modifier and Type Method Description
void addAlbum(java.lang.String title, int copiesAvailable, java.lang.String artist, java.lang.String songs)
Adds the specified album to the database.
void addCustomer(java.lang.String name, java.lang.String address, java.lang.String plan)
Adds the specified customer to the database.
void addMovie(java.lang.String title, int copiesAvailable, java.lang.String rating)
Adds the specified movie to the database.
boolean addToQueue(java.lang.String customerName, java.lang.String mediaTitle)
Adds the specified media title to the queue associated with a customer.
java.lang.String getAllCustomersInfo()
Returns information about the customers in the database.
java.lang.String getAllMediaInfo()
Returns information about all the media (movies and albums) that are part of the database.
java.lang.String processRequests()
Processes the requests queue of each customer.
boolean removeFromQueue(java.lang.String customerName, java.lang.String mediaTitle)
Removes the specified media title from the customer's queue.
boolean returnMedia(java.lang.String customerName, java.lang.String mediaTitle)
This is how a customer returns a rented media.
java.util.ArrayList searchMedia(java.lang.String title, java.lang.String rating, java.lang.String artist, java.lang.String songs)
Returns a SORTED ArrayList with media titles that satisfy the provided parameter values.
void setLimitedPlanLimit(int value)
This set the number of media associated with the LIMITED plan.
Method Details
addCustomer
void addCustomer(java.lang.String name,
java.lang.String address,
java.lang.String plan)
Adds the specified customer to the database. The address is a physical address (not e-mail). The plan options available are: LIMITED and UNLIMITED. LIMITED defines a default maximum of two media that can be rented.
Parameters:
name -
address -
plan -
addMovie
void addMovie(java.lang.String title,
int copiesAvailable,
java.lang.String rating)
Adds the specified movie to the database. The possible values for rating are "PG","R","NR".
Parameters:
title -
copiesAvailable -
rating -
addAlbum
void addAlbum(java.lang.String title,
int copiesAvailable,
java.lang.String artist,
java.lang.String songs)
Adds the specified album to the database. The songs String includes a list of the title of songs in the album (song titles are separated by commas).
Parameters:
title -
copiesAvailable -
artist -
songs -
setLimitedPlanLimit
void setLimitedPlanLimit(int value)
This set the number of media associated with the LIMITED plan.
Parameters:
value -
getAllCustomersInfo
java.lang.String getAllCustomersInfo()
Returns information about the customers in the database. The information is presented sorted by customer name. See the public tests for the format to use.
Returns:
getAllMediaInfo
java.lang.String getAllMediaInfo()
Returns information about all the media (movies and albums) that are part of the database. The information is presented sorted by media title. See the public tests for the format to use.
Returns:
addToQueue
boolean addToQueue(java.lang.String customerName,
java.lang.String mediaTitle)
Adds the specified media title to the queue associated with a customer.
Parameters:
customerName -
mediaTitle -
Returns:
false if the mediaTitle is already part of the queue (it will not be added)
removeFromQueue
boolean removeFromQueue(java.lang.String customerName,
java.lang.String mediaTitle)
Removes the specified media title from the customer's queue.
Parameters:
customerName -
mediaTitle -
Returns:
false if removal failed for any reason (e.g., customerName not found)
processRequests
java.lang.String processRequests()
Processes the requests queue of each customer. The customers will be processed in alphabetical order. For each customer, the requests queue will be checked and media will be added to the rented queue, if the plan associated with the customer allows it, and if there is a copy of the media available. For UNLIMITED plans the media will be added to the rented queue always, as long as there are copies associated
You must define a class named MediaRentalManager (we did not provide it) that implements the MediaRentalManagerInt in
Package mediaRentalManager Interface

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!