public class BoundedPriorityQueue<E> extends PriorityQueue<E>
PriorityQueue
out of the box. This class fills that gap.
Among other places, it is used by the BeamSearch
class to maintain the beam.
May 1, 2009
Modifier and Type | Field and Description |
---|---|
protected int |
maxQueueSize |
Constructor and Description |
---|
BoundedPriorityQueue(int maxQueueSize,
Comparator<? super E> comparator) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(E o) |
boolean |
addAll(Collection<? extends E> c) |
int |
getMaxQueueSize() |
clear, comparator, contains, iterator, offer, peek, poll, remove, size, spliterator, toArray, toArray
element, remove
containsAll, isEmpty, removeAll, retainAll, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
containsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, stream
public BoundedPriorityQueue(int maxQueueSize, Comparator<? super E> comparator)
public int getMaxQueueSize()
public boolean add(E o)
add
in interface Collection<E>
add
in interface Queue<E>
add
in class PriorityQueue<E>
public boolean addAll(Collection<? extends E> c)
addAll
in interface Collection<E>
addAll
in class AbstractQueue<E>
Copyright © 2017. All rights reserved.