Class Diagram.RouteStep

java.lang.Object
org.opentrafficsim.trafficcontrol.trafcod.Diagram.RouteStep
Enclosing class:
Diagram

class Diagram.RouteStep extends Object
Step in a schematic route through the intersection.
  • 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 step
      y - 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 step
      y - int; the Y object at the end of this route step
      command - 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 command
      streamCondition - 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; either Command.ELSE or Command.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

      public Diagram.Command getCommand()
      Retrieve the command.
      Returns:
      Command
    • getStreamCondition

      public int getStreamCondition()
      Retrieve the stream condition.
      Returns:
      int; the streamCondition
    • toString

      public String toString()
      Overrides:
      toString in class Object