import java.util.*; import java.io.Serializable; public class Album implements Serializable { private int id, duration; private Date date; private String title, artist; private ArrayList songs = new ArrayList(); public Album(int id, String title, int duration, String artist, Date date, ArrayList songs) { this.id=id; this.title=title; this.duration=this.getDuration(); this.artist=artist; this.date=date; this.songs=songs; } public int getId(){return id;} public String getTitle(){return title;} public int getDuration(){ for (Song s : songs) {duration+=s.getDuration();} //increase with each song's getDuration() return duration; } public String getArtist(){return artist;} public Date getDate(){return date;} public ArrayList getSongs(){return songs;} public void setId(){this.id=id;} public void setTitle(){this.title=title;} public void setArtist(){this.artist=artist;} public void setDate(){this.date=date;} }