-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlaylist.java
More file actions
38 lines (34 loc) · 1.34 KB
/
Copy pathPlaylist.java
File metadata and controls
38 lines (34 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.mycompany.csc365p1;
import java.util.ArrayList;
/**
*
* @author seansponsler
*/
public class Playlist {
String playlistName;
String dateCreated;
ArrayList<Song> tracklist;
public Playlist(String name, ArrayList<Song> tracklist) {
this.playlistName = name;
this.tracklist = tracklist;
}
public String getPlaylistName() { return this.playlistName; }
public String getDateCreated() { return this.dateCreated; }
public ArrayList<Song> getTracklist() { return this.tracklist; }
public void setPlaylistName(String newName) { this.playlistName = newName; }
public void setDateCreated(String newDate) { this.dateCreated = newDate; }
public void setTracklist(ArrayList<Song> newTracklist) { this.tracklist = newTracklist; }
public void addSong(Song songToAdd) { this.tracklist.add(songToAdd); }
public void removeSong(Song songToRemove) {
if (this.tracklist.contains(songToRemove)) {
this.tracklist.remove(songToRemove);
}
else {
System.err.println("Tracklist does not contain song titled: " + songToRemove.getSongTitle());
}
}
}