|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ScheduleQueue
The ScheduleQueue is a kind of priority queue where 'tasks' are queued for scheduling.
ScheduleQueue support concurrent producers but only need to support single consumers. The ScheduledQueue also support priority tasks; so if a task with a priority comes in, than that one is taken before any other normal operation is taken. The ordering between normal tasks will always be FIFO. And the same goes for the ordering between priority tasks, but there is no ordering guarantee between priority and normal tasks.
Method Summary | |
---|---|
void |
add(Object task)
Adds an task with normal priority to this queue. |
void |
addUrgent(Object task)
Adds an task with normal priority to this queue. |
int |
normalSize()
returns the number of normal operations pending. |
int |
prioritySize()
returns the number of priority operations pending. |
int |
size()
Returns the total number of pending operations. |
Object |
take()
Takes an item from this queue. |
Method Detail |
---|
void add(Object task)
task
- the item to add
NullPointerException
- if task is nullvoid addUrgent(Object task)
task
- the item to add
NullPointerException
- if task is nullObject take() throws InterruptedException
InterruptedException
- if the thread is interrupted while waiting.int normalSize()
int prioritySize()
int size()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |