git-svn-id: https://stereo.googlecode.com/svn/trunk@440 c67ee986-0855-0410-825f-15918...
[stereo.git] / DACPlib / test / test / Playlist.java
blobff7ef90ed7c63ab2c3bce8ae33c61dd504ca0cd7
1 package test;
3 import interfaces.Track;
4 import interfaces.collection.AbstractCollection;
5 import interfaces.collection.Collection;
6 import interfaces.collection.EditableCollection;
7 import interfaces.collection.Source;
9 public class Playlist extends AbstractCollection<Track> implements EditableCollection<Track> {
11 public static class PlaylistFactory implements api.nodes.PlaylistNode.PlaylistFactory {
12 public EditableCollection<? extends Track> create(int id, long pid) {
13 return new Playlist(id, pid);
17 private int editStatus;
18 private String name;
19 private Playlist parent;
20 private boolean root;
21 private int size;
23 public Playlist(int id, long persistentId, int editStatus, String name, int parent, boolean root, int size) {
24 super(id, persistentId);
26 this.editStatus = editStatus;
27 this.name = name;
28 this.parent = new Playlist(parent, parent);
29 this.root = root;
30 this.size = size;
33 public Playlist(int id, long persistentId) {
34 super(id, persistentId);
37 public int editStatus() {
38 return editStatus;
41 public boolean isRoot() {
42 return root;
45 public String name() {
46 return name;
49 public int size() {
50 return size;
53 public Collection<? extends Track> parent() {
54 return parent;
57 public void setEditStatus(int editStatus) {
58 this.editStatus = editStatus;
61 public void setName(String name) {
62 this.name = name;
65 public void setParentId(int parentId) {
66 this.parent = new Playlist(parentId, parentId);
69 public void setRoot(boolean root) {
70 this.root = root;
73 public void setSize(int size) {
74 this.size = size;
77 public Source<Track> source() {
78 // TODO Auto-generated method stub
79 return null;