com.here.msdkui.routing

## Class RouteUtil

- java.lang.Object
- - com.here.msdkui.routing.RouteUtil

-     public final class RouteUtil
      extends java.lang.Object

  An utility class facilitating access to various `Route` attributes.

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.lang.String` | `getArrivalTime(android.content.Context context, com.here.android.mpa.routing.Route route, boolean isTraffic)` Gets the arrival time of the associated `Route` with or without traffic.
    `static android.text.Spannable` | `getDetails(android.content.Context context, com.here.android.mpa.routing.Route route, UnitSystem unitSystem)` Gets different details of the associated `Route` like via and others.
    `static java.lang.Integer` | `getIcon(com.here.android.mpa.routing.Route route)` Gets the `RouteOptions.TransportMode` icon of the associated `Route`.
    `static java.lang.String` | `getLongestRoadSegments(com.here.android.mpa.routing.Route route)` Gets the longest road segments of the associated `Route`.
    `static java.lang.String` | `getRouteLength(android.content.Context context, com.here.android.mpa.routing.Route route, UnitSystem unitSystem)` Gets the total length of the associated `Route` as formatted string.
    `static java.util.List<SectionModel>` | `getSectionBar(android.content.Context context, com.here.android.mpa.routing.Route route)` Gets a list of `SectionModel` elements of the associated `Route`.
    `static android.text.Spannable` | `getTimeToArrive(android.content.Context context, com.here.android.mpa.routing.Route route, boolean isTraffic)` Gets the estimated remaining time to arrive at the destination with or without traffic.
    `static android.text.Spannable` | `getTrafficDelayed(android.content.Context context, com.here.android.mpa.routing.Route route)` Gets the traffic delay text of the associated `Route`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getLongestRoadSegments

          public static java.lang.String getLongestRoadSegments(com.here.android.mpa.routing.Route route)

      Gets the longest road segments of the associated `Route`.
      Parameters:
        `route` - a `Route` instance.
      Returns:
        a string containing the longest road segments or an empty string if the route contains no `RoadElement`.

    - #### getTrafficDelayed

          public static android.text.Spannable getTrafficDelayed(android.content.Context context,
                                                                 com.here.android.mpa.routing.Route route)

      Gets the traffic delay text of the associated `Route`.
      Parameters:
        `context` - the required `Context`.
        `route` - a `Route` instance.
      Returns:
        the `Spannable` containing the traffic delay.

    - #### getArrivalTime

          public static java.lang.String getArrivalTime(android.content.Context context,
                                                        com.here.android.mpa.routing.Route route,
                                                        boolean isTraffic)

      Gets the arrival time of the associated `Route` with or without traffic.
      Parameters:
        `context` - the required `Context`.
        `route` - a `Route` instance.
        `isTraffic` - true if traffic situation should be included, false otherwise.
      Returns:
        a string containing the arrival time.

    - #### getRouteLength

          public static java.lang.String getRouteLength(android.content.Context context,
                                                        com.here.android.mpa.routing.Route route,
                                                        UnitSystem unitSystem)

      Gets the total length of the associated `Route` as formatted string.
      Parameters:
        `context` - the required `Context`.
        `route` - a `Route` instance.
        `unitSystem` - unit system `UnitSystem`.
      Returns:
        the formatted route length including units.

    - #### getDetails

          public static android.text.Spannable getDetails(android.content.Context context,
                                                          com.here.android.mpa.routing.Route route,
                                                          UnitSystem unitSystem)

      Gets different details of the associated `Route` like via and others.
      Parameters:
        `context` - the required `Context`.
        `route` - a `Route` instance.
        `unitSystem` - unit system `UnitSystem`.
      Returns:
        a `Spannable` containing the details.

    - #### getTimeToArrive

          public static android.text.Spannable getTimeToArrive(android.content.Context context,
                                                               com.here.android.mpa.routing.Route route,
                                                               boolean isTraffic)

      Gets the estimated remaining time to arrive at the destination with or without traffic.
      Parameters:
        `context` - the required `Context`.
        `route` - a `Route` instance.
        `isTraffic` - true if traffic situation should be included, false otherwise.
      Returns:
        the `Spannable` containing the remaining time to arrive in the format: days-hours-minutes.

    - #### getIcon

          public static java.lang.Integer getIcon(com.here.android.mpa.routing.Route route)

      Gets the `RouteOptions.TransportMode` icon of the associated `Route`.
      Parameters:
        `route` - a `Route` instance.
      Returns:
        an icon indicating the transport mode.

    - #### getSectionBar

          public static java.util.List<SectionModel> getSectionBar(android.content.Context context,
                                                                   com.here.android.mpa.routing.Route route)

      Gets a list of `SectionModel` elements of the associated `Route`.
      Parameters:
        `context` - the required `Context`.
        `route` - a `Route` instance.
      Returns:
        a list containing the `SectionModel` elements.