Help me implement these in playlistImpl
The user needs to be able to:
* Create playlists
* Delete playlists
* Edit playlists
* play playlists
com.xxx.iopackage.inputstreams.mp3player.playlist.PlayList
com.xxx.iopackage.inputstreams.mp3player.playlist.PlayListImpl
PlayList.java
package com.xxx.iopackage.inputstreams.mp3player.playlist;
import java.io.File;
import java.util.LinkedHashSet;
/**
* Models a playlist of MP3. A Playlist is a group of mp3s which are played
* one after another.
*/
public interface PlayList {
/**
* Adds a mp3 to the playlist
*
* @param mp3
*/
public void addMp3( File mp3 );
/**
* Gets the Mp3 as a LinkedHashSet. A LinkedHashSet returns the elements
* in the order they were added to the LinkedHashSet
*
* @return list of Mp3 for this playlist
*/
public LinkedHashSet<File> getMp3PlayList();
/**
* Removes a mp3 from the playlist
*
* @param mp3 the mp3 to remove from the playlist
*/
public void removeFromPlayList( File mp3 );
/**
* Removes all mp3 from the playlist
*/
public void removeAllMp3FromPlaylist();
/**
* Sets the name of the mp3 playlist
*
* @param playListName the name of the playlist
*/
public void setName( String playListName );
/**
* Gets the name of the mp3 playlist
*
* @return the name of the mp3 playlist
*/
public String getPlayListName();
}
[U]PlayListImpl.java[/U]
package com.xxx.iopackage.inputstreams.mp3player.playlist;
import java.io.File;
import java.util.LinkedHashSet;
/**
* Class modelling a playlist of Mp3 tunes
*
*/
public class PlayListImpl implements PlayList {
/**
* Constructor
*/
public PlayListImpl() {
super();
}
/* (non-Javadoc)
* @see com.xxx.iopackage.inputstreams.mp3player.playlist.
* PlayList#addMp3(java.io.File)
*/
public void addMp3( File mp3 ) {
// YOU NEED TO IMPLEMENT THIS METHOD
}
/* (non-Javadoc)
* @see com.xxx.iopackage.inputstreams.mp3player.playlist.
* PlayList#getMp3PlayList()
*/
public LinkedHashSet<File> getMp3PlayList() {
// YOU NEED TO IMPLEMENT THIS METHOD
return null;
}
/* (non-Javadoc)
* @see com.xxx.iopackage.inputstreams.mp3player.playlist.
* PlayList#getPlayListName()
*/
public String getPlayListName() {
// YOU NEED TO IMPLEMENT THIS METHOD
return null;
}
/* (non-Javadoc)
* @see com.xxx.iopackage.inputstreams.mp3player.playlist.
* PlayList#removeAllMp3FromPlaylist()
*/
public void removeAllMp3FromPlaylist() {
// YOU NEED TO IMPLEMENT THIS METHOD
}
/* (non-Javadoc)
* @see com.xxx.iopackage.inputstreams.mp3player.playlist.
* PlayList#removeFromPlayList(java.io.File)
*/
public void removeFromPlayList( File mp3 ) {
// YOU NEED TO IMPLEMENT THIS METHOD
}
/* (non-Javadoc)
* @see com.xxx.iopackage.inputstreams.mp3player.playlist.
* PlayList#setName(java.lang.String)
*/
public void setName( String playListName ) {
// YOU NEED TO IMPLEMENT THIS METHOD
}
}