|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttigase.util.PriorityQueueAbstract<E>
E - public abstract class PriorityQueueAbstract<E>
Works like a LinkedBlockingQueue using the put() and take() methods but with an additional priority integer parameter. The elemnt returned from take() will honor the priority in such a way that all elements of a lower priority will be returned before any elemens of a higher priority. Modified proposition taken from Noa Resare: http://resare.com/noa/ref/MultiPrioQueue.java
| Field Summary | |
|---|---|
static String |
NONPRIORITY_QUEUE
Field description |
static String |
QUEUE_IMPLEMENTATION
Field description |
| Constructor Summary | |
|---|---|
PriorityQueueAbstract()
|
|
| Method Summary | ||
|---|---|---|
static
|
getPriorityQueue(int maxPriority,
int maxSize)
Method description |
|
abstract void |
init(int maxPriority,
int maxSize)
Method description |
|
abstract boolean |
offer(E element,
int priority)
Method description |
|
abstract void |
put(E element,
int priority)
Method description |
|
abstract void |
setMaxSize(int maxSize)
Method description |
|
abstract int[] |
size()
Method description |
|
abstract E |
take()
Method description |
|
abstract int |
totalSize()
Method description |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String NONPRIORITY_QUEUE
public static final String QUEUE_IMPLEMENTATION
| Constructor Detail |
|---|
public PriorityQueueAbstract()
| Method Detail |
|---|
public abstract void init(int maxPriority,
int maxSize)
maxPriority - maxSize -
public abstract boolean offer(E element,
int priority)
element - priority -
public abstract void put(E element,
int priority)
throws InterruptedException
element - priority -
InterruptedExceptionpublic abstract void setMaxSize(int maxSize)
maxSize - public abstract int[] size()
public abstract E take()
throws InterruptedException
InterruptedExceptionpublic abstract int totalSize()
public static <E> PriorityQueueAbstract<E> getPriorityQueue(int maxPriority,
int maxSize)
E - maxPriority - maxSize -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||