@Test public void testAdd() { Assert.assertEquals(0, buffer.end()); for (int i = 0; i < 2 * CAPACITY; i++) { buffer.add(i); Assert.assertEquals(i + 1 < CAPACITY ? 0 : i + 1 - CAPACITY, buffer.start()); Assert.assertEquals(i + 1, buffer.end()); Assert.assertEquals(Integer.valueOf(i), buffer.symbolAt(i)); } }
@Override public void add(final S symbol_) { if (isFull()) { ++iStart; } buffer[(int) (iEnd++ % buffer.length)] = symbol_; }
TailBuffer implements ITailBuffer<S> { @Override public void add(final S symbol_) { if (isFull()) { ++iStart; } buffer[(int) (iEnd++ % buffer.length)] = symbol_; } }
TailBuffer implements ITailBuffer<S> { @Override public void add(final S symbol_) { if (isFull()) { ++iStart; } buffer[(int) (iEnd++ % buffer.length)] = symbol_; } TailBuffer(final int capacity_);  TailBuffer(); }
TailBuffer implements ITailBuffer<S> { @Override public void add(final S symbol_) { if (isFull()) { ++iStart; } buffer[(int) (iEnd++ % buffer.length)] = symbol_; } TailBuffer(final int capacity_);  TailBuffer(); @Override void add(final S symbol_); @Override int capacity(); @Override void clear(); @Override long end(); @Override boolean isEmpty(); @Override boolean isFull(); @Override S remove(); @Override int size(); @Override long start(); @SuppressWarnings("unchecked") @Override S symbolAt(final long iPosition_); @Override String toString(); }
TailBuffer implements ITailBuffer<S> { @Override public void add(final S symbol_) { if (isFull()) { ++iStart; } buffer[(int) (iEnd++ % buffer.length)] = symbol_; } TailBuffer(final int capacity_);  TailBuffer(); @Override void add(final S symbol_); @Override int capacity(); @Override void clear(); @Override long end(); @Override boolean isEmpty(); @Override boolean isFull(); @Override S remove(); @Override int size(); @Override long start(); @SuppressWarnings("unchecked") @Override S symbolAt(final long iPosition_); @Override String toString(); static final int DEFAULT_CAPACITY; }