Class RingBuffer<T>

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Iterable<T>, java.util.Collection<T>, java.util.Queue<T>

    public class RingBuffer<T>
    extends java.util.concurrent.ConcurrentLinkedQueue<T>
    Created by Josh Gontijo on 5/14/17.
    See Also:
    Serialized Form
    • Method Summary

      Modifier and Type Method Description
      void clear()  
      boolean containsAll​(java.util.Collection<?> c)  
      boolean offer​(T t)  
      static <T> RingBuffer<T> ofSize​(int size)  
      T peek()  
      T poll()  
      T remove()  
      boolean remove​(java.lang.Object o)  
      boolean removeAll​(java.util.Collection<?> c)  
      boolean retainAll​(java.util.Collection<?> c)  
      • Methods inherited from class java.util.concurrent.ConcurrentLinkedQueue

        add, addAll, contains, forEach, isEmpty, iterator, removeIf, size, spliterator, toArray, toArray, toString
      • Methods inherited from class java.util.AbstractQueue

        element
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        equals, hashCode, parallelStream, stream, toArray
      • Methods inherited from interface java.util.Queue

        element
    • Method Detail

      • ofSize

        public static <T> RingBuffer<T> ofSize​(int size)
      • offer

        public boolean offer​(T t)
        Specified by:
        offer in interface java.util.Queue<T>
        Overrides:
        offer in class java.util.concurrent.ConcurrentLinkedQueue<T>
      • poll

        public T poll()
        Specified by:
        poll in interface java.util.Queue<T>
        Overrides:
        poll in class java.util.concurrent.ConcurrentLinkedQueue<T>
      • peek

        public T peek()
        Specified by:
        peek in interface java.util.Queue<T>
        Overrides:
        peek in class java.util.concurrent.ConcurrentLinkedQueue<T>
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection<T>
        Overrides:
        clear in class java.util.concurrent.ConcurrentLinkedQueue<T>
      • remove

        public boolean remove​(java.lang.Object o)
        Specified by:
        remove in interface java.util.Collection<T>
        Overrides:
        remove in class java.util.concurrent.ConcurrentLinkedQueue<T>
      • remove

        public T remove()
        Specified by:
        remove in interface java.util.Queue<T>
        Overrides:
        remove in class java.util.AbstractQueue<T>
      • containsAll

        public boolean containsAll​(java.util.Collection<?> c)
        Specified by:
        containsAll in interface java.util.Collection<T>
        Overrides:
        containsAll in class java.util.AbstractCollection<T>
      • removeAll

        public boolean removeAll​(java.util.Collection<?> c)
        Specified by:
        removeAll in interface java.util.Collection<T>
        Overrides:
        removeAll in class java.util.concurrent.ConcurrentLinkedQueue<T>
      • retainAll

        public boolean retainAll​(java.util.Collection<?> c)
        Specified by:
        retainAll in interface java.util.Collection<T>
        Overrides:
        retainAll in class java.util.concurrent.ConcurrentLinkedQueue<T>