Class RingQueue<E>
- java.lang.Object
- 
- java.util.AbstractCollection<E>
- 
- java.util.AbstractQueue<E>
- 
- org.apache.qpid.protonj2.engine.util.RingQueue<E>
 
 
 
- 
- Type Parameters:
- E- the element type that is stored in this- Queuetype.
 - All Implemented Interfaces:
- Iterable<E>,- Collection<E>,- Queue<E>
 
 public class RingQueue<E> extends AbstractQueue<E> Simple Ring Queue implementation that has an enforced max size value.
- 
- 
Constructor SummaryConstructors Constructor Description RingQueue(int queueSize)Creates a newRingQueueinstance with the given fixed Queue size.RingQueue(Collection<E> collection)Creates a newRingQueueinstance with a size that matches the size of the givenCollectionand filled with the values from thatCollection.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddAll(Collection<? extends E> c)voidclear()booleancontains(Object value)booleanisEmpty()Iterator<E>iterator()booleanoffer(E e)Epeek()Epoll()Epoll(Supplier<E> createOnEmpty)Retrieves and removes the head of this ring queue, and if the queue is currently empty a new instance of the queue type is provided by invoking the givenSupplier.booleanremove(Object o)booleanremoveAll(Collection<?> c)booleanretainAll(Collection<?> c)intsize()- 
Methods inherited from class java.util.AbstractQueueadd, element, remove
 - 
Methods inherited from class java.util.AbstractCollectioncontainsAll, toArray, toArray, toString
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface java.util.CollectioncontainsAll, equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray, toArray, toArray
 
- 
 
- 
- 
- 
Constructor Detail- 
RingQueuepublic RingQueue(int queueSize) Creates a newRingQueueinstance with the given fixed Queue size.- Parameters:
- queueSize- The size to use for the ring queue.
 
 - 
RingQueuepublic RingQueue(Collection<E> collection) Creates a newRingQueueinstance with a size that matches the size of the givenCollectionand filled with the values from thatCollection.- Parameters:
- collection- the- Collectionwhose values populates this- RingQueueinstance.
 
 
- 
 - 
Method Detail- 
offerpublic boolean offer(E e) 
 - 
pollpublic E poll() 
 - 
pollpublic E poll(Supplier<E> createOnEmpty) Retrieves and removes the head of this ring queue, and if the queue is currently empty a new instance of the queue type is provided by invoking the givenSupplier.
 - 
peekpublic E peek() 
 - 
addAllpublic boolean addAll(Collection<? extends E> c) - Specified by:
- addAllin interface- Collection<E>
- Overrides:
- addAllin class- AbstractQueue<E>
 
 - 
removepublic boolean remove(Object o) - Specified by:
- removein interface- Collection<E>
- Overrides:
- removein class- AbstractCollection<E>
 
 - 
removeAllpublic boolean removeAll(Collection<?> c) - Specified by:
- removeAllin interface- Collection<E>
- Overrides:
- removeAllin class- AbstractCollection<E>
 
 - 
retainAllpublic boolean retainAll(Collection<?> c) - Specified by:
- retainAllin interface- Collection<E>
- Overrides:
- retainAllin class- AbstractCollection<E>
 
 - 
iteratorpublic Iterator<E> iterator() - Specified by:
- iteratorin interface- Collection<E>
- Specified by:
- iteratorin interface- Iterable<E>
- Specified by:
- iteratorin class- AbstractCollection<E>
 
 - 
sizepublic int size() - Specified by:
- sizein interface- Collection<E>
- Specified by:
- sizein class- AbstractCollection<E>
 
 - 
isEmptypublic boolean isEmpty() - Specified by:
- isEmptyin interface- Collection<E>
- Overrides:
- isEmptyin class- AbstractCollection<E>
 
 - 
clearpublic void clear() - Specified by:
- clearin interface- Collection<E>
- Overrides:
- clearin class- AbstractQueue<E>
 
 - 
containspublic boolean contains(Object value) - Specified by:
- containsin interface- Collection<E>
- Overrides:
- containsin class- AbstractCollection<E>
 
 
- 
 
-