java.lang.Object
de.stklcode.pubtrans.ura.model.Trip
- All Implemented Interfaces:
Serializable
Entity for a single trip.
- Author:
- Stefan Kalscheuer
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTrip(Stop stop, Integer visitID, String lineID, String lineName, Integer directionID, String destinationName, String destinationText, String vehicleID, String tripID, Long estimatedTime) Construct Trip object from Stop model and set of additional data.Trip(String stopID, String stopName, String stopIndicator, Integer stopState, Double stopLatitude, Double stopLongitude, Integer visitID, String lineID, String lineName, Integer directionID, String destinationName, String destinationText, String vehicleID, String tripID, Long estimatedTime) Construct Trip object from complete set of data.Trip(List<Serializable> raw) Construct Trip object from raw list of attributes parsed from JSON.Trip(List<Serializable> raw, String version) Construct Trip object from raw list of attributes parsed from JSON with explicitly specified version. -
Method Summary
Modifier and TypeMethodDescriptionThe full length destination name of the trip the vehicle is on.The abbreviated destination name of the trip the vehicle is on.This identifies the direction of the trip that the vehicle is on.This is the predicted time of arrival for the vehicle at a specific stop.getId()The identifier of a route.This is the route number that is displayed on the front of the bus and on any publicity advertising the route.getStop()The starting stop.The unique identifier of the vehicle.Visit identifier.
-
Constructor Details
-
Trip
public Trip(String stopID, String stopName, String stopIndicator, Integer stopState, Double stopLatitude, Double stopLongitude, Integer visitID, String lineID, String lineName, Integer directionID, String destinationName, String destinationText, String vehicleID, String tripID, Long estimatedTime) Construct Trip object from complete set of data.- Parameters:
stopID- Stop ID.stopName- Stop name.stopIndicator- Stop Indicator.stopState- Stop state.stopLatitude- Stop geolocation latitude.stopLongitude- Stop geolocation latitude.visitID- Visit ID.lineID- Line ID.lineName- Line name.directionID- Direction ID.destinationName- Destination name.destinationText- Destination text.vehicleID- Vehicle ID.tripID- Trip ID.estimatedTime- Estimated time.
-
Trip
public Trip(Stop stop, Integer visitID, String lineID, String lineName, Integer directionID, String destinationName, String destinationText, String vehicleID, String tripID, Long estimatedTime) Construct Trip object from Stop model and set of additional data.- Parameters:
stop- Stop modelvisitID- Visit IDlineID- Line IDlineName- Line namedirectionID- Direction IDdestinationName- Destination namedestinationText- Destination textvehicleID- Vehicle IDtripID- Trip IDestimatedTime- Estimated time
-
Trip
Construct Trip object from raw list of attributes parsed from JSON.- Parameters:
raw- List of attributes from JSON line- Throws:
IOException- Thrown on invalid line format.
-
Trip
Construct Trip object from raw list of attributes parsed from JSON with explicitly specified version.- Parameters:
raw- List of attributes from JSON lineversion- API version- Throws:
IOException- Thrown on invalid line format.
-
-
Method Details
-
getStop
The starting stop.- Returns:
- The (starting) stop.
-
getId
- Returns:
- The trip ID.
-
getVisitID
Visit identifier.- Returns:
- The visit ID.
-
getLineID
The identifier of a route. This is an internal identifier and is not equal to the route number displayed on the front of the bus. It should not be displayed to the public.- Returns:
- The line ID.
-
getLineName
This is the route number that is displayed on the front of the bus and on any publicity advertising the route.- Returns:
- The line name.
-
getDirectionID
This identifies the direction of the trip that the vehicle is on. It indicates whether the vehicle is on an outbound or inbound trip.- Returns:
- The direction ID.
-
getDestinationName
The full length destination name of the trip the vehicle is on. The destination name is based on the route and end point of the trip.- Returns:
- The destination name.
-
getDestinationText
The abbreviated destination name of the trip the vehicle is on. The destination text is based on the route and end point of the trip.- Returns:
- The destination text.
-
getEstimatedTime
This is the predicted time of arrival for the vehicle at a specific stop. It is an absolute time in UTC as per Unix epoch (in milliseconds).- Returns:
- The estimated departure time.
-
getVehicleID
The unique identifier of the vehicle. This is an internal identifier and should not be displayed to the public.- Returns:
- The vehicle ID or
nullif not present.
-