Class RouteLeg

java.lang.Object
com.codename1.maps.routing.RouteLeg

public final class RouteLeg extends Object
The portion of a Route between two consecutive stops. A direct journey has a single leg; each RouteRequest.addWaypoint(LatLng) adds another.
  • Constructor Details

    • RouteLeg

      public RouteLeg(String summary, double distanceMeters, double durationSeconds, List steps)

      Creates a leg. Called by RouteService implementations.

      Parameters
      • summary: a short description such as the major roads used

      • distanceMeters: the length of the leg in meters

      • durationSeconds: the estimated travel time in seconds

      • steps: the RouteSteps of this leg, defensively copied

  • Method Details

    • getSummary

      public String getSummary()
      A short description of the leg, typically the major roads it uses.
    • getDistanceMeters

      public double getDistanceMeters()
      The length of this leg in meters.
    • getDurationSeconds

      public double getDurationSeconds()
      The estimated travel time for this leg in seconds.
    • getSteps

      public List getSteps()
      The unmodifiable list of RouteSteps making up this leg. Empty when the request had RouteRequest.setSteps(boolean) turned off.
    • toString

      public String toString()
      Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: getClass().getName() + '@' + Integer.toHexString(hashCode())
      Overrides:
      toString in class Object