T
- type of elements in the ordered set.@Internal public interface InternalPriorityQueue<T>
Modifier and Type | Method and Description |
---|---|
boolean |
add(T toAdd)
Adds the given element to the set, if it is not already contained.
|
void |
addAll(Collection<? extends T> toAdd)
Adds all the given elements to the set.
|
boolean |
isEmpty()
Check if the set contains any elements.
|
CloseableIterator<T> |
iterator()
Iterator over all elements, no order guaranteed.
|
T |
peek()
Retrieves, but does not remove, the element (w.r.t.
|
T |
poll()
Retrieves and removes the first element (w.r.t.
|
boolean |
remove(T toRemove)
Removes the given element from the set, if is contained in the set.
|
int |
size()
Returns the number of elements in this set.
|
@Nullable T poll()
null
if this set is empty.null
if this set is empty.@Nullable T peek()
null
if this set is empty.null
if this set is empty.boolean add(@Nonnull T toAdd)
toAdd
- the element to add to the set.true
if the operation changed the head element or if it is unclear if the head element changed.
Only returns false
if the head element was not changed by this operation.boolean remove(@Nonnull T toRemove)
toRemove
- the element to remove.true
if the operation changed the head element or if it is unclear if the head element changed.
Only returns false
if the head element was not changed by this operation.boolean isEmpty()
@Nonnegative int size()
void addAll(@Nullable Collection<? extends T> toAdd)
@Nonnull CloseableIterator<T> iterator()
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.