|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object smtphandler.CyclicBuffer
public class CyclicBuffer
CyclicBuffer is used by other handlers to hold LogRecord
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
records. |
Method Summary | |
---|---|
void |
add(java.util.logging.LogRecord record)
Add a record as the last record in the buffer. |
java.util.logging.LogRecord |
get()
Get the oldest (first) element in the buffer. |
java.util.logging.LogRecord |
get(int i)
Get the i th oldest record 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 . |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CyclicBuffer(int maxSize) throws java.lang.IllegalArgumentException
maxSize
records.
The maxSize
argument must a positive integer.
maxSize
- The maximum number of elements in the buffer.
java.lang.IllegalArgumentException
Method Detail |
---|
public void add(java.util.logging.LogRecord record)
record
as the last record in the buffer.
record
- must be non-nullpublic java.util.logging.LogRecord get(int i)
null
is returned.
public int getMaxSize()
public java.util.logging.LogRecord get()
public int length()
maxSize
(inclusive).
public void resize(int newSize)
newSize
.
java.lang.IllegalArgumentException
- if newSize
is negative.public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |