public class

RoutingInstruction

extends Object
java.lang.Object
   ↳ com.carto.routing.RoutingInstruction

Class Overview

A class that defines a routing instruction at specified position in the path.

Summary

Public Constructors
RoutingInstruction()
Constructs a new RoutingInstruction instance with all values set to default.
RoutingInstruction(RoutingAction action, int pointIndex, String streetName, String instruction, float turnAngle, float azimuth, double distance, double time, Variant geometryTag)
Constructs a new RoutingInstruction instance given all instruction attributes.
Public Methods
synchronized void delete()
boolean equals(Object obj)
Checks if this object is equal to the specified object.
RoutingAction getAction()
Returns the action of the instruction.
float getAzimuth()
Returns the azimuth of the initial position.
double getDistance()
Returns the distance to move along the given street.
Variant getGeometryTag()
Returns the geometry tag associated with the instructions.
String getInstruction()
Returns the optional instruction description.
int getPointIndex()
Returns the index of the first geometry point in external point array.
String getStreetName()
Returns the name of street.
double getTime()
Returns the time approximate duration of the instruction.
float getTurnAngle()
Returns the turn angle of the action.
int hashCode()
Returns the hash value of this object.
String toString()
Creates a string representation of this instruction, useful for logging.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public RoutingInstruction ()

Constructs a new RoutingInstruction instance with all values set to default.

public RoutingInstruction (RoutingAction action, int pointIndex, String streetName, String instruction, float turnAngle, float azimuth, double distance, double time, Variant geometryTag)

Constructs a new RoutingInstruction instance given all instruction attributes.

Parameters
action Action to take.
pointIndex Instruction starting point index in the point list.
streetName Street name.
instruction The optional instruction description.
turnAngle Turn angle in degrees.
azimuth Azimuth in degrees.
distance The distance to move along the given street in meters.
time The approximate duration of the instruction in seconds.
geometryTag The geometry tag associated with the instruction.

Public Methods

public synchronized void delete ()

public boolean equals (Object obj)

Checks if this object is equal to the specified object.

Parameters
obj The reference object.
Returns
  • True when objects are equal, false otherwise.

public RoutingAction getAction ()

Returns the action of the instruction.

Returns
  • The action to take.

public float getAzimuth ()

Returns the azimuth of the initial position.

Returns
  • The azimuth in degrees.

public double getDistance ()

Returns the distance to move along the given street.

Returns
  • The distance to move in meters.

public Variant getGeometryTag ()

Returns the geometry tag associated with the instructions.

Returns
  • The geometry tag associated with the instructions.

public String getInstruction ()

Returns the optional instruction description. This info is dependent on the routing engine (can be empty) and may be localized.

Returns
  • The optional instruction description.

public int getPointIndex ()

Returns the index of the first geometry point in external point array.

Returns
  • The point index.

public String getStreetName ()

Returns the name of street.

Returns
  • The name of the street.

public double getTime ()

Returns the time approximate duration of the instruction.

Returns
  • The approximate duration of the instruction in seconds.

public float getTurnAngle ()

Returns the turn angle of the action.

Returns
  • The turn angle in degrees.

public int hashCode ()

Returns the hash value of this object.

Returns
  • The hash value of this object.

public String toString ()

Creates a string representation of this instruction, useful for logging.

Returns
  • The string representation of this instruction.