-
public class CycledQueue extends JsObject
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.
-
-
Constructor Summary
Constructors Constructor Description CycledQueue(String jsChart)
-
Method Summary
Modifier and Type Method Description static CycledQueueinstantiate()StringgetJsBase()voidclear(Number newLengthLimit)Clears the queue. voiddequeue()Removes the first item from the queue and returns it. voidenqueue(String item)Enqueues passed the item. voidget(Number index)Returns the queue item at the specified index. voidgetLength()Returns current queue length. -
-
Constructor Detail
-
CycledQueue
CycledQueue(String jsChart)
-
-
Method Detail
-
instantiate
static CycledQueue instantiate()
-
clear
void clear(Number newLengthLimit)
Clears the queue. You can optionally reset the queue length limit.
-
dequeue
void dequeue()
Removes the first item from the queue and returns it.
-
enqueue
void enqueue(String item)
Enqueues passed the item. If this call dequeued an item - returns it.
-
get
void get(Number index)
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.
-
getLength
void getLength()
Returns current queue length.
-
-
-
-