|
Logback API Version 0.9.8 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.qos.logback.core.helpers.CyclicBuffer<E>
public class CyclicBuffer<E>
CyclicBuffer is used by other appenders to hold objects for immediate or differed display.
This buffer gives read access to any element in the buffer not just the first or last element.
Constructor Summary | |
---|---|
CyclicBuffer(int maxSize)
Instantiate a new CyclicBuffer of at most maxSize events. |
Method Summary | |
---|---|
void |
add(E event)
Add an event as the last event in the buffer. |
void |
clear()
Clears the buffer and resets all attributes. |
E |
get()
Get the oldest (first) element in the buffer. |
E |
get(int i)
Get the ith oldest event currently in the buffer. |
int |
getMaxSize()
|
int |
length()
Get the number of elements in the buffer. |
void |
resize(int newSize)
Resize the cyclic buffer to newSize . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CyclicBuffer(int maxSize) throws IllegalArgumentException
maxSize
events.
The maxSize
argument must a positive integer.
maxSize
- The maximum number of elements in the buffer.
IllegalArgumentException
Method Detail |
---|
public void clear()
public void add(E event)
event
as the last event in the buffer.
public E get(int i)
null
is returned.
public int getMaxSize()
public E get()
public int length()
maxSize
(inclusive).
public void resize(int newSize)
newSize
.
IllegalArgumentException
- if newSize
is negative.
|
Logback API Version 0.9.8 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |