Package com.rabbitmq.client.impl
Class SetQueue<T>
java.lang.Object
com.rabbitmq.client.impl.SetQueue<T>
- Type Parameters:
 T- type of elements in the queue
A generic queue-like implementation (supporting operations addIfNotPresent,
 poll, contains, and isEmpty)
 which restricts a queue element to appear at most once.
 If the element is already present addIfNotPresent(T) returns false.
 
null.
 Concurrent Semantics
This implementation is not thread-safe.- 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionbooleanaddIfNotPresent(T item) Add an element to the back of the queue and returntrue, or else returnfalse.voidclear()Remove all items from the queue.booleanbooleanisEmpty()poll()Remove the head of the queue and return it.booleanRemove item from queue, if present. 
- 
Constructor Details
- 
SetQueue
public SetQueue() 
 - 
 - 
Method Details
- 
addIfNotPresent
Add an element to the back of the queue and returntrue, or else returnfalse.- Parameters:
 item- to add- Returns:
 trueif the element was added,falseif it is already present.
 - 
poll
Remove the head of the queue and return it.- Returns:
 - head element of the queue, or 
nullif the queue is empty. 
 - 
contains
- Parameters:
 item- to look for in queue- Returns:
 trueif and only if item is in the queue.
 - 
isEmpty
public boolean isEmpty()- Returns:
 trueif and only if the queue is empty.
 - 
remove
Remove item from queue, if present.- Parameters:
 item- to remove- Returns:
 trueif and only if item was initially present and was removed.
 - 
clear
public void clear()Remove all items from the queue. 
 -