This supports adding to the ‘head’ or ‘tail’ and will grow the buffer to match a configured capacity.
Signature
Import
Constructors
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
add | (value: T) => void | Add the value to the buffer | |
number |
Methods
Constructs a new instance of the CircularVector
class
Signature
Parameters
Parameter | Type | Description |
---|---|---|
options | CircularOptions<T> |
add property
Add the value to the buffer
Signature
add: (value: T) => void;
length property
Signature
Parameters
Returns:
T
reverse method
Signature
reverse(): void;
Returns:
void
set method
Signature
set(index: number, value: T): void;
Parameters
Parameter | Type | Description |
---|---|---|
index | number | |
value | T |
Returns:
Parameters
Returns:
void
setCapacity method
Signature
setCapacity(v: number): void;
Parameters
Parameter | Type | Description |
---|---|---|
v | number |
Returns:
void
toArray method
Signature
Returns:
T[]
Signature
T[]