/tripkit/CommonCoreLegacy/com.skedgo.tripkit.routing/TripSegment
TripSegment
class TripSegment : IRealTimeElement, ITimeRange
To go from A to B, sometimes we have to travel X, Y, Z locations between A and B. That means, we travel A to X, then X to Y, then Y to Z, then Z to B which is the destination. To show how to travel from A to X, we use TripSegment. So, in this case, a trip from A to B comprises 6 segments:
- A segment whose type is SegmentType.DEPARTURE.
- A segment from A to X.
- A segment from X to Y.
- A segment from Y to Z.
- A segment from Z to B.
- A segment whose type is SegmentType.ARRIVAL.
Note that, to avoid TransactionTooLargeException, it's discouraged to pass any instance of Query to Intent or Bundle. The Parcelable is subject to deletion at anytime.
See also
Trips, groups, frequencies and templates |
Constructors
TripSegment | constructor() |
Types
Name | Summary |
---|---|
Companion | object Companion |
Properties
Name | Summary |
---|---|
action | @SerializedName(value = "action") var action: String? |
actionAlert | val TripSegment.actionAlert: RealtimeAlert? |
alertHashCodes | @SerializedName(value = "alertHashCodes") var alertHashCodes: LongArray |
alerts | @SerializedName(value = "alerts") var alerts: ArrayList<RealtimeAlert>? This is no longer a part of json returned from server due to Version 6. It's currently being used for json-based persistence on app local. |
availability | @SerializedName(value = "availability") var availability: String? |
bicycleAccessible | @SerializedName(value = "bicycleAccessible") var bicycleAccessible: Boolean |
booking | @JvmField @SerializedName(value = "booking") var booking: Booking? |
bookingHasConfirmation | val TripSegment?.bookingHasConfirmation: Boolean |
bookingHashCode | @SerializedName(value = "bookingHashCode") var bookingHashCode: Long? |
cycleFriendliness | val cycleFriendliness: Int |
darkVehicleIcon | @get:DrawableRes val darkVehicleIcon: Int |
darkVehicleIconWithNoRealtimeChecking | @get:DrawableRes val darkVehicleIconWithNoRealtimeChecking: Int |
direction | @SerializedName(value = "travelDirection") var direction: Int |
durationWithoutTraffic | @SerializedName(value = "durationWithoutTraffic") var durationWithoutTraffic: Long |
endDateTime | val TripSegment.endDateTime: DateTime Get an end date-time with time-zone. |
endDateTimeCalendar | val TripSegment.endDateTimeCalendar: Calendar |
endStopCode | @SerializedName(value = "endStopCode") open override var endStopCode: String? |
endTimeInSecs | open override var endTimeInSecs: Long |
frequency | @SerializedName(value = "frequency") var frequency: Int |
from | @SerializedName(value = "from") var from: Location? |
geofences | var geofences: List<Geofence>? |
id | var id: String |
isContinuation | @SerializedName(value = "isContinuation") var isContinuation: Boolean |
isCycling | val isCycling: Boolean |
isFrequencyBased | @SerializedName(value = "serviceIsFrequencyBased") var isFrequencyBased: Boolean |
isHideExactTimes | var isHideExactTimes: Boolean |
isPlane | val isPlane: Boolean |
isQuickBooking | val isQuickBooking: Boolean |
isRealTime | @SerializedName(value = "realTime") var isRealTime: Boolean Indicates if the times are real-time or not. |
isStationary | val isStationary: Boolean |
isWalking | val isWalking: Boolean |
isWheelchair | val isWheelchair: Boolean |
localCost | @JvmField @SerializedName(value = "localCost") val localCost: LocalCost? = null |
mapTiles | var mapTiles: TripKitMapTiles? |
metres | @JvmField @SerializedName(value = "metres") var metres: Int |
metresSafe | @JvmField @SerializedName(value = "metresSafe") var metresSafe: Int |
metresUnsafe | @SerializedName(value = "metresUnsafe") var metresUnsafe: Int |
miniInstruction | @SerializedName(value = "mini") val miniInstruction: MiniInstruction? = null |
mode | val mode: VehicleMode? |
modeInfo | @JvmField @SerializedName(value = "modeInfo") var modeInfo: ModeInfo? |
noActionAlerts | val TripSegment.noActionAlerts: List<RealtimeAlert>? |
notes | @SerializedName(value = "notes") var notes: String? NOTE: For unscheduled segments, if we want to show notes on views, don't call this. Call getDisplayNotes instead. |
operator | open override val operator: String? |
pairIdentifier | val pairIdentifier: String |
platform | @JvmField @SerializedName(value = "platform") var platform: String? |
realTimeVehicle | @SerializedName(value = "realtimeVehicle") var realTimeVehicle: RealTimeVehicle? |
segmentId | var segmentId: Long |
serviceColor | @SerializedName(value = "serviceColor") var serviceColor: ServiceColor? |
serviceDirection | @SerializedName(value = "serviceDirection") var serviceDirection: String? |
serviceName | @SerializedName(value = "serviceName") var serviceName: String? |
serviceNumber | @SerializedName(value = "serviceNumber") var serviceNumber: String? |
serviceOperator | @SerializedName(value = "serviceOperator") var serviceOperator: String? |
serviceTripId | @SerializedName(value = "serviceTripID") open override var serviceTripId: String? |
shapes | @SerializedName(value = "shapes") var shapes: ArrayList<Shape>? |
sharedVehicle | @SerializedName(value = "sharedVehicle") var sharedVehicle: SharedVehicle? |
singleLocation | @SerializedName(value = "location") var singleLocation: Location? |
startDateTime | val TripSegment.startDateTime: DateTime Gets a start date-time with time-zone. |
startDateTimeCalendar | val TripSegment.startDateTimeCalendar: Calendar |
startStopCode | @SerializedName(value = "stopCode") open override var startStopCode: String? |
startTimeInSeconds | open override val startTimeInSeconds: Long |
startTimeInSecs | open override var startTimeInSecs: Long |
stopCount | @JvmField @SerializedName(value = "stops") var stopCount: Int |
streets | val streets: List<Street>? |
templateHashCode | @JvmField @SerializedName(value = "segmentTemplateHashCode") var templateHashCode: Long |
terms | @SerializedName(value = "terms") var terms: String? Currently used for shuttle buses which explains how often they run |
ticket | @SerializedName(value = "ticket") val ticket: Ticket? = null |
ticketURL | @SerializedName(value = "ticketWebsiteURL") val ticketURL: String? = null |
timetableEndDateTime | val TripSegment.timetableEndDateTime: DateTime |
timetableEndTime | @SerializedName(value = "timetableEndTime") var timetableEndTime: Long |
timetableStartDateTime | val TripSegment.timetableStartDateTime: DateTime |
timetableStartTime | @SerializedName(value = "timetableStartTime") var timetableStartTime: Long |
timeZone | val timeZone: String? |
to | @SerializedName(value = "to") var to: Location? |
transportModeId | @JvmField @SerializedName(value = "modeIdentifier") var transportModeId: String? NOTE: Values are defined by 'modes' in https://api.tripgo.com/v1/regions.json |
trip | @Transient var trip: Trip? |
turnByTurn | @SerializedName(value = "turn-by-turn") var turnByTurn: String? |
visibility | @SerializedName(value = "visibility") var visibility: String? |
wheelchairAccessible | @JvmField @SerializedName(value = "wheelchairAccessible") var wheelchairAccessible: Boolean |
wheelchairFriendliness | val wheelchairFriendliness: Int |
Functions
Name | Summary |
---|---|
getDisplayNotes | fun getDisplayNotes(context: Context, withPlatform: Boolean): String? As of now, used only for unscheduled segments. If we want to show notes on views, use it instead of getNotes . Some essential templates will be resolved before being presented by the views. |
getLightTransportIcon | fun getLightTransportIcon(context: Context): Drawable? |
getRealTimeStatusText | fun getRealTimeStatusText(resources: Resources): String? |
getTurnByTurn | fun getTurnByTurn(): TurnByTurn? |
getType | fun getType(): SegmentType? |
hasCarParks | fun hasCarParks(): Boolean |
hasTimeTable | fun hasTimeTable(): Boolean |
isFrequencyBased | fun isFrequencyBased(isFrequencyBased: Boolean) |
isVisibleInContext | fun isVisibleInContext(contextVisibility: String?): Boolean |
lineColor | fun lineColor(): Int |
setHasCarParks | fun setHasCarParks(hasCarParks: Boolean) |
setStreets | fun setStreets(streets: ArrayList<Street>?) |
setTurnByTurn | fun setTurnByTurn(value: String) |
setType | fun setType(type: SegmentType?) |