forked from Transitime/core
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inspired by work done here: TheTransitClock#255 (comment) Needs bug fix MET-214
- Loading branch information
1 parent
a5937cd
commit 495c45a
Showing
25 changed files
with
417 additions
and
256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
transitclock/src/main/java/org/transitclock/core/dataCache/StopPathKey.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package org.transitclock.core.dataCache; | ||
|
||
import java.util.Objects; | ||
|
||
/** | ||
* StopPatch caching based in TripInstance (Route/Direction/time) instead of tripId. | ||
*/ | ||
public class StopPathKey extends TripKey implements java.io.Serializable { | ||
|
||
private static long serialVersionUID = 1L; | ||
|
||
private String originStopId; | ||
private String destinationStopId; | ||
private boolean travelTime; | ||
|
||
public StopPathKey(String routeId, | ||
String directionId, | ||
Integer startTimeSecondsIntoDay, | ||
Long tripStartTime, | ||
String originStopId, | ||
String destinationStopId, | ||
boolean travelTime) { | ||
super(routeId, directionId, tripStartTime, startTimeSecondsIntoDay); | ||
this.originStopId = originStopId; | ||
this.destinationStopId = destinationStopId; | ||
this.travelTime = travelTime; | ||
} | ||
|
||
public String getOriginStopId() { | ||
return originStopId; | ||
} | ||
|
||
public String getDestinationStopId() { | ||
return destinationStopId; | ||
} | ||
|
||
public boolean isTravelTime() { | ||
return travelTime; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(getRouteId(), getDirectionId(), getStartTimeSecondsIntoDay(), | ||
getTripStartTime(), originStopId, destinationStopId, travelTime); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return true; | ||
StopPathKey that = (StopPathKey) o; | ||
return Objects.equals(getRouteId(), that.getRouteId()) | ||
&& Objects.equals(getDirectionId(), that.getDirectionId()) | ||
&& Objects.equals(getStartTimeSecondsIntoDay(), that.getStartTimeSecondsIntoDay()) | ||
&& Objects.equals(getTripStartTime(), that.getTripStartTime()) | ||
&& Objects.equals(originStopId, that.originStopId) | ||
&& Objects.equals(destinationStopId, that.destinationStopId) | ||
&& Objects.equals(travelTime, that.travelTime); | ||
} | ||
} |
3 changes: 0 additions & 3 deletions
3
...sitclock/src/main/java/org/transitclock/core/dataCache/TripDataHistoryCacheInterface.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.