-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: NAV-52 - Add LegType to Leg of Public Service Interface
- Format project.
- Loading branch information
Showing
7 changed files
with
54 additions
and
49 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,38 @@ | ||
package ch.naviqore.service; | ||
|
||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
/** | ||
* Represents a leg of a connection, including its order, distance, and duration. | ||
*/ | ||
public interface Leg { | ||
|
||
/** | ||
* The position of this leg in the overall connection. | ||
*/ | ||
int getOrder(); | ||
LegType getLegType(); | ||
|
||
Location getSourceLocation(); | ||
|
||
Location getTargetLocation(); | ||
|
||
LocalDateTime getArrivalTime(); | ||
|
||
LocalDateTime getDepartureTime(); | ||
|
||
int getDistance(); | ||
|
||
int getDuration(); | ||
|
||
/** | ||
* The target public transit stop, if walk starts at a stop. | ||
*/ | ||
@Nullable | ||
Stop getSourceStop(); | ||
|
||
/** | ||
* The target public transit stop, if walk ends at a stop. | ||
*/ | ||
@Nullable | ||
Stop getTargetStop(); | ||
|
||
} |
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,6 @@ | ||
package ch.naviqore.service; | ||
|
||
public enum LegType { | ||
PUBLIC_TRANSIT, | ||
WALK | ||
} |
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 |
---|---|---|
@@ -1,9 +1,19 @@ | ||
package ch.naviqore.service; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
|
||
public interface PublicTransitLeg extends Leg { | ||
|
||
StopTime getArrival(); | ||
|
||
StopTime getDeparture(); | ||
|
||
@Override | ||
@NotNull | ||
Stop getSourceStop(); | ||
|
||
@Override | ||
@NotNull | ||
Stop getTargetStop(); | ||
|
||
} |
This file was deleted.
Oops, something went wrong.