net.sourceforge.atunes.kernel.modules.playlist
Class PlayList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<AudioObject>
              extended by net.sourceforge.atunes.kernel.modules.playlist.PlayList
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<AudioObject>, java.util.Collection<AudioObject>, java.util.List<AudioObject>, java.util.RandomAccess

public class PlayList
extends java.util.ArrayList<AudioObject>

This class represents a play list.

Author:
fleax
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
PlayList()
          Default Constructor.
PlayList(java.util.List<AudioObject> files)
          Constructor.
PlayList(PlayList anotherPlayList)
          Instantiates a new play list.
 
Method Summary
 void clear()
          Clear play list.
 AudioObject getCurrentAudioObject()
          Return current audio object.
 int getCurrentAudioObjectIndex()
          Gets the index of the next file.
 java.lang.String getLength()
          Returns play list length in string format.
 java.lang.String getName()
          Gets the name.
 AudioObject getNextAudioObjectToPlay()
          Returns the next file to play.
 int getNumberOfAudioFiles()
          Returns number of audio files in play list.
 int getNumberOfPodcastFeedEntries()
          Returns number of podcast feed entries in play list.
 int getNumberOfRadios()
          Returns number of radios in play list.
 AudioObject getPreviousAudioObjectToPlay()
          Return the previous file played.
 int getRandomPosition()
          Returns a random position in playlist.
 AudioObject remove(int index)
          Removes a song.
 boolean removeAll(java.util.Collection<?> c)
          Removes a list of songs.
 void setCurrentAudioObject(int newCurrentAudioObject)
          Sets the index of the next file.
 void setName(java.lang.String name)
          Sets the name.
 void setSongs(java.util.List<AudioObject> songs)
          Sets a list of songs to this playlist.
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, retainAll, subList
 

Constructor Detail

PlayList

public PlayList()
Default Constructor.


PlayList

public PlayList(java.util.List<AudioObject> files)
Constructor.

Parameters:
files - the files

PlayList

public PlayList(PlayList anotherPlayList)
Instantiates a new play list.

Parameters:
anotherPlayList - the another play list
Method Detail

clear

public void clear()
Clear play list.

Specified by:
clear in interface java.util.Collection<AudioObject>
Specified by:
clear in interface java.util.List<AudioObject>
Overrides:
clear in class java.util.ArrayList<AudioObject>

getCurrentAudioObject

public AudioObject getCurrentAudioObject()
Return current audio object.

Returns:
the current audio object

getLength

public java.lang.String getLength()
Returns play list length in string format.

Returns:
the length

getName

public java.lang.String getName()
Gets the name.

Returns:
the name

getCurrentAudioObjectIndex

public int getCurrentAudioObjectIndex()
Gets the index of the next file.

Returns:
the current audio object index

getNextAudioObjectToPlay

public AudioObject getNextAudioObjectToPlay()
Returns the next file to play.

Returns:
the next audio object to play

getNumberOfAudioFiles

public int getNumberOfAudioFiles()
Returns number of audio files in play list.

Returns:
the number of audio files

getNumberOfPodcastFeedEntries

public int getNumberOfPodcastFeedEntries()
Returns number of podcast feed entries in play list.

Returns:
the number of podcast feed entries

getNumberOfRadios

public int getNumberOfRadios()
Returns number of radios in play list.

Returns:
the number of radios

getPreviousAudioObjectToPlay

public AudioObject getPreviousAudioObjectToPlay()
Return the previous file played.

Returns:
the previous audio object to play

getRandomPosition

public int getRandomPosition()
Returns a random position in playlist.

Returns:
the random position

remove

public AudioObject remove(int index)
Removes a song.

Specified by:
remove in interface java.util.List<AudioObject>
Overrides:
remove in class java.util.ArrayList<AudioObject>
Parameters:
index - the index
Returns:
the audio object

removeAll

public boolean removeAll(java.util.Collection<?> c)
Removes a list of songs.

Specified by:
removeAll in interface java.util.Collection<AudioObject>
Specified by:
removeAll in interface java.util.List<AudioObject>
Overrides:
removeAll in class java.util.AbstractCollection<AudioObject>
Parameters:
c - the c
Returns:
true, if removes the all

setName

public void setName(java.lang.String name)
Sets the name.

Parameters:
name - the name to set

setCurrentAudioObject

public void setCurrentAudioObject(int newCurrentAudioObject)
Sets the index of the next file.

Parameters:
newCurrentAudioObject - the new current audio object

setSongs

public void setSongs(java.util.List<AudioObject> songs)
Sets a list of songs to this playlist.

Parameters:
songs - the songs


Copyright © 2006-2008 The aTunes Team. All Rights Reserved.