All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opentripplanner.model.plan.LegRealTimeEstimate Maven / Gradle / Ivy

The newest version!
package org.opentripplanner.model.plan;

import java.time.Duration;
import java.time.ZonedDateTime;
import java.util.Objects;

/**
 * Realtime information about a vehicle at a certain place. Meant to be used in transit legs.
 */
public class LegRealTimeEstimate {

  private final ZonedDateTime time;
  private final Duration delay;

  /**
   * @param delay Delay or "earliness" of a vehicle. Earliness is expressed as a negative number.
   */
  public LegRealTimeEstimate(ZonedDateTime time, Duration delay) {
    this.time = Objects.requireNonNull(time);
    this.delay = Objects.requireNonNull(delay);
  }

  public ZonedDateTime time() {
    return time;
  }

  public Duration delay() {
    return delay;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy