public class Semaforo { public Semaforo (int ft, int tt){ followTime = ft; transitionTime = tt; state = State.STOP; } public void turnStop() { state = State.STOP; } public void turnTransition() { state = State.TRANSITION; } public void turnFollow() { state = State.FOLLOW; } public int getFollowTime() { return followTime; } public int getTransitionTime() { return transitionTime; } public String toString() { switch(state) { case STOP: return "0"; case TRANSITION: return "1"; case FOLLOW: return "3"; default: return "!!"; } } public enum State {STOP, TRANSITION, FOLLOW} private int followTime; private int transitionTime; protected State state; }