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 pointfrom
and the last pointto
of the fragment, and some information about the step within the route.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RouteStep.Builder
RouteStep
builder static inner class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
describeContents()
boolean
equals(Object o)
Double
getDistance()
Double
getDistanceToFloorChange()
double
getDistanceToGoal()
Point
getFrom()
Start point of this step.int
getId()
Position of this RouteStep in the list of steps (Route.getSteps()
) of the route to which it belongs.List<String>
getTags()
Point
getTo()
End point of this step.Double
getWeight()
boolean
hasFloorChange()
Returns true if the floor changes in this step.int
hashCode()
boolean
isAccessible()
boolean
isFirst()
Returns true if this is the first step in the route.boolean
isLast()
Returns true if this is the last step in the route.String
lookupKey()
void
setTags(List<String> tags)
void
setWeight(Double weight)
String
toString()
void
writeToParcel(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:
getFrom
in 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:
getTo
in 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:
getDistance
in interfacees.situm.sdk.model.directions.graph.Edge<Point>
- Returns:
- meters.
-
getWeight
@NonNull public Double getWeight()
- Specified by:
getWeight
in interfacees.situm.sdk.model.directions.graph.Edge<Point>
-
setWeight
public void setWeight(@NonNull Double weight)
- Specified by:
setWeight
in interfacees.situm.sdk.model.directions.graph.Edge<Point>
-
setTags
public void setTags(@NonNull List<String> tags)
- Specified by:
setTags
in interfacees.situm.sdk.model.directions.graph.Edge<Point>
-
getTags
@NonNull public List<String> getTags()
- Specified by:
getTags
in interfacees.situm.sdk.model.directions.graph.Edge<Point>
-
isAccessible
public boolean isAccessible()
- Specified by:
isAccessible
in 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:
describeContents
in interfaceandroid.os.Parcelable
-
writeToParcel
public void writeToParcel(android.os.Parcel dest, int flags)
- Specified by:
writeToParcel
in interfaceandroid.os.Parcelable
-
-