element

open override fun element(): E

Retrieves, but does not remove, the head of this queue. This method differs from .peek only in that it throws an exception if this queue is empty.

This implementation returns the result of peek unless the queue is empty.

Return

the head of this queue

Throws

if this queue is empty