E
- public class BoundedPriorityQueue<E> extends PriorityQueue<E>
Modifier and Type | Field and Description |
---|---|
protected int |
CAPACITY |
Constructor and Description |
---|
BoundedPriorityQueue()
Creates a priority queue with maximum capacity Integer.MAX_VALUE
|
BoundedPriorityQueue(int capacity)
Create a bounded priority queue with given maximum capacity
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(E element)
When the queue is full, adds the element if it is larger than the smallest
element already in the queue.
|
clear, comparator, contains, iterator, offer, peek, poll, remove, size, toArray, toArray
addAll, element, remove
containsAll, isEmpty, removeAll, retainAll, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
containsAll, equals, hashCode, isEmpty, removeAll, retainAll
public BoundedPriorityQueue(int capacity)
capacity
- public BoundedPriorityQueue()
public boolean add(E element)
add
in interface Collection<E>
add
in interface Queue<E>
add
in class PriorityQueue<E>
element
- Copyright © 2015. All rights reserved.