JAVA CSV to Hash Map update rating when adding a new entry

Totally new at coding. Having a really tough time on the following assignment. This is the first task, and I cannot go on to finish the other three tasks until I master this one:

I need to return a hash map of YouTubeID's to Song objects containing all the information from a csv file. I am provided a filename for a csv file containing song ratings. Each line of these files will include: YouTubeID,artist,songName,rating. The YouTubeID is to be the key in the hashmap, the values will be Song objects containing the information for each file. The Song object is (String, String, String)

When a song has multiple ratings in the file I cannot just add the original song a second time, or it will over write the first instance. I only want to add another rating to the existing song entry in the map. We are given an addRating method that is supposed to help:

public void addRating(int rating){
this.ratings.add(rating);

I am having difficulty with the part where I add the song to the map without overwriting and only add the rating. I know I need to do something with the "Song" object but I have no idea what. The code I have thus far is:

public HashMap<String, Song> readCSVFile(String filename){
HashMap<String,Song> songs = new HashMap<String,Song>();

try{
for(String line : Files.readAllLines(Paths.get(filename))){
String allValues = line;
String[] data = allValues.split(",");


}}


catch (IOException ex){
ex.printStackTrace();
}
return (songs);
}
Amanda JohnsonAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CEHJCommented:
The Song object is (String, String, String)
I'm wondering why the last parameter (presumably 'rating') is of type String, when addRating takes an int?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.