Package com.tagtraum.beatunes.analysis
Interface TaskQueue
-
- All Superinterfaces:
ApplicationComponent<BeaTunes>,ListModel
- All Known Implementing Classes:
HibernateTaskQueue
public interface TaskQueue extends ApplicationComponent<BeaTunes>, ListModel
TaskQueue.- Author:
- Hendrik Schreiber
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclear()TaskgetElementAt(int index)Return task with given index.List<Long>getSongIdsForTasksUsingOnlineResources()Ids for tasks that use online resources.PlayList.SortDirectiongetSortDirection()StringgetSortProperty()intindexOf(long id)Returns the index of a given Task or-1if not found or not displayed.intindexOf(Object object)Returns the index of a given Task or-1if not found or not displayed.booleanisEmpty()List<Long>offer(List<Long> songIds, TaskFactory taskFactory, DiscreteProgressListener discreteProgressListener)Create tasks using the provided factory and list of song ids and add them to the queue.Taskpoll(long timeout, TimeUnit unit)booleanremove(Task task)voidsetApplication(BeaTunes beaTunes)Sets the main application component.voidsetSortDirection(PlayList.SortDirection sortDirection)voidsetSortProperty(String propertyName)-
Methods inherited from interface com.tagtraum.core.app.ApplicationComponent
getApplication, getId, init, shutdown
-
Methods inherited from interface javax.swing.ListModel
addListDataListener, getSize, removeListDataListener
-
-
-
-
Method Detail
-
setApplication
void setApplication(BeaTunes beaTunes)
Description copied from interface:ApplicationComponentSets the main application component.- Specified by:
setApplicationin interfaceApplicationComponent<BeaTunes>- Parameters:
beaTunes- beaTunes instance
-
setSortProperty
void setSortProperty(String propertyName)
-
getSortProperty
String getSortProperty()
-
setSortDirection
void setSortDirection(PlayList.SortDirection sortDirection)
-
getSortDirection
PlayList.SortDirection getSortDirection()
-
offer
List<Long> offer(List<Long> songIds, TaskFactory taskFactory, DiscreteProgressListener discreteProgressListener)
Create tasks using the provided factory and list of song ids and add them to the queue.- Parameters:
songIds- persistent song idstaskFactory- task factorydiscreteProgressListener- progress listener- Returns:
- the list of actually added ids
-
getSongIdsForTasksUsingOnlineResources
List<Long> getSongIdsForTasksUsingOnlineResources()
Ids for tasks that use online resources.- Returns:
- list of ids.
-
getElementAt
Task getElementAt(int index)
Return task with given index.- Specified by:
getElementAtin interfaceListModel- Parameters:
index- index- Returns:
- task or null, if there is no task with the given index.
-
indexOf
int indexOf(Object object)
Returns the index of a given Task or-1if not found or not displayed.- Parameters:
object- object- Returns:
- index or
-1, if not found
-
indexOf
int indexOf(long id)
Returns the index of a given Task or-1if not found or not displayed.- Parameters:
id- id- Returns:
- index or
-1, if not found
-
isEmpty
boolean isEmpty()
- See Also:
Collection.isEmpty()
-
clear
void clear()
- See Also:
Collection.clear()
-
remove
boolean remove(Task task)
- See Also:
BlockingQueue.remove(Object)
-
poll
Task poll(long timeout, TimeUnit unit) throws InterruptedException
- Throws:
InterruptedException- See Also:
BlockingQueue.poll(long, java.util.concurrent.TimeUnit)
-
-