jp.go.aist.rtm.RTC.util
Class Timer

java.lang.Object
  extended by jp.go.aist.rtm.RTC.util.Timer
All Implemented Interfaces:
java.lang.Runnable

public class Timer
extends java.lang.Object
implements java.lang.Runnable

タイマークラスです。


Constructor Summary
Timer(TimeValue interval)
           Constructor
 
Method Summary
 void invoke()
           Processing at cycle of timer
 int open()
           Creates the thread.
 ListenerBase registerListener(ListenerBase listener, TimeValue tm)
           Registers the listener for the timer processing.
 ListenerBase registerListenerObj(CallbackFunction cbf, TimeValue tm)
           Registers the callback function started with the timer.
 void run()
           Starts the timer cycle processing.
 void start()
           Starts the timer.
 void stop()
           Stops the timer.
 int svc()
           Processing at cycle of timer
 boolean unregisterListener(ListenerBase id)
           Deletes the callback function for the timer processing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Timer

public Timer(TimeValue interval)
Constructor

Parameters:
interval - Timer start cycle
Method Detail

open

public int open()
Creates the thread.

Creates the thread for the timer.

Returns:
Always returns 0.

svc

public int svc()
Processing at cycle of timer

Starts invoke().

Returns:
Result      Normal termination:Returns 0.      At abnormal generation:Throws out the exception.

run

public void run()
Starts the timer cycle processing.

Specified by:
run in interface java.lang.Runnable

start

public void start()
Starts the timer.


stop

public void stop()
Stops the timer.


invoke

public void invoke()
Processing at cycle of timer


registerListener

public ListenerBase registerListener(ListenerBase listener,
                                     TimeValue tm)
Registers the listener for the timer processing.

Parameters:
listener - The listener for the timer processing.
tm - Start cycle

registerListenerObj

public ListenerBase registerListenerObj(CallbackFunction cbf,
                                        TimeValue tm)
Registers the callback function started with the timer.

Parameters:
cbf - the callback function
tm - cycle

unregisterListener

public boolean unregisterListener(ListenerBase id)
Deletes the callback function for the timer processing.

Parameters:
id - Listener ID