Mp3dings 
20100427

net.sourceforge.mp3dings.export
Class PLSExporter

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

public class PLSExporter
extends AbstractExporter
implements Serializable

Exports data as a PLS 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
PLSExporter()
          Creates a new PLSExporter with the encoding set to iso-latin (ISO-8859-1).
 
Method Summary
 String getBlock(int index, Map blockdata)
          Returns three lines making up one playlist entry.
 String getExtension()
          Returns the file extension for this exporter's target file type.
 String getFooter(int numEntries)
          Returns the the two-line footer for the playlist.
 String getHeader()
          Returns the single line header for the playlist.
 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

PLSExporter

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

Method Detail

getBlock

public String getBlock(int index,
                       Map blockdata)
Returns three lines making up one playlist entry.
      File[fIndex]=[filepath]
      Title[fIndex]=[artist] - [title]
      Length[fIndex]=[length]
 

Specified by:
getBlock in class AbstractExporter
Parameters:
index - the number of the record that is currently exported, starting at 1
blockdata - a map containing the record data
See Also:
AbstractExporter.export(Object[] keys, Object[][] data)

getHeader

public String getHeader()
Returns the single line header for the playlist.
      [playlist]
 

Specified by:
getHeader in class AbstractExporter

getFooter

public String getFooter(int numEntries)
Returns the the two-line footer for the playlist.

Specified by:
getFooter in class AbstractExporter
Parameters:
numEntries - the number of exported records
 NumberOfEntries=[numEntries]
 Version=2
 

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 "PLS playlist (*.pls)", 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 ".pls", 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, FILENAME, 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