|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--solar.module.protocol.Buffer
A buffer contains an individual queue for one receiver or an aggregated queue for multiple receivers. When the queue reaches the limit, it either drop the new event (drop_tail) or the oldest one (drop_head).
| Field Summary | |
protected java.util.LinkedList |
_buffer
|
protected boolean |
_drophead
|
protected int |
_limit
|
| Constructor Summary | |
Buffer()
|
|
Buffer(java.util.Collection collection)
|
|
Buffer(int limit)
|
|
| Method Summary | |
void |
clear()
Clear out the whole buffer. |
void |
dropHead()
|
void |
dropTail()
|
Event |
get()
Get and remove an event from the buffer. |
java.util.Collection |
getAll()
|
void |
put(Event evt)
Add an event to the buffer, return false if limit is exceeded. |
void |
putAll(java.util.Collection collection)
|
int |
size()
Get current size of the buffer. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected int _limit
protected boolean _drophead
protected java.util.LinkedList _buffer
| Constructor Detail |
public Buffer()
public Buffer(int limit)
public Buffer(java.util.Collection collection)
| Method Detail |
public void put(Event evt)
throws BufferFullException
BufferFullExceptionpublic Event get()
public int size()
public void clear()
public void dropTail()
public void dropHead()
public java.util.Collection getAll()
public void putAll(java.util.Collection collection)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||