E
- public class BoundedPriorityQueue<E> extends PriorityQueue<E>
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
- The maximum capacity of the queuepublic BoundedPriorityQueue()
public final boolean add(E element)
add
in interface Collection<E>
add
in interface Queue<E>
add
in class PriorityQueue<E>
element
- Copyright © 2016. All rights reserved.