Dart API Referencedart:coreQueue<E>

Queue<E> Interface

A Queue is a collection that can be manipulated at both ends. One can iterate over the elements of a queue through forEach or with an Iterator.

Default class

DoubleLinkedQueue<E>

Extends

Collection<E>

Implemented by

DoubleLinkedQueue<E>

Constructors

Code new Queue.from(Iterable<E> other) #

Creates a queue with the elements of other. The order in the queue will be the order provided by the iterator of other.

Queue.from(Iterable<E> other);

Code new Queue() #

Creates a queue.

Queue();

Methods

Code void add(E value) #

Adds value at the end of the queue.

void add(E value);

Code void addAll(Collection<E> collection) #

Adds all elements of collection at the end of the queue. The length of the queue is extended by the length of collection.

void addAll(Collection<E> collection);

Code void addFirst(E value) #

Adds value at the beginning of the queue.

void addFirst(E value);

Code void addLast(E value) #

Adds value at the end of the queue.

void addLast(E value);

Code void clear() #

Removes all elements in the queue. The size of the queue becomes zero.

void clear();

Code E first() #

Returns the first element of the queue. Throws an EmptyQueueException exception if this queue is empty.

E first();

Code E last() #

Returns the last element of the queue. Throws an EmptyQueueException exception if this queue is empty.

E last();

Code E removeFirst() #

Removes and returns the first element of this queue. Throws an EmptyQueueException exception if this queue is empty.

E removeFirst();

Code E removeLast() #

Removes and returns the last element of the queue. Throws an EmptyQueueException exception if this queue is empty.

E removeLast();