E
- the type of elements held in the universepublic abstract class PriorityQueue<E>
extends java.util.AbstractQueue<E>
null
elements. Inserting of elements that are not part of the
universe is also permitted (doing so will result in a
NoSuchElementException
).Modifier and Type | Method and Description |
---|---|
boolean |
add(E e) |
boolean |
contains(java.lang.Object o) |
boolean |
isEmpty() |
static <E> PriorityQueue<E> |
noneOf(E[] universe)
Creates a new empty priority queue
|
static <E> PriorityQueue<E> |
noneOf(java.util.List<? extends E> universe)
Creates a new empty priority queue
|
static <E extends Numberable> |
noneOf(java.util.List<? extends E> universe,
boolean useNumberInterface) |
static <E> PriorityQueue<E> |
of(E[] universe)
Creates a new full priority queue
|
static <E> PriorityQueue<E> |
of(java.util.List<? extends E> universe)
Creates a new full priority queue
|
static <E extends Numberable> |
of(java.util.List<? extends E> universe,
boolean useNumberInterface) |
boolean |
offer(E e) |
E |
peek() |
E |
poll() |
boolean |
remove(java.lang.Object o) |
containsAll, iterator, removeAll, retainAll, size, toArray, toArray, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public final E peek()
public final E poll()
public final boolean add(E e)
public final boolean offer(E e)
java.util.NoSuchElementException
- if e not part of the universejava.lang.NullPointerException
- if e is null
public final boolean remove(java.lang.Object o)
public final boolean contains(java.lang.Object o)
public boolean isEmpty()
public static <E> PriorityQueue<E> of(E[] universe)
universe
- public static <E> PriorityQueue<E> noneOf(E[] universe)
universe
- public static <E> PriorityQueue<E> of(java.util.List<? extends E> universe)
universe
- public static <E> PriorityQueue<E> noneOf(java.util.List<? extends E> universe)
universe
- public static <E extends Numberable> PriorityQueue<E> of(java.util.List<? extends E> universe, boolean useNumberInterface)
public static <E extends Numberable> PriorityQueue<E> noneOf(java.util.List<? extends E> universe, boolean useNumberInterface)