Package es.situm.sdk.model.directions
Class RouteStep
- java.lang.Object
-
- es.situm.sdk.model.directions.RouteStep
-
- All Implemented Interfaces:
android.os.Parcelable,es.situm.sdk.model.directions.graph.Edge<Point>
public class RouteStep extends Object implements es.situm.sdk.model.directions.graph.Edge<Point>, android.os.Parcelable
A fragment of a route, described by the initial pointfromand the last pointtoof the fragment, and some information about the step within the route.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRouteStep.BuilderRouteStepbuilder static inner class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intdescribeContents()booleanequals(Object o)DoublegetDistance()DoublegetDistanceToFloorChange()doublegetDistanceToGoal()PointgetFrom()Start point of this step.intgetId()Position of this RouteStep in the list of steps (Route.getSteps()) of the route to which it belongs.List<String>getTags()PointgetTo()End point of this step.DoublegetWeight()booleanhasFloorChange()Returns true if the floor changes in this step.inthashCode()booleanisAccessible()booleanisFirst()Returns true if this is the first step in the route.booleanisLast()Returns true if this is the last step in the route.StringlookupKey()voidsetTags(List<String> tags)voidsetWeight(Double weight)StringtoString()voidwriteToParcel(android.os.Parcel dest, int flags)
-
-
-
Field Detail
-
EMPTY_ID
public static final int EMPTY_ID
- See Also:
- Constant Field Values
-
EMPTY
public static final RouteStep EMPTY
-
CREATOR
public static final android.os.Parcelable.Creator<RouteStep> CREATOR
-
-
Method Detail
-
getId
public int getId()
Position of this RouteStep in the list of steps (Route.getSteps()) of the route to which it belongs. Also works as an unique identifier of this RouteStep in theRoute.- Returns:
- -1 if this routeStep is not valid. Otherwise a valid position in the list of steps.
-
getFrom
@NonNull public Point getFrom()
Start point of this step.- Specified by:
getFromin interfacees.situm.sdk.model.directions.graph.Edge<Point>- Returns:
- point in the route.
-
getTo
@NonNull public Point getTo()
End point of this step.- Specified by:
getToin interfacees.situm.sdk.model.directions.graph.Edge<Point>- Returns:
- point in the route
-
getDistanceToGoal
public double getDistanceToGoal()
Returns distance in meters between the start point of this step (getFrom()) and the last point in the route (getTo()of the last step).- Returns:
- meters.
-
getDistanceToFloorChange
public Double getDistanceToFloorChange()
Returns distance in meters between the start point of this step (getFrom()) and the first point in the route (getFrom()) of the next step which requires a floor change.- Returns:
- meters.
-
getDistance
@NonNull public Double getDistance()
- Specified by:
getDistancein interfacees.situm.sdk.model.directions.graph.Edge<Point>- Returns:
- meters.
-
getWeight
@NonNull public Double getWeight()
- Specified by:
getWeightin interfacees.situm.sdk.model.directions.graph.Edge<Point>
-
setWeight
public void setWeight(@NonNull Double weight)- Specified by:
setWeightin interfacees.situm.sdk.model.directions.graph.Edge<Point>
-
setTags
public void setTags(@NonNull List<String> tags)- Specified by:
setTagsin interfacees.situm.sdk.model.directions.graph.Edge<Point>
-
getTags
@NonNull public List<String> getTags()
- Specified by:
getTagsin interfacees.situm.sdk.model.directions.graph.Edge<Point>
-
isAccessible
public boolean isAccessible()
- Specified by:
isAccessiblein interfacees.situm.sdk.model.directions.graph.Edge<Point>
-
isFirst
public boolean isFirst()
Returns true if this is the first step in the route. False otherwise.- Returns:
- boolean
-
isLast
public boolean isLast()
Returns true if this is the last step in the route. False otherwise.- Returns:
- boolean
-
hasFloorChange
public boolean hasFloorChange()
Returns true if the floor changes in this step. False otherwise
-
lookupKey
public String lookupKey()
-
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
-
-