PriorityQueue< E> class
A priority queue is a priority based work-list of elements.
The queue allows adding elements, and removing them again in priority order.
- Implementers
Constructors
- PriorityQueue([int comparison(E e1, E e2) ])
-
Creates an empty PriorityQueue. [...]
factory
Properties
- first → E
-
Returns the next element that will be returned by removeFirst. [...]
read-only
- isEmpty → bool
-
Whether the queue is empty.
read-only
- isNotEmpty → bool
-
Whether the queue has any elements.
read-only
- length → int
-
Number of elements in the queue.
read-only
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Methods
-
add(
E element) → void - Adds element to the queue. [...]
-
addAll(
Iterable< E> elements) → void -
Adds all
elements
to the queue. -
clear(
) → void - Removes all the elements from this queue.
-
contains(
E object) → bool -
Checks if
object
is in the queue. [...] -
remove(
E element) → bool -
Removes an element that compares equal to
element
in the queue. [...] -
removeAll(
) → Iterable< E> - Removes all the elements from this queue and returns them. [...]
-
removeFirst(
) → E - Removes and returns the element with the highest priority. [...]
-
toList(
) → List< E> - Returns a list of the elements of this queue in priority order. [...]
-
toSet(
) → Set< E> - Return a comparator based set using the comparator of this queue. [...]
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
toString(
) → String -
Returns a string representation of this object.
inherited
Operators
-
operator ==(
dynamic other) → bool -
The equality operator. [...]
inherited