Sets up the ring buffer.
The buffer's capacity.
The buffer's capacity.
Obtains the latest element (LIFO) without removing it. Throws an exception if a buffer is
empty. Before calling this method, make sure that size > 0
.
Obtains the oldest element (FIFO) without removing it. Throws an exception if a buffer is
empty. Before calling this method, make sure that size > 0
.
Returns a copy of the buffer, where the elements are properly sorted from oldest to newest.
Clears the contents, removes all elements.
Obtains the oldest element (FIFO). May throw an exception if a buffer underrun occurs.
Before calling this method, make sure that size > 0
.
Adds one or more elements.
The elements to add.
Adds a single element to the ring buffer.
Data element.
Creates an iterator for the buffer.
Generated using TypeDoc
A simple ring buffer to store the last
n
values of the timer. The buffer works on a First-In-First-Out (FIFO) basis.