remove

fun remove(predicate: (T) -> Boolean, waitStats: Boolean = waitTimeStatOption): MutableList<T>
fun remove(condition: Predicate<T>, waitStats: Boolean = waitTimeStatOption): MutableList<T>

Finds and removes all the QObjects in the Queue that satisfy the condition and adds them to the deletedItems collection

Return

a list of the removed items, which may be empty if none are removed

Parameters

condition

The condition to check

waitStats

indicates whether waiting time statistics should be collected


fun remove(qObj: T, waitStats: Boolean = waitTimeStatOption): Boolean

Removes the first occurrence in the queue of the specified element Automatically collects waiting time statistics and number in queue statistics. If the queue does not contain the element then it is unchanged and false is returned

Return

True if the item was removed.

Parameters

qObj

The object to be removed

waitStats

Indicates whether waiting time statistics should be collected on the removed item, true means collect statistics


fun remove(index: Int, waitStats: Boolean = waitTimeStatOption): T

Removes the element at the specified position in this queue. Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the list.

Automatically, collects number in queue statistics. If waitStats flag is true, then automatically collects the time in queue for the item and includes it in the time in queue response variable.

Throws an IndexOutOfBoundsException if the specified index is out of range (index < 0 || index >= size()).

Return

the element previously at the specified position

Parameters

index
  • the index of the element to be removed.

waitStats
  • true means collect waiting time statistics, false means do not