com.vwp.sound.mod.modplay
Class PlayList

java.lang.Object
  extended by com.vwp.sound.mod.modplay.PlayList
All Implemented Interfaces:
Iterator

public class PlayList
extends Object
implements Iterator

A list of module names to be played

Author:
torkjel

Constructor Summary
PlayList(String fileName)
          makes a playlist from a file containing filenames seperated by newlines
PlayList(String[] modules)
          makes a playlist containing several modules
 
Method Summary
 int getNumberOfFileNames()
           
 String getPlayListName()
           
 String getRandomFileName()
           
 boolean hasNext()
           
 Object next()
           
 String nextFileName()
           
 void remove()
          removes the current module from the playlist
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlayList

public PlayList(String fileName)
         throws IOException
makes a playlist from a file containing filenames seperated by newlines

Parameters:
fileName - the name of a module
Throws:
IOException

PlayList

public PlayList(String[] modules)
         throws IOException
makes a playlist containing several modules

Parameters:
modules -
Throws:
IOException
Method Detail

getPlayListName

public String getPlayListName()

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator
Returns:
true if there are more modulenames in the list

next

public Object next()
Specified by:
next in interface Iterator
Returns:
the next file name in the playlist.

nextFileName

public String nextFileName()
Returns:
the next file name in the playlist.

remove

public void remove()
removes the current module from the playlist

Specified by:
remove in interface Iterator

getNumberOfFileNames

public int getNumberOfFileNames()
Returns:
the number of files in the playlist

getRandomFileName

public String getRandomFileName()
Returns:
a random file name from the playlist. This also changes the position in the playlist