Class TimerThread

java.lang.Object
java.lang.Thread
common.controller.TimerThread
All Implemented Interfaces:
Runnable

public class TimerThread extends Thread

Title:

Description: An inner thread used to stop simulation after timeout elapsed

Author:
Francesco D'Aquino, Bertoli Marco Date: 7-feb-2006 Time: 23.53.25
  • Field Details

    • sim

      protected DispatcherJSIMschema sim
    • totalTime

      protected long totalTime
    • elapsedTime

      protected long elapsedTime
    • initialTime

      protected long initialTime
    • paused

      protected boolean paused
    • killed

      protected boolean killed
    • ended

      protected boolean ended
  • Constructor Details

  • Method Details

    • run

      public void run()
      Thread run's method. It will wait until maxDuration has elapsed, then stops simulation
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread
    • pause

      public void pause()
      This method have to be called when simulation is paused
    • restart

      public void restart()
      This method have to be called when simulation is restarted after pause
    • kill

      public void kill()
      This method have to be called when simulation is stopped before timeout
    • getElapsedTime

      public long getElapsedTime()
      Returns elapsed time
      Returns:
      elapsed time
    • getElapsedPercentage

      public double getElapsedPercentage()
      Returns elapsed percentage
      Returns:
      elapsed percentage