mirror of
https://github.com/opentripplanner/OpenTripPlanner.git
synced 2026-04-03 15:26:08 +02:00
# Conflicts: # application/src/test-fixtures/java/org/opentripplanner/transit/model/site/TestStopLocation.java # application/src/test/java/org/opentripplanner/transit/service/DefaultTransitServiceTest.java # Conflicts: # application/src/ext-test/java/org/opentripplanner/ext/flex/FlexIntegrationTest.java # application/src/ext/java/org/opentripplanner/ext/carpooling/model/CarpoolLeg.java # application/src/ext/java/org/opentripplanner/ext/flex/FlexTransferIndex.java # application/src/ext/java/org/opentripplanner/ext/reportapi/model/TransfersReport.java # application/src/main/java/org/opentripplanner/apis/transmodel/model/EnumTypes.java # application/src/main/java/org/opentripplanner/graph_builder/GraphBuilder.java # application/src/main/java/org/opentripplanner/gtfs/interlining/InterlineProcessor.java # application/src/main/java/org/opentripplanner/model/plan/Leg.java # application/src/main/java/org/opentripplanner/model/plan/leg/ScheduledTransitLeg.java # application/src/main/java/org/opentripplanner/routing/algorithm/mapping/RaptorPathToItineraryMapper.java # application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/request/RaptorRequestTransferCache.java # application/src/main/java/org/opentripplanner/transfer/regular/TransferRepository.java # application/src/main/java/org/opentripplanner/transfer/regular/internal/DefaultTransferRepository.java # application/src/main/java/org/opentripplanner/transfer/regular/model/PathTransfer.java # application/src/test/java/org/opentripplanner/apis/transmodel/mapping/TripRequestMapperTest.java # application/src/test/java/org/opentripplanner/routing/algorithm/GraphRoutingTest.java # Conflicts: # application/src/ext-test/java/org/opentripplanner/ext/vectortiles/layers/stops/StopsLayerTest.java # application/src/main/java/org/opentripplanner/updater/configure/UpdaterConfigurator.java # application/src/test/java/org/opentripplanner/service/vehicleparking/VehicleParkingTestGraphData.java # Conflicts: # application/src/main/java/org/opentripplanner/updater/trip/gtfs/TripTimesUpdater.java # Conflicts: # application/src/test/java/org/opentripplanner/graph_builder/module/islandpruning/SubgraphOnlyFerryTest.java # Conflicts: # application/src/test/java/org/opentripplanner/apis/gtfs/mapping/routerequest/LegacyRouteRequestMapperTest.java
177 lines
3.3 KiB
Java
177 lines
3.3 KiB
Java
/* This file is based on code copied from project OneBusAway, see the LICENSE file for further information. */
|
|
package org.opentripplanner.model.calendar;
|
|
|
|
import java.io.Serializable;
|
|
import java.util.Objects;
|
|
import org.opentripplanner.core.model.id.FeedScopedId;
|
|
import org.opentripplanner.core.model.time.LocalDateInterval;
|
|
|
|
/**
|
|
* Note that I decided to call this class ServiceCalendar instead of Calendar, so as to avoid
|
|
* confusion with java.util.Calendar
|
|
*
|
|
* @author bdferris
|
|
*/
|
|
public final class ServiceCalendar implements Serializable {
|
|
|
|
private FeedScopedId serviceId;
|
|
|
|
private int monday;
|
|
|
|
private int tuesday;
|
|
|
|
private int wednesday;
|
|
|
|
private int thursday;
|
|
|
|
private int friday;
|
|
|
|
private int saturday;
|
|
|
|
private int sunday;
|
|
|
|
private LocalDateInterval period;
|
|
|
|
public FeedScopedId getServiceId() {
|
|
return serviceId;
|
|
}
|
|
|
|
public void setServiceId(FeedScopedId serviceId) {
|
|
this.serviceId = serviceId;
|
|
}
|
|
|
|
public int getMonday() {
|
|
return monday;
|
|
}
|
|
|
|
public void setMonday(int monday) {
|
|
this.monday = monday;
|
|
}
|
|
|
|
public int getTuesday() {
|
|
return tuesday;
|
|
}
|
|
|
|
public void setTuesday(int tuesday) {
|
|
this.tuesday = tuesday;
|
|
}
|
|
|
|
public int getWednesday() {
|
|
return wednesday;
|
|
}
|
|
|
|
public void setWednesday(int wednesday) {
|
|
this.wednesday = wednesday;
|
|
}
|
|
|
|
public int getThursday() {
|
|
return thursday;
|
|
}
|
|
|
|
public void setThursday(int thursday) {
|
|
this.thursday = thursday;
|
|
}
|
|
|
|
public int getFriday() {
|
|
return friday;
|
|
}
|
|
|
|
public void setFriday(int friday) {
|
|
this.friday = friday;
|
|
}
|
|
|
|
public int getSaturday() {
|
|
return saturday;
|
|
}
|
|
|
|
public void setSaturday(int saturday) {
|
|
this.saturday = saturday;
|
|
}
|
|
|
|
public int getSunday() {
|
|
return sunday;
|
|
}
|
|
|
|
public void setSunday(int sunday) {
|
|
this.sunday = sunday;
|
|
}
|
|
|
|
public void setWeekdays(int value) {
|
|
setMonday(value);
|
|
setTuesday(value);
|
|
setWednesday(value);
|
|
setThursday(value);
|
|
setFriday(value);
|
|
}
|
|
|
|
public void setWeekend(int value) {
|
|
setSaturday(value);
|
|
setSunday(value);
|
|
}
|
|
|
|
public void setAllDays(int value) {
|
|
setWeekdays(value);
|
|
setWeekend(value);
|
|
}
|
|
|
|
public LocalDateInterval getPeriod() {
|
|
return period;
|
|
}
|
|
|
|
public void setPeriod(LocalDateInterval period) {
|
|
this.period = period;
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
return Objects.hash(
|
|
serviceId,
|
|
monday,
|
|
tuesday,
|
|
wednesday,
|
|
thursday,
|
|
friday,
|
|
saturday,
|
|
sunday,
|
|
period
|
|
);
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object o) {
|
|
if (this == o) {
|
|
return true;
|
|
}
|
|
if (o == null || getClass() != o.getClass()) {
|
|
return false;
|
|
}
|
|
ServiceCalendar that = (ServiceCalendar) o;
|
|
return (
|
|
monday == that.monday &&
|
|
tuesday == that.tuesday &&
|
|
wednesday == that.wednesday &&
|
|
thursday == that.thursday &&
|
|
friday == that.friday &&
|
|
saturday == that.saturday &&
|
|
sunday == that.sunday &&
|
|
Objects.equals(serviceId, that.serviceId) &&
|
|
Objects.equals(period, that.period)
|
|
);
|
|
}
|
|
|
|
public String toString() {
|
|
return (
|
|
"ServiceCalendar{" +
|
|
this.serviceId +
|
|
" [" +
|
|
this.monday +
|
|
this.tuesday +
|
|
this.wednesday +
|
|
this.thursday +
|
|
this.friday +
|
|
this.saturday +
|
|
this.sunday +
|
|
"]}"
|
|
);
|
|
}
|
|
}
|