BoundedDeque
Defined in: packages/data/src/deque/bounded-deque.ts:22
A double-ended queue that holds at most capacity items and throws once
full.
Type Parameters
Section titled “Type Parameters”T extends DefinedValue
The type of elements in the deque.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new BoundedDeque<
T>(iterable?,options?):BoundedDeque<T>
Defined in: packages/data/src/deque/bounded-deque.ts:28
Parameters
Section titled “Parameters”iterable?
Section titled “iterable?”Iterable<T, any, any>
options?
Section titled “options?”Returns
Section titled “Returns”BoundedDeque<T>
Properties
Section titled “Properties”capacity
Section titled “capacity”
readonlycapacity:number
Defined in: packages/data/src/deque/bounded-deque.ts:26
The maximum number of elements the collection can hold.
Note: Infinity is not a legal value here — an unbounded type omits this
mixin.
Implementation of
Section titled “Implementation of”Methods
Section titled “Methods”[iterator]()
Section titled “[iterator]()”[iterator]():
Iterator<T>
Defined in: packages/data/src/deque/bounded-deque.ts:48
Returns
Section titled “Returns”Iterator<T>
Implementation of
Section titled “Implementation of”back()
Section titled “back()”back():
T|undefined
Defined in: packages/data/src/deque/bounded-deque.ts:134
Returns the item at the back of the deque without removing it.
Returns
Section titled “Returns”T | undefined
The item at the back of the deque, or undefined if the deque is
empty.
Implementation of
Section titled “Implementation of”clear()
Section titled “clear()”clear():
void
Defined in: packages/data/src/deque/bounded-deque.ts:52
Removes all elements from the collection.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”count()
Section titled “count()”count():
number
Defined in: packages/data/src/deque/bounded-deque.ts:56
The number of elements in the collection.
A method, not a getter: its async counterpart needs a round trip to the backing store, and a member must have the same shape in both.
Returns
Section titled “Returns”number
Implementation of
Section titled “Implementation of”front()
Section titled “front()”front():
T|undefined
Defined in: packages/data/src/deque/bounded-deque.ts:130
Returns the item at the front of the deque without removing it.
Returns
Section titled “Returns”T | undefined
The item at the front of the deque, or undefined if the deque is
empty.
Implementation of
Section titled “Implementation of”pop():
T|undefined
Defined in: packages/data/src/deque/bounded-deque.ts:126
Removes and returns the item at the back of the deque.
Returns
Section titled “Returns”T | undefined
The item at the back of the deque, or undefined if the deque is
empty.
Implementation of
Section titled “Implementation of”push()
Section titled “push()”push(
item):void
Defined in: packages/data/src/deque/bounded-deque.ts:98
Same as IDeque.push, but throws once the deque is full.
Parameters
Section titled “Parameters”T
Returns
Section titled “Returns”void
Throws
Section titled “Throws”If the operation would exceed the deque’s capacity.
IDeque.push
Implementation of
Section titled “Implementation of”pushAll()
Section titled “pushAll()”pushAll(
items):void
Defined in: packages/data/src/deque/bounded-deque.ts:112
Same as IDeque.pushAll, but throws once the deque is full. Nothing is
added when it throws — the check is made against the whole batch.
Parameters
Section titled “Parameters”readonly T[]
Returns
Section titled “Returns”void
Throws
Section titled “Throws”If the operation would exceed the deque’s capacity.
IDeque.pushAll
Implementation of
Section titled “Implementation of”shift()
Section titled “shift()”shift():
T|undefined
Defined in: packages/data/src/deque/bounded-deque.ts:122
Removes and returns the item at the front of the deque.
Returns
Section titled “Returns”T | undefined
The item at the front of the deque, or undefined if the deque is
empty.
Implementation of
Section titled “Implementation of”unshift()
Section titled “unshift()”unshift(
item):void
Defined in: packages/data/src/deque/bounded-deque.ts:67
Same as IDeque.unshift, but throws once the deque is full.
Parameters
Section titled “Parameters”T
Returns
Section titled “Returns”void
Throws
Section titled “Throws”If the operation would exceed the deque’s capacity.
IDeque.unshift
Implementation of
Section titled “Implementation of”unshiftAll()
Section titled “unshiftAll()”unshiftAll(
items):void
Defined in: packages/data/src/deque/bounded-deque.ts:81
Same as IDeque.unshiftAll, but throws once the deque is full. Nothing is
added when it throws — the check is made against the whole batch.
Parameters
Section titled “Parameters”readonly T[]
Returns
Section titled “Returns”void
Throws
Section titled “Throws”If the operation would exceed the deque’s capacity.
IDeque.unshiftAll