3 import interfaces
.collection
.AbstractCollection
;
4 import interfaces
.collection
.Collection
;
6 import java
.util
.ArrayList
;
7 import java
.util
.Iterator
;
12 public class CLIPlaylist
extends AbstractCollection
<CLITrack
> {
14 private final List
<CLITrack
> tracks
= new ArrayList
<CLITrack
>();
15 private final String name
;
17 private boolean root
= false;
18 private int parent
= 0;
19 private int specifiedSize
;
21 public CLIPlaylist(int id
, long persistent
, String name
) {
22 super(id
, persistent
);
26 public String
name() {
30 public void setRoot(boolean isRoot
) {
34 public boolean isRoot() {
38 public void setParent(int parent
) {
42 public Collection
<CLITrack
> parent() {
43 //TODO store parents in accessible place so they can be retrieved
47 public void specifySize(int size
) {
48 this.specifiedSize
= size
;
52 if (tracks
.size() == 0) return specifiedSize
;
53 else return tracks
.size();
56 public boolean hasNext() {
57 throw new RuntimeException("should not be called on cli");
60 public CLITrack
next() {
61 throw new RuntimeException("should not be called on cli");
64 public void add(CLITrack track
) {
68 public Iterable
<?
extends Track
> tracks() {
72 public Iterator
<CLITrack
> iterator() {
73 return tracks
.iterator();
76 public int editStatus() {
77 // TODO Auto-generated method stub