public interface IPriorityQueue<E extends java.lang.Comparable<? super E>> extends IQueue<E>
Modifier and Type | Method and Description |
---|---|
default void |
add(E item)
Inserts the specified element into this queue,
returning true upon success.
|
default E |
element()
Retrieves, but does not remove, the head of this queue.
|
default boolean |
isEmpty()
Returns true if this queue contains no elements.
|
boolean |
offer(E e)
Inserts the specified element into this queue.
|
E |
peek()
Retrieves, but does not remove, an element of greatest priority, which
is the head of the priority queue.
|
E |
poll()
Retrieves and removes an element of greatest priority, which is
the head of the priority queue.
|
default E |
remove()
Retrieves and removes the head of this queue.
|
E poll()
E peek()
boolean offer(E e)
default void add(E item)
IQueue
This method throws an IllegalStateException if no space is available to hold the new item.
default E remove()
IQueue
default E element()
IQueue