Class RoutingInstruction

java.lang.Object
com.massifmaps.routing.RoutingInstruction

public class RoutingInstruction extends Object
A class that defines a routing instruction at specified position in the path.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new RoutingInstruction instance with all values set to default.
    RoutingInstruction(int 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.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks if this object is equal to the specified object.
    int
    Returns the action of the instruction.
    float
    Returns the azimuth of the initial position.
    double
    Returns the distance to move along the given street.
    Returns the geometry tag associated with the instructions.
    Returns the optional instruction description.
    int
    Returns the index of the first geometry point in external point array.
    Returns the name of street.
    double
    Returns the time approximate duration of the instruction.
    float
    Returns the turn angle of the action.
    int
    Returns the hash value of this object.
    Creates a string representation of this instruction, useful for logging.

    Methods inherited from class java.lang.Object

    clone, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • RoutingInstruction

      public RoutingInstruction()
      Constructs a new RoutingInstruction instance with all values set to default.
    • RoutingInstruction

      public RoutingInstruction(int 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.
  • Method Details

    • equals

      public boolean equals(Object obj)
      Checks if this object is equal to the specified object.
      Overrides:
      equals in class Object
      Parameters:
      obj - The reference object.
      Returns:
      True when objects are equal, false otherwise.
    • hashCode

      public int hashCode()
      Returns the hash value of this object.
      Overrides:
      hashCode in class Object
      Returns:
      The hash value of this object.
    • getAction

      public int getAction()
      Returns the action of the instruction.
      Returns:
      The action to take.
    • getPointIndex

      public int getPointIndex()
      Returns the index of the first geometry point in external point array.
      Returns:
      The point index.
    • getStreetName

      public String getStreetName()
      Returns the name of street.
      Returns:
      The name of the street.
    • getInstruction

      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.
    • getTurnAngle

      public float getTurnAngle()
      Returns the turn angle of the action.
      Returns:
      The turn angle in degrees.
    • getAzimuth

      public float getAzimuth()
      Returns the azimuth of the initial position.
      Returns:
      The azimuth in degrees.
    • getDistance

      public double getDistance()
      Returns the distance to move along the given street.
      Returns:
      The distance to move in meters.
    • getTime

      public double getTime()
      Returns the time approximate duration of the instruction.
      Returns:
      The approximate duration of the instruction in seconds.
    • getGeometryTag

      public Variant getGeometryTag()
      Returns the geometry tag associated with the instructions.
      Returns:
      The geometry tag associated with the instructions.
    • toString

      public String toString()
      Creates a string representation of this instruction, useful for logging.
      Overrides:
      toString in class Object
      Returns:
      The string representation of this instruction.