LaneDirection


@CarProtocol
public final class LaneDirection


Defines the possible directions a driver can go when using a particular lane at a particular step in the navigation.

These directions can be combined and sent to the host to display a lane configuration to the user.

See also
Lane

Summary

Constants

static final int

Regular left turn, from 45 (included) to 135 (excluded) degrees.

static final int

Regular right turn, from 45 (included) to 135 (excluded) degrees.

static final int

Sharp left turn, from 135 (included) to 175 (excluded) degrees.

static final int

Sharp right turn, from 135 (included) to 175 (excluded) degrees.

static final int

Slight left turn, from 10 (included) to 45 (excluded) degrees.

static final int

Slight right turn, from 10 (included) to 45 (excluded) degrees.

static final int

No turn.

static final int

The shape is unknown, in which case no lane information should be shown.

static final int

A left turn onto the opposite side of the same street, from 175 (included) to 180 (included) degrees

static final int

A right turn onto the opposite side of the same street, from 175 (included) to 180 (included) degrees

Public methods

static @NonNull LaneDirection
create(int shape, boolean isRecommended)

Constructs a new instance of a LaneDirection.

boolean
int

Returns shape of this lane direction.

int
boolean

Returns whether this is a direction the driver should take in order to stay on the navigation route.

@NonNull String

Constants

SHAPE_NORMAL_LEFT

Added in 1.0.0
public static final int SHAPE_NORMAL_LEFT = 5

Regular left turn, from 45 (included) to 135 (excluded) degrees.

SHAPE_NORMAL_RIGHT

Added in 1.0.0
public static final int SHAPE_NORMAL_RIGHT = 6

Regular right turn, from 45 (included) to 135 (excluded) degrees.

SHAPE_SHARP_LEFT

Added in 1.0.0
public static final int SHAPE_SHARP_LEFT = 7

Sharp left turn, from 135 (included) to 175 (excluded) degrees.

SHAPE_SHARP_RIGHT

Added in 1.0.0
public static final int SHAPE_SHARP_RIGHT = 8

Sharp right turn, from 135 (included) to 175 (excluded) degrees.

SHAPE_SLIGHT_LEFT

Added in 1.0.0
public static final int SHAPE_SLIGHT_LEFT = 3

Slight left turn, from 10 (included) to 45 (excluded) degrees.

SHAPE_SLIGHT_RIGHT

Added in 1.0.0
public static final int SHAPE_SLIGHT_RIGHT = 4

Slight right turn, from 10 (included) to 45 (excluded) degrees.

SHAPE_STRAIGHT

Added in 1.0.0
public static final int SHAPE_STRAIGHT = 2

No turn.

SHAPE_UNKNOWN

Added in 1.0.0
public static final int SHAPE_UNKNOWN = 1

The shape is unknown, in which case no lane information should be shown.

SHAPE_U_TURN_LEFT

Added in 1.0.0
public static final int SHAPE_U_TURN_LEFT = 9

A left turn onto the opposite side of the same street, from 175 (included) to 180 (included) degrees

SHAPE_U_TURN_RIGHT

Added in 1.0.0
public static final int SHAPE_U_TURN_RIGHT = 10

A right turn onto the opposite side of the same street, from 175 (included) to 180 (included) degrees

Public methods

create

Added in 1.0.0
public static @NonNull LaneDirection create(int shape, boolean isRecommended)

Constructs a new instance of a LaneDirection.

Parameters
int shape

one of the SHAPE_* static constants defined in this class

boolean isRecommended

indicates whether the LaneDirection is the one the driver should take in order to stay on the navigation route

equals

public boolean equals(@Nullable Object other)

getShape

Added in 1.0.0
public int getShape()

Returns shape of this lane direction.

hashCode

public int hashCode()

isRecommended

Added in 1.0.0
public boolean isRecommended()

Returns whether this is a direction the driver should take in order to stay on the navigation route.

toString

public @NonNull String toString()