Package org.mapsforge.map.layer.queue
Class JobQueue<T extends Job>
- java.lang.Object
-
- org.mapsforge.map.layer.queue.JobQueue<T>
-
public class JobQueue<T extends Job> extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description JobQueue(IMapViewPosition mapViewPosition, DisplayModel displayModel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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()
-
-
-
Constructor Detail
-
JobQueue
public JobQueue(IMapViewPosition mapViewPosition, DisplayModel displayModel)
-
-
Method Detail
-
add
public void add(T job)
-
get
public T get() throws java.lang.InterruptedException
Returns the most important entry from this queue. The method blocks while this queue is empty.- Throws:
java.lang.InterruptedException
-
get
public T get(int maxAssigned) throws java.lang.InterruptedException
Returns the most important entry from this queue. The method blocks while this queue is empty or while there are already a certain number of jobs assigned.- Parameters:
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.- Throws:
java.lang.InterruptedException
-
interrupt
public void interrupt()
-
notifyWorkers
public void notifyWorkers()
-
remove
public void remove(T job)
-
size
public int size()
- Returns:
- the current number of entries in this queue.
-
-