de.axelwernicke.mypod
Class Playlist

java.lang.Object
  extended byde.axelwernicke.mypod.Playlist
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AutoPlaylist

public class Playlist
extends java.lang.Object
implements java.io.Serializable

This class represents a playlist within myPod. A playlist is a vector of clip oid's plus some further information like a name, the total playtime...

Author:
axel wernicke
See Also:
Serialized Form

Constructor Summary
Playlist()
          Creates a new instance of Playlist
Playlist(java.lang.String _name)
          Creates a new instance of Playlist
Playlist(java.lang.String name, java.util.Vector oids)
          Creates a new playlist from the name given, and adds clips to it
 
Method Summary
 void addClip(java.lang.Long oid)
          Adds a clip to the playlist and corrects the total time.
 void addClips(java.util.Vector oids)
          Adds a clip to the playlist and corrects the total time.
 boolean containsClip(java.lang.Long oid)
          tue, if the playlist contains the clip specified by the oid.
 java.util.Vector getAllClips()
          Gets all clips from the playlist.
 java.lang.Long getClipAt(int index)
          gets the oid for a clip from this playlist.
 java.util.Vector getList()
          Getter for property list.
 java.lang.String getName()
          gets the name of a playlist
 int getTotalClips()
          gets the total count of clips in this playlist.
 long getTotalFilesize()
          Getter for property totalFilesize.
 int getTotalTime()
          gets the total playtime for the playlist.
 boolean isAutoplaylist()
          true, if the current playlist is of type AutoPlaylist.
 boolean isIPodSync()
          Gets the sync to iPod flag for this playlist
 void remove(java.lang.Long oid)
          Removes an item from the playlist, and corrects the total time of the playlist.
 void remove(java.util.Vector oids)
          Removes clips from the playlist
 void replaceClips(Playlist srcPlaylist)
           
 void setIPodSync(boolean value)
          Sets playlists iPod sync flag.
 void setList(java.util.Vector list)
          Setter for property list.
 void setName(java.lang.String _name)
          sets the name of the playlist.
 void setTotalFilesize(long totalFilesize)
          Setter for property totalFilesize.
 void setTotalTime(int totalTime)
          Setter for property totalTime.
 java.lang.String toString()
          creates a string representation of a playlist.
 void validateTotalFilesize()
          Recalculates the total filesize of the clips in the playlist
 void validateTotalTime()
          Recalculates the total time of the playlist
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Playlist

public Playlist()
Creates a new instance of Playlist


Playlist

public Playlist(java.lang.String _name)
Creates a new instance of Playlist

Parameters:
_name - name of the new playlist

Playlist

public Playlist(java.lang.String name,
                java.util.Vector oids)
Creates a new playlist from the name given, and adds clips to it

Parameters:
name - of the new playlist
oids - list of clips to put into the new playlist
Method Detail

remove

public void remove(java.util.Vector oids)
Removes clips from the playlist

Parameters:
oids - of the clips to remove from the playlist

remove

public void remove(java.lang.Long oid)
Removes an item from the playlist, and corrects the total time of the playlist.

Parameters:
oid - of the item to remove

setName

public void setName(java.lang.String _name)
sets the name of the playlist.

Parameters:
_name - the new name of the playlist

getName

public java.lang.String getName()
gets the name of a playlist

Returns:
name of playlist

toString

public java.lang.String toString()
creates a string representation of a playlist.

Returns:
string representing the playlist

setTotalTime

public void setTotalTime(int totalTime)
Setter for property totalTime.

Parameters:
totalTime - New value of property totalTime.

getTotalTime

public int getTotalTime()
gets the total playtime for the playlist.

Returns:
the total playtime

getTotalClips

public int getTotalClips()
gets the total count of clips in this playlist.

Returns:
total count of clips in this playlist

containsClip

public boolean containsClip(java.lang.Long oid)
tue, if the playlist contains the clip specified by the oid.

Parameters:
oid - clip to search for in the playlist
Returns:
tue, if the playlist contains the clip specified by the oid.

addClip

public void addClip(java.lang.Long oid)
Adds a clip to the playlist and corrects the total time.

Parameters:
oid - oid of the clip to add

addClips

public void addClips(java.util.Vector oids)
Adds a clip to the playlist and corrects the total time.

Parameters:
oids - of the clips to add

getClipAt

public java.lang.Long getClipAt(int index)
gets the oid for a clip from this playlist.

Parameters:
index - position of the clip
Returns:
oid of the clip

isAutoplaylist

public boolean isAutoplaylist()
true, if the current playlist is of type AutoPlaylist.

Returns:
true, if the current playlist is of type AutoPlaylist.

setIPodSync

public void setIPodSync(boolean value)
Sets playlists iPod sync flag.

Parameters:
value - true to enable synchronization to iPod

isIPodSync

public boolean isIPodSync()
Gets the sync to iPod flag for this playlist

Returns:
true, if the playlist is synchronized to iPod

getAllClips

public java.util.Vector getAllClips()
Gets all clips from the playlist.

Returns:
vector containing the oids of all clips

getList

public java.util.Vector getList()
Getter for property list.

Returns:
Value of property list.

setList

public void setList(java.util.Vector list)
Setter for property list.

Parameters:
list - New value of property list.

validateTotalTime

public void validateTotalTime()
Recalculates the total time of the playlist


validateTotalFilesize

public void validateTotalFilesize()
Recalculates the total filesize of the clips in the playlist


getTotalFilesize

public long getTotalFilesize()
Getter for property totalFilesize.

Returns:
Value of property totalFilesize.

setTotalFilesize

public void setTotalFilesize(long totalFilesize)
Setter for property totalFilesize.

Parameters:
totalFilesize - New value of property totalFilesize.

replaceClips

public void replaceClips(Playlist srcPlaylist)
Parameters:
srcPlaylist -