Import std.collections.queue
Queue
class
@DebugElements Public Class Queue<T> Implements Iterable<T>, Cloneable, Defaultable
First in, first out: Enqueue puts a value at the back, and Dequeue takes the front one off.
Examples
Local turns = Queue<String>()
turns.Enqueue("knight")
turns.Enqueue("goblin")
Expect(turns.Dequeue() == "knight")
Expect(turns.Peek() == "goblin")std/collections/queue.fb, line 20
-
How many values it holds.
-
Puts
valueat the back. -
The same as Enqueue.
-
Enqueues each of the
values, in order. -
Takes the front value off and gives it. Panics when the Queue is empty.
-
The front value, which stays. Panics when the Queue is empty.
-
Takes the front value off and gives it, or Null when the Queue is empty.
-
The front value, which stays, or Null when the Queue is empty.
-
The values from the front, the order Dequeue gives them, in a new array.
-
Whether it holds
value. -
Takes every value out.
-
A new, empty Queue.
-
A new Queue with the same values.
-
The values from the front, the order Dequeue gives them. Changing the Queue while going over them panics.
Report an issue with this page or with FutureBlitz on GitHub.