Is there a Guava equivalent to Apache Commons CircularFifoBuffer?

Etienne Neveu picture Etienne Neveu · Jan 9, 2013 · Viewed 10k times · Source

I need a data structure that can efficiently buffer a specific number of elements, in FIFO order.

As mentioned in this question, Apache Commons has a CircularFifoBuffer, but it is sadly not generified. Some forks exist, but I'm not sure of their maintenance status.

Since Guava is the go-to library for my collection needs, I'm wondering: is there a good alternative in Guava? If not, should I implement it in my project, based on Apache Commons' CircularFifoBuffer?

Answer

MosheElisha picture MosheElisha · May 6, 2013

Starting Guava 15.0 - you can use EvictingQueue