at.tuwien.ifs.somtoolbox.apps.viewer.fileutils
Class PlayList

java.lang.Object
  extended by at.tuwien.ifs.somtoolbox.apps.viewer.fileutils.PlayList

public class PlayList
extends Object

Add songs to a .m3u playlist and write the playlist file to disk

Version:
$Id: PlayList.java 3586 2010-05-21 10:34:19Z mayer $
Author:
Robert Neumayer

Field Summary
private  File file
           
private  Vector<String> songs
           
 
Constructor Summary
PlayList(File file)
           
PlayList(String fileName)
           
 
Method Summary
 boolean addSong(String song)
          adds a song to the playlist
 void setSongs(Object[] sar)
          set the contents of an object array as playlist
 void writeToFile()
          write this playlist to the file specified in the constructor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

songs

private Vector<String> songs

file

private File file
Constructor Detail

PlayList

public PlayList(String fileName)

PlayList

public PlayList(File file)
Method Detail

addSong

public boolean addSong(String song)
adds a song to the playlist

Parameters:
song - - song to add
Returns:
- true if okay, false otherwise

setSongs

public void setSongs(Object[] sar)
set the contents of an object array as playlist

Parameters:
sar - - object array to be set as playlist (and casted to strings)

writeToFile

public void writeToFile()
write this playlist to the file specified in the constructor