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 void
clear()
Task
getElementAt(int index)
Return task with given index.List<Long>
getSongIdsForTasksUsingOnlineResources()
Ids for tasks that use online resources.PlayList.SortDirection
getSortDirection()
String
getSortProperty()
int
indexOf(long id)
Returns the index of a given Task or-1
if not found or not displayed.int
indexOf(Object object)
Returns the index of a given Task or-1
if not found or not displayed.boolean
isEmpty()
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.Task
poll(long timeout, TimeUnit unit)
boolean
remove(Task task)
void
setApplication(BeaTunes beaTunes)
Sets the main application component.void
setSortDirection(PlayList.SortDirection sortDirection)
void
setSortProperty(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:ApplicationComponent
Sets the main application component.- Specified by:
setApplication
in 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:
getElementAt
in 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-1
if 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-1
if 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)
-
-