org.swhite.daap
Class Songs

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

public class Songs
extends java.lang.Object

Created on Tuesday May 20, 2003

Author:
Steve White

Field Summary
 java.util.ArrayList songs
           
 
Constructor Summary
Songs(byte[] data)
          Constructs a new Songs with the specified daap data.
Songs(java.lang.String hostname, int databaseNumber, int sessionID, int revisionNumber)
          Constructs a new Songs.
Songs(java.lang.String hostname, int port, int databaseNumber, int sessionID, int revisionNumber)
          Constructs a new Songs.
Songs(java.lang.String hostname, int port, int databaseNumber, int sessionID, int revisionNumber, java.lang.String metadata)
          Constructs a new Songs.
Songs(java.lang.String hostname, int databaseNumber, int sessionID, int revisionNumber, java.lang.String metadata)
          Constructs a new Songs.
Songs(java.net.URL url)
          Constructs a new Songs with the data from the specified URL.
 
Method Summary
 Song getSongAtIndex(int index)
          Returns Song at the specified index
 java.util.ArrayList getSongs()
          Returns an ArrayList of all of the songs
 int getSongsCount()
          Returns the number of Songs
 byte 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
 

Field Detail

songs

public java.util.ArrayList songs
Constructor Detail

Songs

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

Parameters:
data - Raw daap data

Songs

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

Parameters:
url - URL containing the Songs response, e.g.: http://localhost:3689/databases/@@database-number@@/items?type=music&meta=dmap.itemid, dmap.itemkind, dmap.persistentid, daap.songformat, dmap.itemname, daap.songartist, daap.songalbum, daap.songgenre, daap.songsize, daap.songdescription &session-id=@session-id@@ &revision-number=@@revision-number@@

Songs

public Songs(java.lang.String hostname,
             int databaseNumber,
             int sessionID,
             int revisionNumber)
      throws java.io.IOException,
             java.net.MalformedURLException,
             ParserException
Constructs a new Songs. Uses 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
revisionNumber - The Server Revision from UpdateResponse

Songs

public Songs(java.lang.String hostname,
             int port,
             int databaseNumber,
             int sessionID,
             int revisionNumber)
      throws java.io.IOException,
             java.net.MalformedURLException,
             ParserException
Constructs a new Songs. Uses 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
revisionNumber - The Server Revision from UpdateResponse

Songs

public Songs(java.lang.String hostname,
             int databaseNumber,
             int sessionID,
             int revisionNumber,
             java.lang.String metadata)
      throws java.io.IOException,
             java.net.MalformedURLException,
             ParserException
Constructs a new Songs. Uses 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
revisionNumber - The Server Revision from UpdateResponse
metadata - The Song metadata to download

Songs

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

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
revisionNumber - The Server Revision from UpdateResponse
metadata - The Song metadata to download
Method Detail

getUpdateType

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

Returns:
byte

getSongAtIndex

public Song getSongAtIndex(int index)
Returns Song at the specified index

Parameters:
index - index of the Song
Returns:
Song

getSongsCount

public int getSongsCount()
Returns the number of Songs

Returns:
int

getSongs

public java.util.ArrayList getSongs()
Returns an ArrayList of all of the songs

Returns:
ArrayList

toString

public java.lang.String toString()