UniqueQueue

class UniqueQueue<T> : Iterable<T>

A unique ArrayDeque that utilizes a hash set to check whether something already exists in the queue. This implementation is NOT thread-safe.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun add(v: T): Boolean

Adds the element v into this queue if it isn't already in the hash set.

Link copied to clipboard
fun clear()

Clears both the queue and the set.

Link copied to clipboard
open fun forEach(p0: Consumer<in T>)
Link copied to clipboard
open operator override fun iterator(): Iterator<T>
Link copied to clipboard

Removes the first element from this queue, or null if it doesn't exist. If it does exist, the element is furthermore removed from the backing hash set.

Link copied to clipboard