DRCL J-Sim API

drcl.comp.tool
Class TimerList

java.lang.Object
  extended bydrcl.comp.tool.TimerList

public class TimerList
extends java.lang.Object

Maintains a set of timers.


Constructor Summary
TimerList()
           
 
Method Summary
 java.lang.Object cancel(Port timerPort_, java.lang.Object key_)
          Returns the object of the timer.
 void cancelAll(Port timerPort_)
          Cancels all the timers.
 boolean containsKey(java.lang.Object key_)
          Returns true if the timer list contains the key.
 java.lang.Object get(java.lang.Object key_)
          Retrieves the timer object.
 java.lang.String info(java.lang.String prefix_)
           
 void set(Port timerPort_, java.lang.Object timer_, double time_)
          Sets a timer.
 void set(Port timerPort_, java.lang.Object key_, java.lang.Object timer_, double time_)
          Sets a timer.
 int size()
          Returns the number of timers in the list.
 java.lang.Object timeout(Port timerPort_, double now_)
          Returns the object of the timer that expires and activates next if available.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimerList

public TimerList()
Method Detail

size

public int size()
Returns the number of timers in the list.


set

public void set(Port timerPort_,
                java.lang.Object timer_,
                double time_)
Sets a timer. Use timer_ as key. If the key exists, the timer is rescheduled.


set

public void set(Port timerPort_,
                java.lang.Object key_,
                java.lang.Object timer_,
                double time_)
Sets a timer. If key_ exists, the timer is rescheduled.


get

public java.lang.Object get(java.lang.Object key_)
Retrieves the timer object.


containsKey

public boolean containsKey(java.lang.Object key_)
Returns true if the timer list contains the key.


timeout

public java.lang.Object timeout(Port timerPort_,
                                double now_)
Returns the object of the timer that expires and activates next if available. Returns null if it is a false alarm.


cancelAll

public void cancelAll(Port timerPort_)
Cancels all the timers.


cancel

public java.lang.Object cancel(Port timerPort_,
                               java.lang.Object key_)
Returns the object of the timer.


info

public java.lang.String info(java.lang.String prefix_)

DRCL J-Sim API

Copyright © 1998-2003 Distributed Real-time Computing Lab (DRCL). All Rights Reserved.     ~ To J-Sim Home ~