Package com.tagtraum.audiokern
Interface PlayListIterator<T>
-
- All Superinterfaces:
Iterator<T>
,ListIterator<T>
- All Known Implementing Classes:
HibernatePlayListIterator
,ListBackedPlayListIterator
,TableListIterator
public interface PlayListIterator<T> extends ListIterator<T>
Allows iterating over a (dynamically changing) playlist of some sort.- Author:
- Hendrik Schreiber
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
currentIndex()
The index of the song last returned byListIterator.next()
orListIterator.previous()
.void
dispose()
Cleans up an resources held by this iterator.JComponent
getComponent()
The component the playlist is displayed in.Long
getPlayListId()
Returns a persistent playlist id.void
reset()
Resets the iterator so that the next call toListIterator.next()
returns the first element of the collection this iterator is based on.void
setComponent(JComponent component)
Set the component the playlists is played in.-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Methods inherited from interface java.util.ListIterator
add, hasNext, hasPrevious, next, nextIndex, previous, previousIndex, remove, set
-
-
-
-
Method Detail
-
getPlayListId
Long getPlayListId()
Returns a persistent playlist id. Together withgetComponent()
you may use this id to identify the playlist view or actual persistent playlist this iterator was created for.- Returns:
- playlist id or null, if the playlist is not persistent
-
getComponent
JComponent getComponent()
The component the playlist is displayed in. Together withgetPlayListId()
you may use this component (most likely aJTable
) to identify the playlist view or actual persistent playlist this iterator was created for.- Returns:
- component, may be null, if the playlist is currently not displayed
-
setComponent
void setComponent(JComponent component)
Set the component the playlists is played in.- Parameters:
component
- component- See Also:
getComponent()
-
currentIndex
int currentIndex()
The index of the song last returned byListIterator.next()
orListIterator.previous()
. The index may change, as the underlying playlist is sorted, filtered or changed otherwise.- Returns:
- index
-
reset
void reset()
Resets the iterator so that the next call toListIterator.next()
returns the first element of the collection this iterator is based on.
-
dispose
void dispose()
Cleans up an resources held by this iterator. It is strongly recommended you call this method, once you don't need the iterator anymore.
-
-