goog.structs.CircularBuffer<T>
Provided By |
---|
Class for CircularBuffer.
new CircularBuffer<T>( opt_maxSize )
Parameters |
|
---|
Instance Methods
this.add( item ) → ?
?
Adds an item to the buffer. May remove the oldest item if the buffer is at max size.
Overrides | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns |
|
this.clear() → void
void
this.containsKey( key ) → boolean
boolean
this.containsValue( value ) → boolean
boolean
Whether the buffer contains the given value.
Overrides | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns |
|
this.get( index ) → T
T
Returns the item at the specified index.
Overrides | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns |
|
this.getCount() → number
number
Returns the current number of items in the buffer.
Overrides | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getLast() → ?
?
Returns the last item inserted into the buffer.
Overrides | ||
---|---|---|
Parameters | None. | |
Returns |
|
this.getNewestValues( maxCount ) → Array<(T|null)>
Array<(T|null)>
this.getValues() → Array<(T|null)>
Array<(T|null)>
Overrides | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.isEmpty() → boolean
boolean
Overrides | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.set( index, item ) → void
void
Sets the item at the specified index.
Overrides | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|