Class Diagram.RouteStep
java.lang.Object
org.opentrafficsim.trafficcontrol.trafcod.Diagram.RouteStep
- Enclosing class:
- Diagram
Step in a schematic route through the intersection.
-
Constructor Summary
ConstructorDescriptionRouteStep
(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
-
Constructor Details
-
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 TrafficControlException 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:
TrafficControlException
- 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 TrafficControlException 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:
TrafficControlException
- 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 TrafficControlException Construct a RouteStep for ELSE or END_IF command.- Parameters:
command
- Command; eitherCommand.ELSE
orCommand.END_IF
- Throws:
TrafficControlException
- when the Command is not ELSE or END_IF
-
-
Method Details
-
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
Retrieve the command.- Returns:
- Command
-
getStreamCondition
public int getStreamCondition()Retrieve the stream condition.- Returns:
- int; the streamCondition
-
toString
-