public class

SetQueue

extends Object
java.lang.Object
   ↳ com.rabbitmq.client.impl.SetQueue<T>

Class Overview

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.

Elements must not be null.

Concurrent Semantics
This implementation is not thread-safe.

Summary

Public Constructors
SetQueue()
Public Methods
boolean addIfNotPresent(T item)
Add an element to the back of the queue and return true, or else return false.
void clear()
Remove all items from the queue.
boolean contains(T item)
boolean isEmpty()
T poll()
Remove the head of the queue and return it.
boolean remove(T item)
Remove item from queue, if present.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public SetQueue ()

Public Methods

public boolean addIfNotPresent (T item)

Add an element to the back of the queue and return true, or else return false.

Parameters
item to add
Returns
  • true if the element was added, false if it is already present.

public void clear ()

Remove all items from the queue.

public boolean contains (T item)

Returns
  • true if and only if item is in the queue.

public boolean isEmpty ()

Returns
  • true if and only if the queue is empty.

public T poll ()

Remove the head of the queue and return it.

Returns
  • head element of the queue, or null if the queue is empty.

public boolean remove (T item)

Remove item from queue, if present.

Returns
  • true if and only if item was initially present and was removed.