add method
Adds an element to the buffer. Overwrites the oldest element if full.
Implementation
@override
void add(T element) {
_buffer[_tail] = element;
_tail = (_tail + 1) % _capacity;
if (_isFull) {
_head = (_head + 1) % _capacity;
} else if (_tail == _head) {
_isFull = true;
}
}