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_KEYS
Supported 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 DayOfWeek
asDayOfWeek(GtfsKeyType gtfsKeyTypeWeekDay)
Convert GtfsKeyType to a Java DayOfWeek (if possible)static GtfsKeyType
asGtfsKeyType(DayOfWeek dayOfWeek)
Convert Java DayOfWeek to GTFSKeyType (if possible)int
getFriday()
int
getMonday()
int
getSaturday()
String
getServiceId()
Service id of this instance (need not be a number, so always String)int
getSunday()
EnumSet<GtfsKeyType>
getSupportedKeys()
All supported keys for this GTFS objectint
getThursday()
int
getTuesday()
int
getWednesday()
boolean
isActiveOn(DayOfWeek dayOfWeek)
Verify if day is present on this instanceboolean
isActiveOn(GtfsKeyType gtfsKeyTypeDayOfWeek)
boolean
isActiveOnAny(Collection<DayOfWeek> daysOfWeek)
Verify if any of the given days exist on this instanceboolean
isActiveOnFriday()
boolean
isActiveOnMonday()
boolean
isActiveOnSaturday()
boolean
isActiveOnSunday()
boolean
isActiveOnThursday()
boolean
isActiveOnTuesday()
boolean
isActiveOnWednesday()
String
toString()
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:
getSupportedKeys
in 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
-
-