Package 

Class CycledQueue


  • 
    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.

    • Method Summary

      Modifier and Type Method Description
      static CycledQueue instantiate()
      String getJsBase()
      void clear(Number newLengthLimit) Clears the queue.
      void dequeue() Removes the first item from the queue and returns it.
      void enqueue(String item) Enqueues passed the item.
      void get(Number index) Returns the queue item at the specified index.
      void getLength() Returns current queue length.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CycledQueue

        CycledQueue(String jsChart)
    • Method Detail

      • 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.