Object Hierarchy:

Gee.Deque Gee.Deque Gee.Deque Gee.Queue Gee.Queue Gee.Queue->Gee.Deque


[ GenericAccessors ]
public interface Deque<G> : Queue<G>

A double-ended queue.

A deque can be used either as a queue (First-In-First-Out behavior) or as a stack (Last-In-First-Out behavior).

The methods defined by this interface behaves exactely in the same way as the Queue methods with respect to capacity bounds.

The Deque interface inherits from the Queue interface. Thus, to use a deque as a queue, you can equivalently use the following method set:

Queue method Deque method
Queue.offer offer_tail
Queue.peek peek_head
Queue.poll poll_head
Queue.drain drain_head

To use a deque as a stack, just use the method set that acts at the head of the deque:

Operation Deque method
push an element offer_head
peek an element peek_head
pop an element poll_head
All known implementing classes:

Namespace: Gee
Package: gee-0.8



Inherited Members:

All known members inherited from interface Gee.Queue