Class Diagram.RouteStep
- java.lang.Object
-
- org.opentrafficsim.trafficcontrol.trafcod.Diagram.RouteStep
-
-
Constructor Summary
Constructors Constructor Description RouteStep(int x, int y)
Construct a RouteStep that has a NO_OP command.RouteStep(int x, int y, Diagram.Command command)
Construct a RouteStep with a command condition.RouteStep(Diagram.Command command)
Construct a RouteStep for ELSE or END_IF command.RouteStep(Diagram.Command command, int streamCondition)
Construct a RouteStep with a command condition.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Diagram.Command
getCommand()
Retrieve the command.int
getStreamCondition()
Retrieve the stream condition.int
getX()
Retrieve the X object.int
getY()
Retrieve the Y object.String
toString()
-
-
-
Constructor Detail
-
RouteStep
RouteStep(int x, int y)
Construct a RouteStep that has a NO_OP command.- Parameters:
x
- int; the X object at the end of this route stepy
- int; the Y object at the end of this route step
-
RouteStep
RouteStep(int x, int y, Diagram.Command command) throws TrafficLightException
Construct a RouteStep with a command condition.- Parameters:
x
- int; the X object at the end of this route stepy
- int; the Y object at the end of this route stepcommand
- Command; a STOP_LINE or NO_OP command- Throws:
TrafficLightException
- when an IF or ELSE_IF has an invalid streamCondition, or when an ELSE or END_IF has a valid streamCOndition
-
RouteStep
RouteStep(Diagram.Command command, int streamCondition) throws TrafficLightException
Construct a RouteStep with a command condition.- Parameters:
command
- Command; an IF, ELSE, ENDIF, or ELSE_IF commandstreamCondition
- int; the stream that must exist for the condition to be true- Throws:
TrafficLightException
- when an IF or ELSE_IF has an invalid streamCondition, or when an ELSE or END_IF has a valid streamCOndition
-
RouteStep
RouteStep(Diagram.Command command) throws TrafficLightException
Construct a RouteStep for ELSE or END_IF command.- Parameters:
command
- Command; eitherCommand.ELSE
orCommand.END_IF
- Throws:
TrafficLightException
- when the Command is not ELSE or END_IF
-
-
Method Detail
-
getX
public int getX()
Retrieve the X object.- Returns:
- int; the X object
-
getY
public int getY()
Retrieve the Y object.- Returns:
- int; the Y object
-
getCommand
public Diagram.Command getCommand()
Retrieve the command.- Returns:
- Command
-
getStreamCondition
public int getStreamCondition()
Retrieve the stream condition.- Returns:
- int; the streamCondition
-
-