Mp3dings 
20100427

net.sourceforge.mp3dings.export
Class M3uExporter

java.lang.Object
  extended by net.sourceforge.mp3dings.export.AbstractExporter
      extended by net.sourceforge.mp3dings.export.M3uExporter
All Implemented Interfaces:
Serializable, Exporter

public class M3uExporter
extends AbstractExporter
implements Serializable

Exports data as an M3u playlist.

Version:
$Revision: 115 $ ($Date: 2007-11-06 00:46:25 +0100 (Di, 06 Nov 2007) $)
Author:
Moritz Ringler
See Also:
Serialized Form

Constructor Summary
M3uExporter()
          Creates a new M3UExporter with the encoding set to iso-latin (ISO-8859-1).
 
Method Summary
 String getBlock(int fileIndex, Map blockdata)
          Returns two lines making up one playlist entry.
 String getExtension()
          Returns the file extension for this exporter's target file type.
 String getFooter(int numEntries)
          Returns an empty string.
 String getHeader()
          Returns the single line header.
 String getName()
          Returns a string description of this exporter's target file type.
 void setKeys(Object[] headerKeys, Object[] blockKeys, Object[] footerKeys)
          Overriden to do nothing.
 
Methods inherited from class net.sourceforge.mp3dings.export.AbstractExporter
export, export, getBlockKeys, getFileFallback, getFileFilter, getFooterData, getFooterKeys, getHeaderData, getHeaderKeys, getImplementations, getKeys, getNumberOfEntries, setEncoding, setFileFallback, setFooterData, setHeaderData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

M3uExporter

public M3uExporter()
Creates a new M3UExporter with the encoding set to iso-latin (ISO-8859-1).

Method Detail

getBlock

public String getBlock(int fileIndex,
                       Map blockdata)
Returns two lines making up one playlist entry.
      #EXTINF: [length],[artist] - [title]
[filepath]

Specified by:
getBlock in class AbstractExporter
Parameters:
fileIndex - ignored
blockdata - a map containing the record data
See Also:
AbstractExporter.export(Object[] keys, Object[][] data)

getHeader

public String getHeader()
Returns the single line header.
      #ExtM3U
 

Specified by:
getHeader in class AbstractExporter

getFooter

public String getFooter(int numEntries)
Returns an empty string.

Specified by:
getFooter in class AbstractExporter

getName

public String getName()
Returns a string description of this exporter's target file type.

Specified by:
getName in interface Exporter
Specified by:
getName in class AbstractExporter
Returns:
the name of the target file type. Currently this is "M3u playlist (*.m3u)", but this may change in future versions.

getExtension

public String getExtension()
Returns the file extension for this exporter's target file type.

Overrides:
getExtension in class AbstractExporter
Returns:
a file extension including the leading dot. Currently this is ".m3u", but this may change in future versions.

setKeys

public void setKeys(Object[] headerKeys,
                    Object[] blockKeys,
                    Object[] footerKeys)
Overriden to do nothing. This exporter uses no fields for the header and footer and ARTIST, TITLE, FULLPATH, and LENGTH as blockKeys.

Overrides:
setKeys in class AbstractExporter
Parameters:
headerKeys - the fields for the header
blockKeys - the fields for the main section
footerKeys - the fields for the footer
See Also:
AbstractExporter.getKeys()

Mp3dings 
20100427