org.onebusaway.gtfs.impl.calendar
Class ServiceIdOp
java.lang.Object
org.onebusaway.gtfs.impl.calendar.ServiceIdOp
- All Implemented Interfaces:
- java.util.Comparator<java.util.Date>
public abstract class ServiceIdOp
- extends java.lang.Object
- implements java.util.Comparator<java.util.Date>
|
Constructor Summary |
protected |
ServiceIdOp(boolean reverse)
|
| 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 |
ARRIVAL_OP
public static final ServiceIdOp ARRIVAL_OP
DEPARTURE_OP
public static final ServiceIdOp DEPARTURE_OP
BOTH_OP
public static final ServiceIdOp BOTH_OP
ServiceIdOp
protected ServiceIdOp(boolean reverse)
getFromTime
public abstract int getFromTime(ServiceInterval interval)
getToTime
public abstract int getToTime(ServiceInterval interval)
getServiceDate
public abstract java.util.Date getServiceDate(java.util.List<java.util.Date> data,
int index)
compare
public int compare(java.util.Date a,
java.util.Date b)
- Specified by:
compare in interface java.util.Comparator<java.util.Date>
shiftTime
public java.util.Date shiftTime(ServiceInterval interval,
java.util.Date time)
compareInterval
public int compareInterval(ServiceInterval interval,
java.util.Date serviceDate,
java.util.Date from,
java.util.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 © 2010 OneBusAway. All Rights Reserved.