com.jme3.util
Class RingBuffer<T>

java.lang.Object
  extended by com.jme3.util.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
RingBuffer(int capacity)
           
 
Method Summary
 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
 

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>