OO Programming in Java
Class 8 Homework Assignment
Implement a Traffic Lite Controller
To help you we are providing the Simulator .. a View for your TLC
We will supply the View and the TLCAdapter class. You must edit the stubs for sensor methods and call methods in the adapter to change the states of lites.
The method names shown above near the components are TLCAdapter method names.
Note that the there are only four PedLite (String) methods because the PedLites operate in pairs.
PedLites (String) where String is "walk", "dontwalk" or "dark"
ThruLites (String) where String is "green", "yellow", "red" or "dark"
LeftLites (String) where String is "left", "yellow", "red" or "dark"
Example:
To turn on the south pedestrian lites: | From your TrafficLiteController Class say ....this.tlcAdapter().sPedLite("dontwalk") |
To get called when the south left lane sensor is tripped: |
The TLCAdapter method Inside TLCAdapter:
|