public class FileDownloadSerialQueue
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
ID_INVALID |
| Constructor and Description |
|---|
FileDownloadSerialQueue() |
| Modifier and Type | Method and Description |
|---|---|
void |
enqueue(BaseDownloadTask task)
Enqueues the given task sometime in the serial queue.
|
int |
getWaitingTaskCount()
Get the count of tasks which is waiting on this queue.
|
int |
getWorkingTaskId()
Returns the identify of the working task, if there is task is working, you will receive
ID_INVALID. |
void |
pause()
Pause the queue.
|
void |
resume()
Resume the queue if the queue is paused.
|
java.util.List<BaseDownloadTask> |
shutdown()
Attempts to stop the working task, halts the processing of waiting tasks, and returns a list
of the tasks that were awaiting execution.
|
public static final int ID_INVALID
public void enqueue(BaseDownloadTask task)
task is in the head of
the serial queue, the task will be started automatically.public void pause()
resume()public void resume()
pause()public int getWorkingTaskId()
ID_INVALID.public int getWaitingTaskCount()
public java.util.List<BaseDownloadTask> shutdown()