javazoom.jlGui.playlist
Class BasePlaylist

java.lang.Object
  |
  +--javazoom.jlGui.playlist.BasePlaylist
All Implemented Interfaces:
Playlist

public class BasePlaylist
extends java.lang.Object
implements Playlist

BasePlaylist. This class implements Playlist interface using a Vector.

Author:
E.B from JavaZOOM Homepage : http://www.javazoom.net

Field Summary
protected  int _cursorPos
           
protected  java.util.Vector _playlist
           
 
Constructor Summary
BasePlaylist()
          Constructor.
 
Method Summary
 void addItemAt(PlaylistItem pli, int pos)
          Adds item at a given position in the playlist.
 void appendItem(PlaylistItem pli)
          Append item at the end of the playlist.
 void begin()
          Moves the cursor at the top of the playlist.
 java.util.Collection getAllItems()
          Returns a collection of playlist items.
 PlaylistItem getCursor()
          Returns item matching to the cursor.
 PlaylistItem getItemAt(int pos)
          Returns item at a given position from the playlist.
 int getPlaylistSize()
          Returns then number of items in the playlist.
 int getSelectedIndex()
          Returns selected index.
 boolean load(java.lang.String filename)
          Loads playlist as M3U format.
 void nextCursor()
          Computes cursor position (next).
 void previousCursor()
          Computes cursor position (previous).
 void removeAllItems()
          Removes all items from the playlist.
 void removeItem(PlaylistItem pli)
          Searchs and removes item from the playlist.
 void removeItemAt(int pos)
          Removes item at a given position from the playlist.
 boolean save(java.lang.String filename)
          Saves playlist.
 void shuffle()
          Shuffles items in the playlist randomly
 void sortItems(int sortmode)
          Sorts items of the playlist.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_playlist

protected java.util.Vector _playlist

_cursorPos

protected int _cursorPos
Constructor Detail

BasePlaylist

public BasePlaylist()
Constructor.
Method Detail

load

public boolean load(java.lang.String filename)
Loads playlist as M3U format.
Specified by:
load in interface Playlist

save

public boolean save(java.lang.String filename)
Saves playlist.
Specified by:
save in interface Playlist

addItemAt

public void addItemAt(PlaylistItem pli,
                      int pos)
Adds item at a given position in the playlist.
Specified by:
addItemAt in interface Playlist

removeItem

public void removeItem(PlaylistItem pli)
Searchs and removes item from the playlist.
Specified by:
removeItem in interface Playlist

removeItemAt

public void removeItemAt(int pos)
Removes item at a given position from the playlist.
Specified by:
removeItemAt in interface Playlist

removeAllItems

public void removeAllItems()
Removes all items from the playlist.
Specified by:
removeAllItems in interface Playlist

appendItem

public void appendItem(PlaylistItem pli)
Append item at the end of the playlist.
Specified by:
appendItem in interface Playlist

sortItems

public void sortItems(int sortmode)
Sorts items of the playlist.
Specified by:
sortItems in interface Playlist

shuffle

public void shuffle()
Shuffles items in the playlist randomly
Specified by:
shuffle in interface Playlist

begin

public void begin()
Moves the cursor at the top of the playlist.
Specified by:
begin in interface Playlist

getItemAt

public PlaylistItem getItemAt(int pos)
Returns item at a given position from the playlist.
Specified by:
getItemAt in interface Playlist

getAllItems

public java.util.Collection getAllItems()
Returns a collection of playlist items.
Specified by:
getAllItems in interface Playlist

getPlaylistSize

public int getPlaylistSize()
Returns then number of items in the playlist.
Specified by:
getPlaylistSize in interface Playlist

getCursor

public PlaylistItem getCursor()
Returns item matching to the cursor.
Specified by:
getCursor in interface Playlist

nextCursor

public void nextCursor()
Computes cursor position (next).
Specified by:
nextCursor in interface Playlist

previousCursor

public void previousCursor()
Computes cursor position (previous).
Specified by:
previousCursor in interface Playlist

getSelectedIndex

public int getSelectedIndex()
Returns selected index.
Specified by:
getSelectedIndex in interface Playlist


JavaZOOM 1999-2002