Class RouteStep

  • All Implemented Interfaces:
    android.os.Parcelable, es.situm.sdk.model.directions.graph.Edge<Point>, MapperInterface

    public class RouteStep
    extends java.lang.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.
    • Method Detail

      • 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 java.lang.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 java.lang.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 java.lang.Double getWeight()
        Specified by:
        getWeight in interface es.situm.sdk.model.directions.graph.Edge<Point>
      • setWeight

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

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

        @NonNull
        public java.util.List<java.lang.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​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

        public java.lang.String lookupKey()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.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 java.util.Map<java.lang.String,​java.lang.Object> toMap()
        Description copied from interface: MapperInterface
        Method to transform object into Map
        Specified by:
        toMap in interface MapperInterface
        Returns:
        Map with the information of the object mapped
      • fromMap

        public static RouteStep fromMap​(java.util.Map<java.lang.String,​java.lang.Object> map)
                                 throws java.lang.IllegalArgumentException
        Throws:
        java.lang.IllegalArgumentException