E - Type of object to be stored in the bufferpublic class CircularBuffer<E> extends Object
| Constructor and Description |
|---|
CircularBuffer(int capacity) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(E item) |
E |
get(int index)
Access object at a given index, starting from the earliest entry added and moving forward.
|
E[] |
getBuffer() |
E |
getLatest(int index)
Access object at a given index, starting from the latest entry added and moving backwards.
|
int |
size() |
public E[] getBuffer()
public void add(E item)
public E getLatest(int index)
public E get(int index)
public int size()
Copyright © 2011–2018 The Apache Software Foundation. All rights reserved.