org.onebusaway.gtfs.impl.calendar
Class ServiceIdOp

java.lang.Object
  extended by org.onebusaway.gtfs.impl.calendar.ServiceIdOp
All Implemented Interfaces:
Comparator<Date>

public abstract class ServiceIdOp
extends Object
implements Comparator<Date>


Field Summary
static ServiceIdOp ARRIVAL_OP
           
static ServiceIdOp BOTH_OP
           
static ServiceIdOp DEPARTURE_OP
           
 
Constructor Summary
protected ServiceIdOp(boolean reverse)
           
 
Method Summary
 int compare(Date a, Date b)
           
 int compareInterval(ServiceInterval interval, Date serviceDate, Date from, Date to)
          Returns -1 if the service interval comes before the from-to interval.
abstract  int getFromTime(ServiceInterval interval)
           
abstract  Date getServiceDate(List<Date> data, int index)
           
abstract  int getToTime(ServiceInterval interval)
           
 Date shiftTime(ServiceInterval interval, Date time)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Field Detail

ARRIVAL_OP

public static final ServiceIdOp ARRIVAL_OP

DEPARTURE_OP

public static final ServiceIdOp DEPARTURE_OP

BOTH_OP

public static final ServiceIdOp BOTH_OP
Constructor Detail

ServiceIdOp

protected ServiceIdOp(boolean reverse)
Method Detail

getFromTime

public abstract int getFromTime(ServiceInterval interval)

getToTime

public abstract int getToTime(ServiceInterval interval)

getServiceDate

public abstract Date getServiceDate(List<Date> data,
                                    int index)

compare

public int compare(Date a,
                   Date b)
Specified by:
compare in interface Comparator<Date>

shiftTime

public Date shiftTime(ServiceInterval interval,
                      Date time)

compareInterval

public int compareInterval(ServiceInterval interval,
                           Date serviceDate,
                           Date from,
                           Date to)
Returns -1 if the service interval comes before the from-to interval. Returns 0 if the service interval overlaps the from-to interval. Returns 1 if the service interval comes after the from-to interval

Parameters:
interval -
serviceDate -
from -
to -
Returns:


Copyright © 2011 OneBusAway. All Rights Reserved.