goog.structs.CircularBuffer
Classgoog.structs.CircularBuffer(opt_maxSize)
Class for CircularBuffer.
opt_maxSize
{number
=}
.add(item)
Adds an item to the buffer. May remove the oldest item if the buffer is at max size.
item
{*}
.clear()
Empties the current buffer.
.containsKey(key)
Whether the buffer contains the key/index.
key
{number
}
boolean
}
.containsValue(value)
Whether the buffer contains the given value.
value
{*}
boolean
}
.get(index)
Returns the item at the specified index.
index
{number
}
.getCount()
Returns the current number of items in the buffer.
number
}
.getKeys()
Array
}
.getLast()
Returns the last item inserted into the buffer.
.getNewestValues(maxCount)
Returns the newest values in the buffer up to {@code count}.
maxCount
{number
}
Array
}
.getValues()
Array
}
.isEmpty()
boolean
}
.set(index, item)
Sets the item at the specified index.
index
{number
}
item
{*}