-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlayList.java
100 lines (89 loc) · 1.01 KB
/
PlayList.java
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/**
*@author: Henry Keena
*@version: 1.0
*@license: MIT
*/
import java.io.*;
import java.util.*;
/**
*
*/
public class PlayList implements Serializable
{
private String name;
private ArrayList<Song> list;
/**
*
* @param _name
*/
public PlayList(String _name)
{
name = _name;
list = new ArrayList<Song>();
}
/**
*
* @return
*/
public String getName()
{
return name;
}
/**
*
* @param _name
*/
public void setName(String _name)
{
name = _name;
}
/**
*
* @param song
*/
public void addSong(Song song)
{
list.add(song);
}
/**
*
* @param song
*/
public void removeSong(Song song)
{
list.remove(song);
}
/**
*
* @param x
* @return
*/
public Song getSong(int x)
{
return list.get(x);
}
/**
*
* @param x
* @return
*/
public int indexOf(Song x)
{
return list.indexOf(x);
}
/**
*
*/
public void clearPlayList()
{
list.clear();
}
/**
*
* @return
*/
public int getTrackCount()
{
return list.size();
}
}