Class TrafficLight

java.lang.Object
  extended by becker.robots.Sim
      extended by becker.robots.Thing
          extended by TrafficLight
All Implemented Interfaces:
java.lang.Runnable

public class TrafficLight
extends becker.robots.Thing
implements java.lang.Runnable

This class provides support for the Drivers' Ed project found here. An object of this class manages the state of the light by continuously cycling through the 3 states: green > yellow > red > green... and so on.

Author:
Chris Darcy

Constructor Summary
TrafficLight(becker.robots.City c, int s, int a)
           
 
Method Summary
 boolean exitsBlocked()
           
 void run()
          Called by the Thread object.
 
Methods inherited from class becker.robots.Thing
blocksIntersectionEntry, blocksIntersectionExit, canBeCarried, getIntersection, save, setBlocksEntry, setBlocksEntry, setBlocksExit, setBlocksExit, setCanBeCarried, toString
 
Methods inherited from class becker.robots.Sim
getCity, getColor, getIcon, keyTyped, notifyObservers, notifyObservers, setColor, setIcon
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TrafficLight

public TrafficLight(becker.robots.City c,
                    int s,
                    int a)
Method Detail

run

public void run()
Called by the Thread object. Do not call this method yourself. The method runs the Traffic Light continuously changing the state of the light at periodic intervals.

Specified by:
run in interface java.lang.Runnable

exitsBlocked

public boolean exitsBlocked()