E - public class BoundedPriorityQueue<E> extends PriorityQueue<E> implements Serializable
| 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.
|
boolean |
equals(Object other) |
int |
getCapacity() |
int |
hashCode() |
clear, comparator, contains, iterator, offer, peek, poll, remove, size, spliterator, toArray, toArrayaddAll, element, removecontainsAll, isEmpty, removeAll, retainAll, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitcontainsAll, isEmpty, parallelStream, removeAll, removeIf, retainAll, streampublic 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 - public final int getCapacity()
public final boolean equals(Object other)
equals in interface Collection<E>equals in class Objectother - public final int hashCode()
hashCode in interface Collection<E>hashCode in class ObjectCopyright © 2017. All rights reserved.