Queue

interface Queue<T> : Collection<T>

A Collection that mutates in a FIFO manner.

Functions

Link copied to clipboard
abstract operator fun contains(element: T): Boolean
Link copied to clipboard
abstract fun containsAll(elements: Collection<T>): Boolean
Link copied to clipboard
abstract fun isEmpty(): Boolean
Link copied to clipboard
abstract operator override fun iterator(): Iterator<T>
Link copied to clipboard
abstract fun pull(): T

Removes first item from the queue and returns it. If there is no more elements in the queue, it throws an exception.

Link copied to clipboard
abstract fun pullOrNull(): T?

Removes first item from the queue and returns it. If there is no more elements in the queue, it returns null.

Link copied to clipboard
abstract fun push(item: T)

Puts an item at the end of the queue.

Properties

Link copied to clipboard
abstract val size: Int

Extensions

Link copied to clipboard
inline fun <T> Queue<T>.pullEach(block: (T) -> Unit)
Link copied to clipboard

Transforms collection into Queue.