Class Diagram.RouteStep

  • Enclosing class:
    Diagram

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