Save This Page
Home » slf4j-1.5.5 » org.apache » log4j » helpers » [javadoc | source]
org.apache.log4j.helpers
public class: CyclicBuffer [javadoc | source]
java.lang.Object
   org.apache.log4j.helpers.CyclicBuffer
CyclicBuffer is used by other appenders to hold LoggingEvents for immediate or differed display.

This buffer gives read access to any element in the buffer not just the first or last element.

Field Summary
 LoggingEvent[] ea     
 int first     
 int last     
 int numElems     
 int maxSize     
Constructor:
 public CyclicBuffer(int maxSize) throws IllegalArgumentException 
    Instantiate a new CyclicBuffer of at most maxSize events. The maxSize argument must a positive integer.
    Parameters:
    maxSize - The maximum number of elements in the buffer.
Method from org.apache.log4j.helpers.CyclicBuffer Summary:
add,   get,   get,   getMaxSize,   length,   resize
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.log4j.helpers.CyclicBuffer Detail:
 public  void add(LoggingEvent event) 
    Add an event as the last event in the buffer.
 public LoggingEvent get() 
    Get the oldest (first) element in the buffer. The oldest element is removed from the buffer.
 public LoggingEvent 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 null is returned.
 public int getMaxSize() 
 public int length() 
    Get the number of elements in the buffer. This number is guaranteed to be in the range 0 to maxSize (inclusive).
 public  void resize(int newSize) 
    Resize the cyclic buffer to newSize.