Class for CircularBuffer.
| Instance Method Summary | |
add(<Any Type> item)Adds an item to the buffer. May remove the oldest item if the buffer is at max size. | |
clear()Empties the current buffer. | |
containsKey(number key) ⇒ booleanWhether the buffer contains the key/index. | |
containsValue(<Any Type> value) ⇒ booleanWhether the buffer contains the given value. | |
get(number index) ⇒ <Any Type>Returns the item at the specified index. | |
getCount() ⇒ numberReturns the current number of items in the buffer. | |
getKeys() ⇒ ?Array | |
getLast() ⇒ <Any Type>Returns the last item inserted into the buffer. | |
getNewestValues(number maxCount) ⇒ ?ArrayReturns the newest values in the buffer up to {@code count}. | |
getValues() ⇒ ?Array | |
isEmpty() ⇒ boolean | |
normalizeIndex_(number index) ⇒ numberHelper function to convert an index in the number space of oldest to newest items in the array to the position that the element will be at in the underlying array. | |
set(number index, <Any Type> item)Sets the item at the specified index. | |