Class ServiceIdOp
- java.lang.Object
-
- org.onebusaway.gtfs.impl.calendar.ServiceIdOp
-
- All Implemented Interfaces:
Comparator<Date>
public abstract class ServiceIdOp extends Object implements Comparator<Date>
-
-
Field Summary
Fields Modifier and Type Field Description static ServiceIdOpARRIVAL_OPstatic ServiceIdOpBOTH_OPstatic ServiceIdOpDEPARTURE_OP
-
Constructor Summary
Constructors Modifier Constructor Description protectedServiceIdOp(boolean reverse)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description intcompare(Date a, Date b)intcompareInterval(ServiceInterval interval, Date serviceDate, Date from, Date to)Returns -1 if the service interval comes before the from-to interval.abstract intgetFromTime(ServiceInterval interval)abstract DategetServiceDate(List<Date> data, int index)abstract intgetToTime(ServiceInterval interval)DateshiftTime(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, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
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
-
-
Method Detail
-
getFromTime
public abstract int getFromTime(ServiceInterval interval)
-
getToTime
public abstract int getToTime(ServiceInterval interval)
-
compare
public int compare(Date a, Date b)
- Specified by:
comparein interfaceComparator<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:
-
-