Lines Matching defs:queue

42  * A double-ended priority queue, which provides constant-time access to both
43 * its least element and its greatest element, as determined by the queue's
50 * the queue according to the queue's comparator. But unlike a regular priority
51 * queue, the methods {@link #peekLast}, {@link #pollLast} and
53 * in the queue instead.
55 * <p>A min-max priority queue can be configured with a maximum size. If so,
56 * each time the size of the queue exceeds that value, the queue automatically
79 * <li>If you only access one end of the queue, and don't use a maximum size,
93 * Creates a new min-max priority queue with default settings: natural order,
101 * Creates a new min-max priority queue using natural order, no maximum size,
131 * elements. Each time a queue grows beyond this bound, it immediately
181 * that are limited to {@code maximumSize} elements. Each time a queue grows
192 * Builds a new min-max priority queue using the previously specified
200 * Builds a new min-max priority queue using the previously specified
205 MinMaxPriorityQueue<T> queue = new MinMaxPriorityQueue<T>(
208 queue.offer(element);
210 return queue;
222 private Object[] queue;
235 this.queue = new Object[queueSize];
243 * Adds the given element to this queue. If this queue has a maximum size,
244 * after adding {@code element} the queue will automatically evict its
265 * Adds the given element to this queue. If this queue has a maximum size,
266 * after adding {@code element} the queue will automatically evict its
289 return (E) queue[index];
302 return 0; // The lone element in the queue is the maximum.
313 * Removes and returns the least element of this queue, or returns {@code
314 * null} if the queue is empty.
321 * Removes and returns the least element of this queue.
323 * @throws NoSuchElementException if the queue is empty
330 * Retrieves, but does not remove, the least element of this queue, or returns
331 * {@code null} if the queue is empty.
338 * Removes and returns the greatest element of this queue, or returns {@code
339 * null} if the queue is empty.
346 * Removes and returns the greatest element of this queue.
348 * @throws NoSuchElementException if the queue is empty
358 * Retrieves, but does not remove, the greatest element of this queue, or
359 * returns {@code null} if the queue is empty.
385 queue[size] = null;
392 queue[size] = null;
485 * alternate heap levels in the same array (MMPQ.queue).
559 queue[index] = e;
562 queue[index] = x;
611 queue[0] = x;
633 queue[index] = parentElement;
634 queue[parentIndex] = x;
637 queue[index] = x;
659 queue[uncleIndex] = actualLastElement;
660 queue[size] = uncleElement;
680 queue[index] = elementData(minChildIndex);
681 queue[minChildIndex] = x;
698 queue[index] = elementData(minGrandchildIndex);
742 * Iterates the elements of the queue in no particular order.
744 * If the underlying queue is modified during iteration an exception will be
778 "iterator moved past last element in queue.");
817 if (queue[i] == target) {
873 queue[i] = null;
880 System.arraycopy(queue, 0, copyTo, 0, size);
885 * Returns the comparator used to order the elements in this queue. Obeys the
894 return queue.length;
919 if (size > queue.length) {
922 System.arraycopy(queue, 0, newQueue, 0, queue.length);
923 queue = newQueue;
929 int oldCapacity = queue.length;