Package com.jme3.util

Class RingBuffer<T>

  • All Implemented Interfaces:
    java.lang.Iterable<T>

    public class RingBuffer<T>
    extends java.lang.Object
    implements java.lang.Iterable<T>
    Ring buffer (fixed size queue) implementation using a circular array (array with wrap-around).
    • Constructor Summary

      Constructors 
      Constructor Description
      RingBuffer​(int capacity)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isEmpty()  
      java.util.Iterator<T> iterator()  
      T pop()  
      void push​(T item)  
      int size()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • RingBuffer

        public RingBuffer​(int capacity)
    • Method Detail

      • isEmpty

        public boolean isEmpty()
      • size

        public int size()
      • push

        public void push​(T item)
      • pop

        public T pop()
      • iterator

        public java.util.Iterator<T> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<T>