com.vwp.sound.mod.modplay
Class PlayList

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

public class PlayList
extends java.lang.Object
implements java.util.Iterator

A list of module names to be played


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

Constructor Detail

PlayList

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

Parameters:
fileName - the name of a module
Throws:
java.io.IOException

PlayList

public PlayList(java.lang.String[] modules)
         throws java.io.IOException
makes a playlist containing several modules

Parameters:
modules -
Throws:
java.io.IOException
Method Detail

getPlayListName

public java.lang.String getPlayListName()

hasNext

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

next

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

nextFileName

public java.lang.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 java.util.Iterator

getNumberOfFileNames

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

getRandomFileName

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