E
- the type of elements held in the universepublic abstract class PriorityQueue<E> extends 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(Object o) |
boolean |
isEmpty() |
static <E> PriorityQueue<E> |
noneOf(E[] universe)
Creates a new empty priority queue
|
static <E> PriorityQueue<E> |
noneOf(List<? extends E> universe)
Creates a new empty priority queue
|
static <E extends Numberable> |
noneOf(List<? extends E> universe,
boolean useNumberInterface) |
static <E> PriorityQueue<E> |
of(E[] universe)
Creates a new full priority queue
|
static <E> PriorityQueue<E> |
of(List<? extends E> universe)
Creates a new full priority queue
|
static <E extends Numberable> |
of(List<? extends E> universe,
boolean useNumberInterface) |
boolean |
offer(E e) |
E |
peek() |
E |
poll() |
boolean |
remove(Object o) |
addAll, clear, element, remove
containsAll, iterator, removeAll, retainAll, size, toArray, toArray, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
containsAll, equals, hashCode, iterator, parallelStream, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray
public final E peek()
public final E poll()
public final boolean add(E e)
add
in interface Collection<E>
add
in interface Queue<E>
add
in class AbstractQueue<E>
NoSuchElementException
- if e not part of the universeNullPointerException
- if e is null
public final boolean offer(E e)
NoSuchElementException
- if e not part of the universeNullPointerException
- if e is null
public final boolean remove(Object o)
remove
in interface Collection<E>
remove
in class AbstractCollection<E>
public final boolean contains(Object o)
contains
in interface Collection<E>
contains
in class AbstractCollection<E>
public boolean isEmpty()
isEmpty
in interface Collection<E>
isEmpty
in class AbstractCollection<E>
public static <E> PriorityQueue<E> of(E[] universe)
universe
- public static <E> PriorityQueue<E> noneOf(E[] universe)
universe
- public static <E> PriorityQueue<E> of(List<? extends E> universe)
universe
- public static <E> PriorityQueue<E> noneOf(List<? extends E> universe)
universe
- public static <E extends Numberable> PriorityQueue<E> of(List<? extends E> universe, boolean useNumberInterface)
public static <E extends Numberable> PriorityQueue<E> noneOf(List<? extends E> universe, boolean useNumberInterface)