E - the generic type of the data content stored in the listpublic class PriorityQueueItem<E> extends java.lang.Object implements java.lang.Comparable<PriorityQueueItem<E>>
PriorityQueue| Modifier and Type | Field and Description |
|---|---|
private int |
priority |
private Queue<E> |
queue |
| Constructor and Description |
|---|
PriorityQueueItem(int priority) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(E item)
Add an item to the queue of this PriorityQueueItem object
|
int |
compareTo(PriorityQueueItem<E> o)
Compares this Node to another node on basis of priority
|
Queue<E> |
getList() |
int |
getPriority() |
public int getPriority()
public void add(E item)
item - item to add to the queuepublic int compareTo(PriorityQueueItem<E> o)
compareTo in interface java.lang.Comparable<PriorityQueueItem<E>>o - other node to compare to