Queue

Skip to end of metadata
Go to start of metadata

Queue

A simple queue abstraction, backed by linked list or priority queue.

Queue type

queue<Type>

Subtypes Supertypes Comparable types
deque<Type> sequence<Type> java.util.Deque<Type>

Queue creation

new linkedlist
new priority_queue

Parameter type Result type
Type...
sequence<? extends Type>
queue<Type>

Creates an empty queue. Optionally, initial values may be specified right in the new linked list creation expression.


Alternatively, a sequence may be specified that is used to copy elements from.

Operations on queue

iterator
Operand type Parameter type Result type
sequence<Type> none modifying_iterator<Type>

This operation is redefined for queue to return a modifying_iterator.

addLast
Operand type Parameter type Result type
queue<Type> Type Type

Appends an element to the tail of the queue.

removeFirst
Operand type Parameter type Result type
queue<Type>   Type

Removes an element from the head of the queue.

first
Operand type Parameter type Result type
queue<Type>   Type

Retrieves the first element at the head of the queue without removing it.

last
Operand type Parameter type Result type
queue<Type>   Type

Retrieves the first element at the tail of the queue without removing it.

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.