AnyChart
API Reference
Still have questions?
Contact support
Top

class anychart.math.CycledQueue Improve this Doc

Class for queues with random access by indexes. Default maximum queue length is 256. It dequeues automatically when the length of the queue reaches that limit. So if you need larger queue - set the length limit explicitly.

Methods Overview

Miscellaneous
clear()Clears the queue. You can optionally reset the queue length limit.
dequeue()Removes the first item from the queue and returns it.
enqueue()Enqueues passed the item.
get()Returns the queue item at the specified index.
getLength()Gets queue length.

Methods Description

clear

Clears the queue. You can optionally reset the queue length limit.

Params:

NameTypeDescription
newLengthLimitnumberThe new length limit

dequeue

Removes the first item from the queue and returns it.

Returns:

* - Removed item.

enqueue

Enqueues passed the item. If this call dequeued an item - returns it.

Params:

NameTypeDescription
item*Item

Returns:

* - Returns replaced item.

get

Returns the queue item at the specified index. The index can be negative - that is interpreted as the index from the end of the queue.

Params:

NameTypeDescription
indexnumberIndex of item.

Returns:

* - Queue item.

getLength

Gets queue length.

Returns:

number - Return the queue length.