Class CircularBuffer4<T>

  • All Implemented Interfaces:
    Iterable4<T>

    public class CircularBuffer4<T>
    extends java.lang.Object
    implements Iterable4<T>
    A fixed size double ended queue with O(1) complexity for addFirst, removeFirst and removeLast operations.
    • Constructor Detail

      • CircularBuffer4

        public CircularBuffer4​(int size)
    • Method Detail

      • size

        public int size()
      • addFirst

        public void addFirst​(T value)
      • removeLast

        public T removeLast()
      • isEmpty

        public boolean isEmpty()
      • isFull

        public boolean isFull()
      • removeFirst

        public T removeFirst()
      • remove

        public boolean remove​(T value)
      • contains

        public boolean contains​(T value)