com.pmease.quickbuild.util
Class RingBuffer<T>
java.lang.Object
com.pmease.quickbuild.util.RingBuffer<T>
- Type Parameters:
T
-
public class RingBuffer<T>
- extends java.lang.Object
Modeled after Imax disruptor ringbuffer (see http://lmax-exchange.github.com/disruptor/),
but this is a simple clone, and it is not thread-safe.
Field Summary |
protected java.util.concurrent.atomic.AtomicLong |
sequence
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
sequence
protected java.util.concurrent.atomic.AtomicLong sequence
RingBuffer
public RingBuffer(RingBuffer.EventFactory<T> factory,
int bufferSize)
get
public T get(long seq)
getCursor
public long getCursor()
getLastN
public java.util.List<T> getLastN(int n)
getLast
public T getLast()
publish
public void publish(long sequence)
next
public long next()
Copyright © 2005-2010 PMEase Inc. All Rights Reserved.