org.onebusaway.gtfs.model.calendar
Class ServiceInterval

java.lang.Object
  extended by 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
ServiceInterval(int arrival, int departure)
           
ServiceInterval(int minArrival, int minDeparture, int maxArrival, int maxDeparture)
           
 
Method Summary
 ServiceInterval extend(int arrivalTime, int departureTime)
          Construct a new ServiceInterval by extending the current service interval, adjusting the arrival and departure intervals to include the additional arrival and departure time specified in the arguments.
static ServiceInterval extend(ServiceInterval serviceInterval, int arrivalTime, int departureTime)
           
 int getMaxArrival()
           
 int getMaxDeparture()
           
 int getMinArrival()
           
 int getMinDeparture()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServiceInterval

public ServiceInterval(int arrival,
                       int departure)
Parameters:
arrival - arrival time in seconds since midnight
departure - 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 midnight
minDeparture - min departure time in seconds since midnight
maxArrival - max arrival time in seconds since midnight
maxDeparture - 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 new ServiceInterval by 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 interval
departureTime - 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)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011 OneBusAway. All Rights Reserved.