public class IntBoundedPriorityQueue extends PriorityQueue<Integer>
| Modifier and Type | Class and Description |
|---|---|
static class |
IntBoundedPriorityQueue.IntComparator |
static interface |
IntBoundedPriorityQueue.IntIterator |
| Constructor and Description |
|---|
IntBoundedPriorityQueue(IntBoundedPriorityQueue.IntComparator comparator,
int capacity,
int forbiddenValue) |
| Modifier and Type | Method and Description |
|---|---|
Integer |
element()
Retrieves, but does not remove, the head of this queue.
|
int |
intElement() |
IntBoundedPriorityQueue.IntIterator |
iterator()
Returns an iterator over the elements in this collection.
|
boolean |
offer(int item)
When the queue is full, the offered elements are added if they are bigger than the
smallest one already in the queue.
|
boolean |
offer(Integer item)
When the queue is full, the offered elements are added if they are bigger than the
smallest one already in the queue.
|
Integer |
peek()
Retrieves, but does not remove, the head of this queue, returning null if this queue
is empty.
|
int |
peekInt()
Retrieves, but does not remove, the head of this queue, returning the forbidden value
if the queue is empty.
|
Integer |
poll()
Retrieves and removes the head of this queue, or null if this queue is empty.
|
int |
pollInt()
Retrieves and removes the head of this queue, or the forbidden value if this queue is empty.
|
int |
size()
Returns the number of elements in this collection.
|
add, clear, comparator, contains, remove, toArray, toArrayaddAll, removecontainsAll, isEmpty, removeAll, retainAll, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcontainsAll, equals, hashCode, isEmpty, removeAll, retainAllpublic IntBoundedPriorityQueue(IntBoundedPriorityQueue.IntComparator comparator, int capacity, int forbiddenValue)
capacity - the maximum number of items the queue acceptscomparator - a comparator that is used to order the items.public Integer element() throws NoSuchElementException
element in interface Queue<Integer>element in class AbstractQueue<Integer>NoSuchElementExceptionQueue.element()public int intElement()
throws NoSuchElementException
NoSuchElementExceptionpublic IntBoundedPriorityQueue.IntIterator iterator()
iterator in interface Iterable<Integer>iterator in interface Collection<Integer>iterator in class PriorityQueue<Integer>AbstractCollection.iterator()public boolean offer(Integer item)
offer in interface Queue<Integer>offer in class PriorityQueue<Integer>Queue.offer(java.lang.Object)public boolean offer(int item)
Queue.offer(java.lang.Object)public Integer peek()
peek in interface Queue<Integer>peek in class PriorityQueue<Integer>Queue.peek()public int peekInt()
public Integer poll()
poll in interface Queue<Integer>poll in class PriorityQueue<Integer>Queue.poll()public int pollInt()
public int size()
size in interface Collection<Integer>size in class PriorityQueue<Integer>AbstractCollection.size()Copyright © 2005–2013. All rights reserved.