Package org.goplanit.gtfs.entity
Class GtfsCalendar
- java.lang.Object
-
- org.goplanit.gtfs.entity.GtfsObject
-
- org.goplanit.gtfs.entity.GtfsCalendar
-
public class GtfsCalendar extends GtfsObject
In memory representation of a GTFS entry in calendar.txt- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description static EnumSet<GtfsKeyType>SUPPORTED_KEYSSupported keys for a GTFS calendar instance
-
Constructor Summary
Constructors Constructor Description GtfsCalendar()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DayOfWeekasDayOfWeek(GtfsKeyType gtfsKeyTypeWeekDay)Convert GtfsKeyType to a Java DayOfWeek (if possible)static GtfsKeyTypeasGtfsKeyType(DayOfWeek dayOfWeek)Convert Java DayOfWeek to GTFSKeyType (if possible)intgetFriday()intgetMonday()intgetSaturday()StringgetServiceId()Service id of this instance (need not be a number, so always String)intgetSunday()EnumSet<GtfsKeyType>getSupportedKeys()All supported keys for this GTFS objectintgetThursday()intgetTuesday()intgetWednesday()booleanisActiveOn(DayOfWeek dayOfWeek)Verify if day is present on this instancebooleanisActiveOn(GtfsKeyType gtfsKeyTypeDayOfWeek)booleanisActiveOnAny(Collection<DayOfWeek> daysOfWeek)Verify if any of the given days exist on this instancebooleanisActiveOnFriday()booleanisActiveOnMonday()booleanisActiveOnSaturday()booleanisActiveOnSunday()booleanisActiveOnThursday()booleanisActiveOnTuesday()booleanisActiveOnWednesday()StringtoString()String of all key value pairs of this GTFS entity-
Methods inherited from class org.goplanit.gtfs.entity.GtfsObject
appendKeyValues, containsKey, get, put
-
-
-
-
Field Detail
-
SUPPORTED_KEYS
public static final EnumSet<GtfsKeyType> SUPPORTED_KEYS
Supported keys for a GTFS calendar instance
-
-
Method Detail
-
getSupportedKeys
public EnumSet<GtfsKeyType> getSupportedKeys()
All supported keys for this GTFS object- Specified by:
getSupportedKeysin classGtfsObject- Returns:
- supported keys
-
asDayOfWeek
public static DayOfWeek asDayOfWeek(GtfsKeyType gtfsKeyTypeWeekDay) throws PlanItRunTimeException
Convert GtfsKeyType to a Java DayOfWeek (if possible)- Parameters:
gtfsKeyTypeWeekDay- to convert- Returns:
- java DayOfWeek
- Throws:
PlanItRunTimeException
-
asGtfsKeyType
public static GtfsKeyType asGtfsKeyType(DayOfWeek dayOfWeek) throws PlanItRunTimeException
Convert Java DayOfWeek to GTFSKeyType (if possible)- Parameters:
dayOfWeek- to convert- Returns:
- java DayOfWeek
- Throws:
PlanItRunTimeException
-
getServiceId
public String getServiceId()
Service id of this instance (need not be a number, so always String)- Returns:
- service id
-
isActiveOnMonday
public boolean isActiveOnMonday()
-
isActiveOnTuesday
public boolean isActiveOnTuesday()
-
isActiveOnWednesday
public boolean isActiveOnWednesday()
-
isActiveOnThursday
public boolean isActiveOnThursday()
-
isActiveOnFriday
public boolean isActiveOnFriday()
-
isActiveOnSaturday
public boolean isActiveOnSaturday()
-
isActiveOnSunday
public boolean isActiveOnSunday()
-
getMonday
public int getMonday()
-
getTuesday
public int getTuesday()
-
getWednesday
public int getWednesday()
-
getThursday
public int getThursday()
-
getFriday
public int getFriday()
-
getSaturday
public int getSaturday()
-
getSunday
public int getSunday()
-
isActiveOn
public boolean isActiveOn(GtfsKeyType gtfsKeyTypeDayOfWeek)
-
isActiveOn
public boolean isActiveOn(DayOfWeek dayOfWeek)
Verify if day is present on this instance- Parameters:
dayOfWeek- to verify- Returns:
- true when present, false otherwise
-
isActiveOnAny
public boolean isActiveOnAny(Collection<DayOfWeek> daysOfWeek)
Verify if any of the given days exist on this instance- Parameters:
daysOfWeek- to verify- Returns:
- true when present, false otherwise
-
-