public class Light
extends java.lang.Object
Constructor and Description |
---|
Light(int period,
int green)
Constructs and initializes a light.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isGreen()
Checks if the light is green.
|
static void |
main(java.lang.String[] args)
Demonstrates the stepping of a signal.
|
java.lang.String |
toString()
Returns a string representation of the signal.
|
public Light(int period, int green)
period
- the total periodgreen
- the number of time steps the signal is greenpublic boolean isGreen()
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)