|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.onebusaway.gtfs.model.calendar.ServiceDate
public class ServiceDate
A general representation of a year-month-day tuple not tied to any locale and
used by the GTFS entities ServiceCalendar and
ServiceCalendarDate to represent service date ranges. A service date
is a particular date when a particular GTFS service id is active.
| Constructor Summary | |
|---|---|
ServiceDate()
|
|
ServiceDate(Calendar calendar)
|
|
ServiceDate(Date date)
Construct a ServiceDate from the specified Date object, using the
default TimeZone object for the current VM to localize the date |
|
ServiceDate(int year,
int month,
int day)
Construct a new ServiceDate by specifying the numeric year, month, and day |
|
ServiceDate(ServiceDate o)
|
|
| Method Summary | |
|---|---|
int |
compareTo(ServiceDate o)
|
boolean |
equals(Object obj)
|
Date |
getAsDate()
|
Date |
getAsDate(TimeZone timeZone)
Constructs a Date object such that the Date will be at "midnight"
(12:00am) at the start of the day specified by this service date and the
target timezone. |
String |
getAsString()
|
int |
getDay()
|
int |
getMonth()
|
int |
getYear()
|
int |
hashCode()
|
static ServiceDate |
parseString(String value)
Parse a service date from a string in "YYYYMMDD" format. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ServiceDate(int year,
int month,
int day)
year - - numeric year (ex. 2010)month - - numeric month of the year, where Jan = 1, Feb = 2, etcday - - numeric day of monthpublic ServiceDate(ServiceDate o)
public ServiceDate(Calendar calendar)
public ServiceDate(Date date)
Date object, using the
default TimeZone object for the current VM to localize the date
date - public ServiceDate()
| Method Detail |
|---|
public static ServiceDate parseString(String value)
value - a string of the form "YYYYMMDD"
public int getYear()
public int getMonth()
public int getDay()
public Date getAsDate()
getAsDate(TimeZone) with the default timezone for
this VMpublic Date getAsDate(TimeZone timeZone)
Date object such that the Date will be at "midnight"
(12:00am) at the start of the day specified by this service date and the
target timezone. Note that we take the GTFS convention of calculating
midnight by setting the target date to noon (12:00pm) for the service date
and timezone specified and then subtracting twelve hours. Normally that
would be equivalent to midnight, except on Daylight Saving Time days, in
which case it can be an hour ahead or behind. This behavior ensures correct
calculation of StopTime arrival and departure time when the second
offset is added to the localized service date.
timeZone - the target timezone to localize the service date to
public String getAsString()
public int compareTo(ServiceDate o)
compareTo in interface Comparable<ServiceDate>public String toString()
toString in class Objectpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||