Constructor takes an optional capacity
parameter. If set,
the Queue won't accept new elements when the lengths reaches the
capacity, until it is dequeued.
The maximum queue length before overflow.
The maximum elements the structure can contain.
It can be set via the constructor or setCapacity
.
Default value is -1
(no limit).
The current amount of elements.
Removes the first element of the list.
The value of the element removed.
Adds an element to the end of the list and returns its length. If the length already reached the (optional) capacity, enqueue won't perform and return -1.
The value associed to the element.
The length of the current Queue after insertion,
or -1
if it failed.
Returns the first element.
Returns the last element.
Generated using TypeDoc
Queue implementation based on a linked list. It has two methods
enqueue
anddequeue
to manage its elements. It implements the CappedStructure interface to handle overflow of acapacity
is set.