|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PriorityQ
The interface to be implemented by the event queue of the evend based engine. An implementation must also provide the standard cosntructor required by any peersim components: one that takes a String argument, the component name in the configuration.
Nested Class Summary | |
---|---|
static class |
PriorityQ.Event
Return type of removeFirst() . |
Method Summary | |
---|---|
void |
add(long time,
java.lang.Object event,
Node node,
byte pid)
Add a new event, to be scheduled at the specified time. |
void |
add(long time,
java.lang.Object event,
Node node,
byte pid,
long priority)
Add a new event, to be scheduled at the specified time, specifying also the priority of the event, should there be other events scheduled at the same time. |
long |
maxPriority()
Maximal value of priority this interpretation can deal with. |
long |
maxTime()
Maximal value of time this interpretation can represent. |
PriorityQ.Event |
removeFirst()
Removes the first event in the heap and returns it. |
int |
size()
Returns the current number of events in the queue. |
Method Detail |
---|
int size()
void add(long time, java.lang.Object event, Node node, byte pid)
time
- The time at which this event should be scheduled. It is
guaranteed to be non-negative (so no extra checks are needed)event
- the object describing the eventnode
- the node at which the event has to be deliveredpid
- the protocol that handles the eventvoid add(long time, java.lang.Object event, Node node, byte pid, long priority)
time
- The time at which this event should be scheduled. It is
guaranteed to be non-negative (so no extra checks are needed)event
- the object describing the eventnode
- the node at which the event has to be deliveredpid
- the protocol that handles the eventpriority
- if for two events the "time" value is the same, this
value should be used to order them. Lower value means higher priority.
Like with time, non-negativity as assumed.PriorityQ.Event removeFirst()
long maxTime()
long maxPriority()
add(long,Object,Node,byte,long)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |