public class JobQueue<T extends Job>
extends java.lang.Object
Constructor and Description |
---|
JobQueue(MapViewPosition mapViewPosition,
DisplayModel displayModel) |
Modifier and Type | Method and Description |
---|---|
void |
add(T job) |
T |
get()
Returns the most important entry from this queue.
|
T |
get(int maxAssigned)
Returns the most important entry from this queue.
|
void |
interrupt() |
void |
notifyWorkers() |
void |
remove(T job) |
int |
size() |
public JobQueue(MapViewPosition mapViewPosition, DisplayModel displayModel)
public void add(T job)
public T get() throws java.lang.InterruptedException
java.lang.InterruptedException
public T get(int maxAssigned) throws java.lang.InterruptedException
maxAssigned
- the maximum number of jobs that should be assigned at any one point. If there
are already so many jobs assigned, the queue will block. This is to ensure
that the scheduling will continue to work.java.lang.InterruptedException
public void interrupt()
public void notifyWorkers()
public void remove(T job)
public int size()