Class Distance


  • public class Distance
    extends Object
    Travel cost (distance between two locations or the length of a route).
    • Field Detail

      • ZERO

        public static final Distance ZERO
        Zero distance, for example the distance from a location to itself.
    • Method Detail

      • ofMillis

        public static Distance ofMillis​(long millis)
        Create a distance of the given milliseconds.
        Parameters:
        millis - must be positive or zero
        Returns:
        distance
      • millis

        public long millis()
        Distance in milliseconds.
        Returns:
        positive number or zero
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object