Package es.situm.sdk.model.directions
Class Route
- java.lang.Object
-
- es.situm.sdk.model.directions.Route
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRoute.BuilderHelper class to create well formed instances of @{link es.situm.
-
Constructor Summary
Constructors Constructor Description Route(DirectionsRequest request, List<RouteStep> steps, List<Indication> indications, Building building, Collection<Floor> buildingFloors)Just for internal SDK use
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intdescribeContents()booleanequals(Object o)DirectionsRequest.AccessibilityModegetAccessibilityMode()Returns the current route accessibility mode.doublegetDistance()Returns the route distance (in meters)Collection<RouteStep>getEdges()Equal togetSteps().RouteStepgetFirstStep()Returns first stepPointgetFrom()Point where the route starts.List<Indication>getIndications()Return ordered list of instructions to go to the destinationRouteStepgetLastStep()Returns last stepCollection<Point>getNodes()Returns a collection of points of the route (not ordered)List<Point>getPoints()Returns list of ordered points of the route.DirectionsRequestgetRequest()Returns the search criteria, provided toDirectionsManager, whose result is the currentRoute.List<Restriction>getRestrictions()Returns a list ofRestrictioninstances in case the route does not conform with one or manyDirectionsModifierindicated on Directions APIDirectionsManager.requestDirections(DirectionsRequest, Handler).es.situm.sdk.model.directions.internal.route.InternalRouteInfogetRouteInfo()Just for internal SDK use.List<RouteSegment>getSegments()Return list of ordered points split by floor, each list contains points from one floor, but can have multiple lists of the same floor.RouteStepgetStep(int stepId)Returns a route step by itsRouteStep.getId()List<RouteStep>getSteps()Returns ordered list of steps to go to the goal pointPointgetTo()Last point and goal of the route.inthashCode()IndicationindicationForNextStep(int routeStepIndex)Returns the next indication to a given step.booleanisAccessible()Deprecated.List<Point>points()Returns the list of points of the complete route for all the steps from beginning to finishStringtoString()voidwriteToParcel(android.os.Parcel dest, int flags)
-
-
-
Field Detail
-
CREATOR
public static final android.os.Parcelable.Creator<Route> CREATOR
-
-
Constructor Detail
-
Route
public Route(@NonNull DirectionsRequest request, @NonNull List<RouteStep> steps, List<Indication> indications, @NonNull Building building, @NonNull Collection<Floor> buildingFloors)Just for internal SDK use- Throws:
IllegalArgumentException- if null value is provided to NonNull parameter, or empty list is provided to size(min = 1) parameter
-
-
Method Detail
-
getEdges
@NonNull public Collection<RouteStep> getEdges()
Equal togetSteps().
-
getNodes
@NonNull public Collection<Point> getNodes()
Returns a collection of points of the route (not ordered)
-
getPoints
@NonNull public List<Point> getPoints()
Returns list of ordered points of the route. If you want the points to display them in a map usegetSegments()- Returns:
- non-empty group of points
-
getSegments
@NonNull public List<RouteSegment> getSegments()
Return list of ordered points split by floor, each list contains points from one floor, but can have multiple lists of the same floor. Use this method to display segments in a map, each list should be a polyline.For example, if there is no path to go to the other side of the same floor and you need to go up one floor and then go down again to the original floor, this method will return one segment on the current floor, one segment on the upper floor and one more segment in the current floor.
Drawing example: if you want to draw all the points of a floor, you should draw a polyline for each list that contains the floor you want to show.
-
getSteps
@NonNull public List<RouteStep> getSteps()
Returns ordered list of steps to go to the goal point- Returns:
- non-empty list of
RouteStep
-
getFirstStep
@NonNull public RouteStep getFirstStep()
Returns first step- Returns:
- step whose
RouteStep.getFrom()is the request parameterDirectionsRequest.getFrom()
-
getLastStep
@NonNull public RouteStep getLastStep()
Returns last step- Returns:
- step whose
RouteStep.getTo()is the request parameterDirectionsRequest.getTo()
-
getStep
@Nullable public RouteStep getStep(int stepId)
Returns a route step by itsRouteStep.getId()- Parameters:
stepId- id of step (RouteStep.getId())- Returns:
- step with provided id, or null if there is no match.
-
getRouteInfo
@NonNull public es.situm.sdk.model.directions.internal.route.InternalRouteInfo getRouteInfo()
Just for internal SDK use. This method can be changed at any version without previous deprecation warn.
-
getIndications
@NonNull public List<Indication> getIndications()
Return ordered list of instructions to go to the destination
-
getRequest
@NonNull public DirectionsRequest getRequest()
Returns the search criteria, provided toDirectionsManager, whose result is the currentRoute.- Returns:
- original
DirectionsRequest
-
isAccessible
@Deprecated public boolean isAccessible()
Deprecated.Returns whether the current route is suitable to wheel chairs (true) or not (false). WrapsDirectionsRequest.isAccessible()fromgetRequest().- Returns:
- true if the route is suitable to wheel chairs
-
getAccessibilityMode
public DirectionsRequest.AccessibilityMode getAccessibilityMode()
Returns the current route accessibility mode. WrapsDirectionsRequest.getAccessibilityMode()()} fromgetRequest().- Returns:
DirectionsRequest.AccessibilityMode
-
getFrom
@NonNull public Point getFrom()
Point where the route starts. The same asDirectionsRequest.getFrom()fromgetRequest().- Returns:
Point
-
getTo
@NonNull public Point getTo()
Last point and goal of the route. The same asDirectionsRequest.getTo()fromgetTo().- Returns:
Point
-
indicationForNextStep
@NonNull public Indication indicationForNextStep(int routeStepIndex)
Returns the next indication to a given step. The indication can be associated to more than one steps.- Parameters:
routeStepIndex- the index of a route step inside a route- Returns:
Indicationobject or empty if the routeStepIndex is not valid
-
points
public List<Point> points()
Returns the list of points of the complete route for all the steps from beginning to finish- Returns:
- List of points
Pointobject or empty list
-
getDistance
public double getDistance()
Returns the route distance (in meters)
-
describeContents
public int describeContents()
- Specified by:
describeContentsin interfaceandroid.os.Parcelable
-
writeToParcel
public void writeToParcel(android.os.Parcel dest, int flags)- Specified by:
writeToParcelin interfaceandroid.os.Parcelable
-
getRestrictions
public List<Restriction> getRestrictions()
Returns a list ofRestrictioninstances in case the route does not conform with one or manyDirectionsModifierindicated on Directions APIDirectionsManager.requestDirections(DirectionsRequest, Handler). Every restriction indicates which @{link DirectionModifier} could not be fulfilled. This way a developer act accordingly (for example, notifying the user, computing a different route, ...). NOTE: For now this function will always be empty, as it is not implemented. This behaviour will change in future versions.- Returns:
- list of
Restrictioninstances.
-
-