HPSearch

cgl.hpsearch.common
Class Timer

java.lang.Object
  extended byjava.lang.Thread
      extended bycgl.hpsearch.common.Timer
All Implemented Interfaces:
Runnable

public class Timer
extends Thread

Implements a Timer that triggers an event on timeout.
Created on May 26, 2004

Author:
Harshawardhan Gadgil (hgadgil@grids.ucs.indiana.edu)

Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Timer()
           
Timer(int to, TimerExpiryListener client, Object o)
          Creates a new Timer object
 
Method Summary
 void reset()
          Resets and restarts the timer
 void run()
           
 void setTimeout(int to)
          Resets the timout to a new value
 void stopTimer()
          Stops the timer.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Timer

public Timer()

Timer

public Timer(int to,
             TimerExpiryListener client,
             Object o)
Creates a new Timer object

Parameters:
to - - default timeout in seconds
Method Detail

setTimeout

public void setTimeout(int to)
Resets the timout to a new value

Parameters:
to - - the new timeout in seconds

reset

public void reset()
Resets and restarts the timer


stopTimer

public void stopTimer()
Stops the timer. This also ends the Thread associated w/ the timer object


run

public void run()

HPSearch

For comments and suggestions please send e-mail to Harshawardhan Gadgil
Last updated: June 9 2006