public class Semaphore
extends java.lang.Object
Constructor and Description |
---|
Semaphore(java.util.List<Roads.TrafficLight> list)
Constructor of
Semaphore class, allocate the map, sets to 0
timeSpan, calls the method for the disposal of traffic lights' order,
calls the method to obtain the array toCheck. |
Modifier and Type | Method and Description |
---|---|
void |
checkForChanges()
Compares the elapsed time with the time interval and, as a
consequence, change the states of the traffic lights in the cross
Notes: - called by thread's routine in
MapManager . |
java.lang.String |
toString() |
public Semaphore(java.util.List<Roads.TrafficLight> list)
Semaphore
class, allocate the map, sets to 0
timeSpan, calls the method for the disposal of traffic lights' order,
calls the method to obtain the array toCheck.
Notes:
createAssociations()
in MapTiles
.list
- list of the traffic lights in a same crosspublic void checkForChanges()
Notes:
MapManager
.public java.lang.String toString()
toString
in class java.lang.Object