lux.struct.Queue a LUX class
An array-based queue.
Constructors
-
Queue (max)
-
Default constructor.
Parameters:
-
integer
max
The queue max capacity
-
integer
max
-
Queue:fromSequence (seq)
-
Construct from sequence
Parameters:
-
sequence
seq
A sequence containing the new queue’s content
-
sequence
seq
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
...
-
any
item
-
lux.struct.Queue:pop (n)
-
Pops a value from the queue.
Parameters:
-
any
n
-
any
n
-
lux.struct.Queue:popAll ()
- Pops all values from the queue.
-
lux.struct.Queue:popEach ()
- Iterates through the queue popping everything.