Class CircularBuffer<E>


  • public class CircularBuffer<E>
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private E[] buffer  
      private int size  
      private int writeIndex  
    • Constructor Summary

      Constructors 
      Constructor Description
      CircularBuffer​(int size)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int capacity()  
      E insert​(E object)  
      <T> T[] toArray​(java.lang.Class<T[]> type)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • buffer

        private final E[] buffer
      • writeIndex

        private int writeIndex
      • size

        private int size
    • Constructor Detail

      • CircularBuffer

        public CircularBuffer​(int size)
    • Method Detail

      • capacity

        public int capacity()
      • insert

        public E insert​(E object)
      • toArray

        public <T> T[] toArray​(java.lang.Class<T[]> type)