RingBuffer
A fixed-capacity buffer that overwrites its oldest element when full.
Elements are ordered oldest first. add appends in constant amortized time and, when the buffer already holds capacity elements, drops the oldest one. Iteration and toList yield elements oldest first. Backed by ArrayDeque.
This class is not thread-safe.
Type Parameters
T
the element type.
Throws
if capacity is not positive.
Properties
Functions
Link copied to clipboard
Returns true if at least one element occurs more than once.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Returns the oldest element, or null if the buffer is empty.
Link copied to clipboard
Link copied to clipboard
Returns true if no element occurs more than once.
Link copied to clipboard
Returns the newest element, or null if the buffer is empty.
Link copied to clipboard
Returns the smallest and largest element as a pair, or null if the receiver is empty.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard