|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.limegroup.gnutella.connection.MessageQueue
com.limegroup.gnutella.connection.SimpleMessageQueue
Simple LIFO or FIFO message queue.
Field Summary |
Fields inherited from class com.limegroup.gnutella.connection.MessageQueue |
_dropped |
Constructor Summary | |
SimpleMessageQueue(int cycle,
int timeout,
int capacity,
boolean lifo)
|
Method Summary | |
protected Message |
addInternal(Message m)
Add m to this, returns any message that had to dropped to make room in a queue. |
protected Message |
removeNextInternal()
Same as removeNext, but ignores message age and cycle. |
int |
size()
Returns the number of queued messages. |
Methods inherited from class com.limegroup.gnutella.connection.MessageQueue |
add, isEmpty, removeNext, resetCycle, resetDropped |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SimpleMessageQueue(int cycle, int timeout, int capacity, boolean lifo)
cycle
- the number of messages to return per cycle, i.e., between
calls to resetCycle. This is used to tweak the ratios of various
message types.timeout
- the max time to keep queued messages, in milliseconds.
Set this to Integer.MAX_VALUE to avoid timeouts.capacity
- the maximum number of elements this can store.lifo
- true if this is last-in-first-out, false if this is
first-in-first-out.Method Detail |
protected Message addInternal(Message m)
MessageQueue
addInternal
in class MessageQueue
protected Message removeNextInternal()
MessageQueue
removeNextInternal
in class MessageQueue
public int size()
MessageQueue
size
in class MessageQueue
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |