Class Router.NavigationDirection

  • Enclosing class:
    Router

    public static class Router.NavigationDirection
    extends java.lang.Object
    Class to represent a navigation direction, which consists of 3 attributes: a direction to go, a way, and the distance to travel for.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) int direction
      The direction represented.
      static java.lang.String[] DIRECTIONS
      A mapping of integer values to directions.
      (package private) double distance
      The distance along this way.
      static int LEFT
      Integer constants representing directions.
      static int NUM_DIRECTIONS
      Number of directions supported.
      static int RIGHT
      Integer constants representing directions.
      static int SHARP_LEFT
      Integer constants representing directions.
      static int SHARP_RIGHT
      Integer constants representing directions.
      static int SLIGHT_LEFT
      Integer constants representing directions.
      static int SLIGHT_RIGHT
      Integer constants representing directions.
      static int START
      Integer constants representing directions.
      static int STRAIGHT
      Integer constants representing directions.
      (package private) java.lang.String way
      The name of this way.
    • Field Detail

      • START

        public static final int START
        Integer constants representing directions.
        See Also:
        Constant Field Values
      • STRAIGHT

        public static final int STRAIGHT
        Integer constants representing directions.
        See Also:
        Constant Field Values
      • SLIGHT_LEFT

        public static final int SLIGHT_LEFT
        Integer constants representing directions.
        See Also:
        Constant Field Values
      • SLIGHT_RIGHT

        public static final int SLIGHT_RIGHT
        Integer constants representing directions.
        See Also:
        Constant Field Values
      • RIGHT

        public static final int RIGHT
        Integer constants representing directions.
        See Also:
        Constant Field Values
      • LEFT

        public static final int LEFT
        Integer constants representing directions.
        See Also:
        Constant Field Values
      • SHARP_LEFT

        public static final int SHARP_LEFT
        Integer constants representing directions.
        See Also:
        Constant Field Values
      • SHARP_RIGHT

        public static final int SHARP_RIGHT
        Integer constants representing directions.
        See Also:
        Constant Field Values
      • NUM_DIRECTIONS

        public static final int NUM_DIRECTIONS
        Number of directions supported.
        See Also:
        Constant Field Values
      • DIRECTIONS

        public static final java.lang.String[] DIRECTIONS
        A mapping of integer values to directions.
      • direction

        int direction
        The direction represented.
      • way

        java.lang.String way
        The name of this way.
      • distance

        double distance
        The distance along this way.
    • Constructor Detail

      • NavigationDirection

        public NavigationDirection()
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • fromString

        public static Router.NavigationDirection fromString​(java.lang.String dirAsString)
        Returns a new NavigationDirection from a string representation.
        Parameters:
        dirAsString - String instructions for a navigation direction.
        Returns:
        A new NavigationDirection based on the string, or null if unable to parse.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object