Class ServiceInterval
- java.lang.Object
-
- org.onebusaway.gtfs.model.calendar.ServiceInterval
-
- All Implemented Interfaces:
Serializable
public final class ServiceInterval extends Object implements Serializable
Specifies an immutable interval of min and max arrival and departure times.- Author:
- bdferris
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ServiceInterval(int arrival, int departure)ServiceInterval(int minArrival, int minDeparture, int maxArrival, int maxDeparture)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ServiceIntervalextend(int arrivalTime, int departureTime)Construct a newServiceIntervalby extending the current service interval, adjusting the arrival and departure intervals to include the additional arrival and departure time specified in the arguments.static ServiceIntervalextend(ServiceInterval serviceInterval, int arrivalTime, int departureTime)intgetMaxArrival()intgetMaxDeparture()intgetMinArrival()intgetMinDeparture()StringtoString()
-
-
-
Constructor Detail
-
ServiceInterval
public ServiceInterval(int arrival, int departure)- Parameters:
arrival- arrival time in seconds since midnightdeparture- departure time in seconds since midnight
-
ServiceInterval
public ServiceInterval(int minArrival, int minDeparture, int maxArrival, int maxDeparture)- Parameters:
minArrival- min arrival time in seconds since midnightminDeparture- min departure time in seconds since midnightmaxArrival- max arrival time in seconds since midnightmaxDeparture- max departue time in seconds since midnight
-
-
Method Detail
-
getMinArrival
public int getMinArrival()
- Returns:
- min arrival time in seconds since midnight
-
getMinDeparture
public int getMinDeparture()
- Returns:
- min departure time in seconds since midnight
-
getMaxArrival
public int getMaxArrival()
- Returns:
- max arrival time in seconds since midnight
-
getMaxDeparture
public int getMaxDeparture()
- Returns:
- max departure time in seconds since midnight
-
extend
public ServiceInterval extend(int arrivalTime, int departureTime)
Construct a newServiceIntervalby extending the current service interval, adjusting the arrival and departure intervals to include the additional arrival and departure time specified in the arguments.- Parameters:
arrivalTime- a new arrival time to incorporate in the extended intervaldepartureTime- a new departure time to incorporate in the extended interval- Returns:
- a new interval with the additional arrival and departure times incorporated
-
extend
public static ServiceInterval extend(ServiceInterval serviceInterval, int arrivalTime, int departureTime)
-
-