public class PriorityQueue4D<E> extends AbstractQueue4D<E>
Constructor and Description |
---|
PriorityQueue4D() |
PriorityQueue4D(java.util.Collection<? extends E> c) |
PriorityQueue4D(int cap) |
PriorityQueue4D(int cap,
java.util.Comparator<? super E> comp) |
PriorityQueue4D(PriorityQueue4D<? extends E> c) |
PriorityQueue4D(java.util.SortedSet<? extends E> c) |
Modifier and Type | Method and Description |
---|---|
boolean |
addAll(java.util.Collection<? extends E> c)
Adds all of the elements in the specified collection to this
queue.
|
void |
clear()
Removes all of the elements from this queue.
|
java.util.Comparator<? super E> |
comparator() |
java.util.Iterator<E> |
iterator() |
boolean |
offer(E o) |
E |
peek() |
E |
poll() |
boolean |
remove(java.lang.Object o) |
int |
size() |
add, element, remove
contains, containsAll, isEmpty, removeAll, retainAll, toArray, toArray, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public PriorityQueue4D()
public PriorityQueue4D(java.util.Collection<? extends E> c)
public PriorityQueue4D(int cap)
public PriorityQueue4D(int cap, java.util.Comparator<? super E> comp)
public PriorityQueue4D(PriorityQueue4D<? extends E> c)
public PriorityQueue4D(java.util.SortedSet<? extends E> c)
public void clear()
AbstractQueue4D
This implementation repeatedly invokes poll
until it
returns null.
clear
in interface java.util.Collection<E>
clear
in class AbstractQueue4D<E>
public java.util.Comparator<? super E> comparator()
public java.util.Iterator<E> iterator()
public boolean offer(E o)
public E peek()
public E poll()
public boolean remove(java.lang.Object o)
public int size()
public boolean addAll(java.util.Collection<? extends E> c)
AbstractQueue4D
This implementation iterates over the specified collection, and adds each element returned by the iterator to this queue, in turn. A runtime exception encountered while trying to add an element (including, in particular, a null element) may result in only some of the elements having been successfully added when the associated exception is thrown.
addAll
in interface java.util.Collection<E>
addAll
in class AbstractQueue4D<E>
c
- collection containing elements to be added to this queueAbstractQueue4D.add(Object)