org.swhite.daap
Class Playlists

java.lang.Object
  extended byorg.swhite.daap.Playlists

public class Playlists
extends java.lang.Object

Created on Tuesday May 20, 2003

Author:
Steve White

Constructor Summary
Playlists(byte[] data)
          Contructs a new Playlists with the specified daap data.
Playlists(java.lang.String hostname, int databaseNumber, int sessionID)
          Constructs a new Playlists with a default port of 3689 and a default set of metadata
Playlists(java.lang.String hostname, int port, int databaseNumber, int sessionID)
          Constructs a new Playlists with a default set of metadata
Playlists(java.lang.String hostname, int port, int databaseNumber, int sessionID, java.lang.String metadata)
          Constructs a new Playlists
Playlists(java.lang.String hostname, int databaseNumber, int sessionID, java.lang.String metadata)
          Constructs a new Playlists with a default port of 3689
Playlists(java.net.URL url)
          Constructs a new Playlists with the data from the specified URL.
 
Method Summary
 Playlist getPlaylistAtIndex(int index)
          Returns the plalist at the specified index
 java.util.ArrayList getPlaylists()
          Returns an ArrayList of all playlists
 int getPlaylistsCount()
          Returns the number of playlists
 int getUpdateType()
          Returns the update type (daap tag muty)
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Playlists

public Playlists(byte[] data)
          throws ParserException
Contructs a new Playlists with the specified daap data.

Parameters:
data - Raw daap data

Playlists

public Playlists(java.net.URL url)
          throws java.io.IOException,
                 java.net.MalformedURLException,
                 ParserException
Constructs a new Playlists with the data from the specified URL.

Parameters:
url - URL containing the Playlists, e.g. http://localhost:3689/databases/@@databasenumber@@/containers?meta=@@metadata@@&session-id=@session-id@@

Playlists

public Playlists(java.lang.String hostname,
                 int databaseNumber,
                 int sessionID)
          throws java.io.IOException,
                 java.net.MalformedURLException,
                 ParserException
Constructs a new Playlists with a default port of 3689 and a default set of metadata

Parameters:
hostname - The hostname of the daap server
databaseNumber - The Item ID from a Database
sessionID - The Session ID from LoginResponse

Playlists

public Playlists(java.lang.String hostname,
                 int port,
                 int databaseNumber,
                 int sessionID)
          throws java.io.IOException,
                 java.net.MalformedURLException,
                 ParserException
Constructs a new Playlists with a default set of metadata

Parameters:
hostname - The hostname of the daap server
port - The port number the daap server is listening on
databaseNumber - The Item ID from a Database
sessionID - The Session ID from LoginResponse

Playlists

public Playlists(java.lang.String hostname,
                 int databaseNumber,
                 int sessionID,
                 java.lang.String metadata)
          throws java.io.IOException,
                 java.net.MalformedURLException,
                 ParserException
Constructs a new Playlists with a default port of 3689

Parameters:
hostname - The hostname of the daap server
databaseNumber - The Item ID from a Database
sessionID - The Session ID from LoginResponse
metadata - The Playlist metadata to download

Playlists

public Playlists(java.lang.String hostname,
                 int port,
                 int databaseNumber,
                 int sessionID,
                 java.lang.String metadata)
          throws java.io.IOException,
                 java.net.MalformedURLException,
                 ParserException
Constructs a new Playlists

Parameters:
hostname - The hostname of the daap server
port - The port number the daap server is listening on
databaseNumber - The Item ID from a Database
sessionID - The Session ID from LoginResponse
metadata - The Playlist metadata to download
Method Detail

getUpdateType

public int getUpdateType()
Returns the update type (daap tag muty)

Returns:
int

getPlaylistsCount

public int getPlaylistsCount()
Returns the number of playlists

Returns:
int

getPlaylistAtIndex

public Playlist getPlaylistAtIndex(int index)
Returns the plalist at the specified index

Parameters:
index - index of the playlist
Returns:
Playlist

getPlaylists

public java.util.ArrayList getPlaylists()
Returns an ArrayList of all playlists

Returns:
ArrayList

toString

public java.lang.String toString()