It allows read access to any element in the buffer not just the first or last element.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv E[] | |
| pack-priv int | |
| pack-priv int | |
| pack-priv int | |
| pack-priv int |
| Access | Constructor and Description |
|---|---|
| public | CyclicBuffer(int
The maximum number of elements in the buffer. maxSize)Instantiate a new CyclicBuffer of at most |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public List | |
| public void | |
| public E | |
| public E | |
| public int | |
| private void | |
| public int | |
| public void |
| ea | back to summary |
|---|---|
| pack-priv E[] ea | |
| first | back to summary |
|---|---|
| pack-priv int first | |
| last | back to summary |
|---|---|
| pack-priv int last | |
| maxSize | back to summary |
|---|---|
| pack-priv int maxSize | |
| numElems | back to summary |
|---|---|
| pack-priv int numElems | |
| CyclicBuffer | back to summary |
|---|---|
| public CyclicBuffer(int maxSize) throws IllegalArgumentException Instantiate a new CyclicBuffer of at most
| |
| CyclicBuffer | back to summary |
|---|---|
public CyclicBuffer(CyclicBuffer<E> other)
| |
| add | back to summary |
|---|---|
| public void add(E event) Add an | |
| asList | back to summary |
|---|---|
| public List | |
| clear | back to summary |
|---|---|
| public void clear() Clears the buffer and resets all attributes. | |
| get | back to summary |
|---|---|
| public E get(int i) Get the ith oldest event currently in the buffer. If i is
outside the range 0 to the number of elements currently in the buffer, then
| |
| get | back to summary |
|---|---|
| public E get() Get the oldest (first) element in the buffer. The oldest element is removed from the buffer. | |
| getMaxSize | back to summary |
|---|---|
| public int getMaxSize() | |
| init | back to summary |
|---|---|
private void init(int maxSize)
| |
| length | back to summary |
|---|---|
| public int length() Get the number of elements in the buffer. This number is guaranteed to be in
the range 0 to | |
| resize | back to summary |
|---|---|
| public void resize(int newSize) Resize the cyclic buffer to
| |