class ArrayDeque
source · line 7public class ArrayDeque<T> public constructor() : Collection<T>
- Supertype
Collection<T>
A growable double-ended queue with constant-time indexed ring-buffer access at either end. Structural changes invalidate active iterators.
function removeLast
source · line 80public fun removeLast(): T
Removes and returns the back element; an empty queue throws NoSuchElementException.
function firstOrNone
source · line 57public fun firstOrNone(): T?
Returns the front element without removing it, or None when empty.
function removeFirst
source · line 66public fun removeFirst(): T
Removes and returns the front element; an empty queue throws NoSuchElementException.
function iterator
source · line 115public override operator fun iterator(): Iterator<T>
- Overrides
iterator
Iterates from front to back; structural changes invalidate the iterator.
function removeFirstOrNone
source · line 94public fun removeFirstOrNone(): T?
Removes the front element, or returns None when empty.
function clear
source · line 103public fun clear(): Unit
Removes all queued elements.
constructor constructor
source · line 7constructor()
function addFirst
source · line 36public fun addFirst(element: T): Unit
Prepends an element to the queue.
parameter element
source · line 36element: T
function lastOrNone
source · line 61public fun lastOrNone(): T?
Returns the back element without removing it, or None when empty.
function removeLastOrNone
source · line 98public fun removeLastOrNone(): T?
Removes the back element, or returns None when empty.
function addLast
source · line 47public fun addLast(element: T): Unit
Appends an element to the queue.
parameter element
source · line 47element: T
property size
source · line 15public override val size: Long
- Overrides
size
get: public read-only
The number of queued elements.
getter get
source · line 15get(): Long
type parameter T
source · line 7T