de.uni_paderborn.robots.logic
Class RobotTimer

java.lang.Object
  |
  +--de.uni_paderborn.robots.logic.RobotTimer
All Implemented Interfaces:
java.lang.Runnable

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

This class is invented to control the individual time of each Robot. It will tell the GUI when more than 2 seconds have past (after the robot has began to calculate), thus the GUI can change the StatusWindow from the general view to the specific, robot-individual view.


Field Summary
private  boolean finished
          true, after the robot has finished calculating, false otherwise.
private  Robot robot
          The robot for this RobotTimer
private  long totalTimeOfRobot
          The time the robot has needed so fra for ALL his rounds.
private  boolean visible
          true, if the showStatusRobot() method of the GUI has been called, false otherwise.
 
Constructor Summary
(package private) RobotTimer(Robot robot)
          Creates a new RobotTimer object.
 
Method Summary
(package private)  boolean hasStarted()
          returns if the thread has already started.
 void run()
          to run the robotTimer
(package private)  void stopIt()
          to stop the robotTimer
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

robot

private Robot robot
The robot for this RobotTimer

finished

private boolean finished
true, after the robot has finished calculating, false otherwise. Needed for the while-loop.

visible

private boolean visible
true, if the showStatusRobot() method of the GUI has been called, false otherwise.

totalTimeOfRobot

private long totalTimeOfRobot
The time the robot has needed so fra for ALL his rounds.
Constructor Detail

RobotTimer

RobotTimer(Robot robot)
Creates a new RobotTimer object.

Parameters:
robot - The robot belonging to this RobotTimer.
Method Detail

run

public void run()
to run the robotTimer
Specified by:
run in interface java.lang.Runnable

stopIt

void stopIt()
to stop the robotTimer

hasStarted

boolean hasStarted()
returns if the thread has already started.

Returns:
true, if the run() method has already been called, false otherwise.