Class Router.NavigationDirection
- java.lang.Object
-
- 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.
-
Constructor Summary
Constructors Constructor Description NavigationDirection()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
static Router.NavigationDirection
fromString(java.lang.String dirAsString)
Returns a newNavigationDirection
from a string representation.int
hashCode()
java.lang.String
toString()
-
-
-
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.
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
fromString
public static Router.NavigationDirection fromString(java.lang.String dirAsString)
Returns a newNavigationDirection
from a string representation.- Parameters:
dirAsString
-String
instructions for a navigation direction.- Returns:
- A new
NavigationDirection
based on the string, ornull
if unable to parse.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-