AI-generated Key Takeaways
- 
          TimeAndDistanceis an immutable class representing both the time and distance to a destination.
- 
          It provides methods to retrieve the time in seconds ( getSeconds()), distance in meters (getMeters()), and traffic delay severity (getDelaySeverity()).
- 
          Traffic delay severity is categorized using constants: DELAY_NODATA,DELAY_HEAVY,DELAY_MEDIUM, andDELAY_LIGHT.
- 
          The class offers constructors to create TimeAndDistanceobjects with or without specifying the delay severity.
A TimeAndDistance is an immutable class which represents both time and distance to a destination.
Nested Class Summary
| @interface | TimeAndDistance.DelaySeverity | Indicates how heavy traffic is. | |
Constant Summary
| int | DELAY_HEAVY | |
| int | DELAY_LIGHT | |
| int | DELAY_MEDIUM | |
| int | DELAY_NODATA | 
Public Constructor Summary
| 
                TimeAndDistance(int seconds, int meters)
               | |
| 
                TimeAndDistance(int seconds, int meters, int delaySeverity)
               | 
Public Method Summary
| int | |
| int | |
| int | 
Inherited Method Summary
Constants
public static final int DELAY_HEAVY
public static final int DELAY_LIGHT
public static final int DELAY_MEDIUM
public static final int DELAY_NODATA
Public Constructors
public TimeAndDistance (int seconds, int meters)
Parameters
| seconds | |
|---|---|
| meters | 
public TimeAndDistance (int seconds, int meters, int delaySeverity)
Parameters
| seconds | |
|---|---|
| meters | |
| delaySeverity |