public class Route
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
boolean |
arePropsFulfilled
Flag telling whether the properties are fulfilled to compute the route
|
double |
distance
Route distance in meters
|
java.util.List<Instruction> |
instructions
List of
Instruction to follow |
java.util.ArrayList<RoutePoint> |
route
List of
RoutePoint containing the route |
int |
time
Route time in seconds
|
Constructor and Description |
---|
Route(java.util.ArrayList<RoutePoint> route,
java.util.List<Instruction> instructions,
double distance,
int time,
boolean props)
Route constructor.
|
Modifier and Type | Method and Description |
---|---|
RouteProjectedPoint |
getProjectedPoint(LocationResult loc)
This method returns the projection of the user position to the route.
|
RoutingResult |
getProjection(LocationResult loc)
This method returns a
RoutingResult object to be used. |
Instruction |
getRouteInstruction(LocationResult loc)
This method returns the next instruction to be shown according to the
user position.
|
java.lang.String |
toJson()
This method provides compatibility by returning relevant info into a
JSON String.
|
java.lang.String |
toString()
This method provides a String that contains a JSON array with the
RoutePoint objects for the start and end points, as well as the date
when the route was logged, in this order, encoded in a JSON string.
|
public final java.util.ArrayList<RoutePoint> route
RoutePoint
containing the routepublic final java.util.List<Instruction> instructions
Instruction
to followpublic final double distance
public final int time
public final boolean arePropsFulfilled
public Route(java.util.ArrayList<RoutePoint> route, java.util.List<Instruction> instructions, double distance, int time, boolean props)
route
- List of RoutePoint
containing the listinstructions
- List of Instruction
distance
- Route distance [meters]time
- Route time [seconds]public java.lang.String toJson()
public java.lang.String toString()
toString
in class java.lang.Object
public Instruction getRouteInstruction(LocationResult loc)
loc
- Current user positionpublic RouteProjectedPoint getProjectedPoint(LocationResult loc)
loc
- Current user positionpublic RoutingResult getProjection(LocationResult loc)
RoutingResult
object to be used.loc
- Current user position