OnJava8-Examples/gui/flex/SongService.java
2015-04-20 15:36:01 -07:00

23 lines
793 B
Java

//: gui/flex/SongService.java
package gui.flex;
import java.util.*;
public class SongService {
private List<Song> songs = new ArrayList<Song>();
public SongService() { fillTestData(); }
public List<Song> getSongs() { return songs; }
public void addSong(Song song) { songs.add(song); }
public void removeSong(Song song) { songs.remove(song); }
private void fillTestData() {
addSong(new Song("Chocolate", "Snow Patrol",
"Final Straw", "sp-final-straw.jpg",
"chocolate.mp3"));
addSong(new Song("Concerto No. 2 in E", "Hilary Hahn",
"Bach: Violin Concertos", "hahn.jpg",
"bachviolin2.mp3"));
addSong(new Song("'Round Midnight", "Wes Montgomery",
"The Artistry of Wes Montgomery",
"wesmontgomery.jpg", "roundmidnight.mp3"));
}
} ///:~