Question
Program: SongList and MySong For this project, you will be creating a lists of songs, like a playlists in a music app. The song data
Program: SongList and MySong For this project, you will be creating a lists of songs, like a playlists in a music app. The song data will be obtained from an online dataset and accessed via the BRIDGES API. The dataset structure for the songs consists of the title, release_date, artist, album, and lyrics.
You are to write a class called MySong to hold information about songs.
The MySong class must implement the Comparable
You will be obtaining the song data to create MySongobjects using the BRIDGES API via the connect.DataSource and bridges.data_src_dependent.Songclasses.
You will store the MySong objects in a second class called SongList
The SongList class implements the custom List
You only need to implement the iteratormethod of the Iterable interface, you may leave the two default methods as they are provided.
A SongIterator class must be implemented as an inner class to the SongList
Each SongList must have a name and a linked chain of SLelement<MySong>objects
In addition to implementing the interfaces in MySong and SongList as previously described, the program is to:
Include a main method that will read song data from the BRIDGES song dataset.
Create an instance of the SongList class of SLElementobjects (http://bridgesuncc.github.io/doc/java-api/current/html/classbridges_1_1base_1_1_s_lelement.html) and populate the linked list with MySong objects created from the dataset.
Provide method that returns a formatted list of all the songs by an artist that appear on the linked list (name given as a String parameter to the method), in alphabetical order according to song title. The name of the method must be:
public String getSongsByArtist(String artist)
The returned String is to be formatted with each song on a separate line with the song title and album labeled as shown here:
Title: Harder, Better, Faster, Stronger Album: Discovery
If no songs by the given artist are on the playlist, the following message is to be displayed, There are no songs by Tai Verdes in this playlist. (substituting the relevant artists name for Tai Verdes).
It is expected that your program will be well documented and must contain a comment block at the beginning that includes the following information in an easy-to-read format: the file name, your name, the project number, the course identifier (CMSC 256), and the current semester, and a brief description of the files purpose.
Implement both files inside of a cmsc256 package. Submit the individual Java source code files to the Project 3 link in Gradescope. Do not compress the files, they should be submitted as a single submission of individual files.
/** * Debra Duke * Computer Science Department * College of Engineering * Virginia Commonwealth University */ package cmsc256; public interface List
* @return true if the target element is in this list * false otherwise */ public boolean contains(E target); /** * @return the element at the given position * @throws IllegalArgumentException if position is < 0 or > number of elements in the list */ public E getValue(int position);
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started