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>, MapperInterface

public class RouteStep extends Object implements es.situm.sdk.model.directions.graph.Edge<Point>, android.os.Parcelable, MapperInterface
A fragment of a route, described by the initial point from and the last point to of the fragment, and some information about the step within the route.
  • Field Details

    • EMPTY_ID

      public static final int EMPTY_ID
      See Also:
    • EMPTY

      public static final RouteStep EMPTY
    • CREATOR

      public static final android.os.Parcelable.Creator<RouteStep> CREATOR
  • Method Details

    • getId

      @IntRange(from=-1L) 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 the Route.
      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 interface es.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 interface es.situm.sdk.model.directions.graph.Edge<Point>
      Returns:
      point in the route
    • getDistanceToGoal

      @FloatRange(from=0.0) 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

      @FloatRange(from=0.0) 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 @FloatRange(from=0.0) public Double getDistance()
      Returns distance between getFrom() and getTo() in meters.
      Specified by:
      getDistance in interface es.situm.sdk.model.directions.graph.Edge<Point>
      Returns:
      meters.
    • getWeight

      @NonNull public Double getWeight()
      Specified by:
      getWeight in interface es.situm.sdk.model.directions.graph.Edge<Point>
    • setWeight

      public void setWeight(@NonNull Double weight)
      Specified by:
      setWeight in interface es.situm.sdk.model.directions.graph.Edge<Point>
    • setTags

      public void setTags(@NonNull List<String> tags)
      Specified by:
      setTags in interface es.situm.sdk.model.directions.graph.Edge<Point>
    • getTags

      @NonNull public List<String> getTags()
      Specified by:
      getTags in interface es.situm.sdk.model.directions.graph.Edge<Point>
    • isAccessible

      public boolean isAccessible()
      Specified by:
      isAccessible in interface es.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
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • lookupKey

      public String lookupKey()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • describeContents

      public int describeContents()
      Specified by:
      describeContents in interface android.os.Parcelable
    • writeToParcel

      public void writeToParcel(android.os.Parcel dest, int flags)
      Specified by:
      writeToParcel in interface android.os.Parcelable
    • toMap

      public Map<String,Object> toMap()
      Description copied from interface: MapperInterface
      Method to transform object into Map<String, Object>
      Specified by:
      toMap in interface MapperInterface
      Returns:
      Map<String, Object> with the information of the object mapped
    • fromMap

      public static RouteStep fromMap(Map<String,Object> map) throws IllegalArgumentException
      Throws:
      IllegalArgumentException