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
 
 public class SetQueue<T> extends Object A generic queue-like implementation (supporting operations Elements must not beaddIfNotPresent,poll,contains, andisEmpty) which restricts a queue element to appear at most once. If the element is already presentaddIfNotPresent(T)returnsfalse.null.Concurrent SemanticsThis implementation is not thread-safe.
- 
- 
Constructor SummaryConstructors Constructor Description SetQueue()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddIfNotPresent(T item)Add an element to the back of the queue and returntrue, or else returnfalse.voidclear()Remove all items from the queue.booleancontains(T item)booleanisEmpty()Tpoll()Remove the head of the queue and return it.booleanremove(T item)Remove item from queue, if present.
 
- 
- 
- 
Method Detail- 
addIfNotPresentpublic boolean addIfNotPresent(T item) 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.
 
 - 
pollpublic T poll() Remove the head of the queue and return it.- Returns:
- head element of the queue, or nullif the queue is empty.
 
 - 
containspublic boolean contains(T item) - Parameters:
- item- to look for in queue
- Returns:
- trueif and only if item is in the queue.
 
 - 
isEmptypublic boolean isEmpty() - Returns:
- trueif and only if the queue is empty.
 
 - 
removepublic boolean remove(T item) Remove item from queue, if present.- Parameters:
- item- to remove
- Returns:
- trueif and only if item was initially present and was removed.
 
 - 
clearpublic void clear() Remove all items from the queue.
 
- 
 
-