Package com.massifmaps.routing
Class RoutingInstruction
java.lang.Object
com.massifmaps.routing.RoutingInstruction
A class that defines a routing instruction at specified position in the path.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs 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 TypeMethodDescriptionbooleanChecks if this object is equal to the specified object.intReturns the action of the instruction.floatReturns the azimuth of the initial position.doubleReturns the distance to move along the given street.Returns the geometry tag associated with the instructions.Returns the optional instruction description.intReturns the index of the first geometry point in external point array.Returns the name of street.doublegetTime()Returns the time approximate duration of the instruction.floatReturns the turn angle of the action.inthashCode()Returns the hash value of this object.toString()Creates a string representation of this instruction, useful for logging.
-
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
Checks if this object is equal to the specified object. -
hashCode
public int hashCode()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
Returns the name of street.- Returns:
- The name of the street.
-
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
Returns the geometry tag associated with the instructions.- Returns:
- The geometry tag associated with the instructions.
-
toString
Creates a string representation of this instruction, useful for logging.
-