lux.struct.Queue a LUX class

An array-based queue.

Constructors

Queue (max)

Default constructor.

Parameters:

  • integer max

    The queue max capacity

Queue:fromSequence (seq)

Construct from sequence

Parameters:

  • sequence seq

    A sequence containing the new queue’s content

Methods

lux.struct.Queue:isEmpty ()

Tells whether the queue is empty.

Returns:

    boolean

    True if the queue is empty, false otherwise

lux.struct.Queue:isFull ()

Tells whether the queue is full.

lux.struct.Queue:push (item, ...)

Pushes a value into the queue.

Parameters:

  • any item

  • any ...

lux.struct.Queue:pop (n)

Pops a value from the queue.

Parameters:

  • any n

lux.struct.Queue:popAll ()

Pops all values from the queue.

lux.struct.Queue:popEach ()

Iterates through the queue popping everything.