tripkit-android / com.skedgo.tripkit.routing / TripSegment

TripSegment

open 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`](./index.md). So, in this case, a trip from A to B comprises 6 segments: - A segment whose type isSegmentType#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`](../-segment-type/-a-r-r-i-v-a-l.md).

Note that, to avoid [`TransactionTooLargeException`](#), it's discouraged to pass any instance ofQuery to [`Intent`](#) orBundle. The `[Parcelable`](#) is subject to deletion at anytime.

See Also <a href="http://skedgo.github.io/tripgo-api/site/faq/#trips-groups-frequencies-and-templates">Trips, groups, frequencies and templates</a>

Constructors

Name Summary
<init> 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`](./index.md). So, in this case, a trip from A to B comprises 6 segments: - A segment whose type isSegmentType#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](../-segment-type/-a-r-r-i-v-a-l.md).TripSegment()`

Functions

Name Summary
convertStopCountToText FIXME: Should replace this with Quantity Strings. See http://developer.android.com/intl/vi/guide/topics/resources/string-resource.html#Plurals.open static fun convertStopCountToText(stopCount:Int):String!
getAction open fun getAction():String?
getAlertHashCodes open fun getAlertHashCodes():LongArray!
getAlerts open fun getAlerts():ArrayList<RealtimeAlert!>?
getBooking open fun getBooking():Booking!
getCycleFriendliness open fun getCycleFriendliness():Int
getDarkVehicleIcon open fun getDarkVehicleIcon():Int
getDirection open fun getDirection():Int
getDisplayNotes 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.open fun getDisplayNotes(resources: Resources!):String?
getDurationWithoutTraffic open fun getDurationWithoutTraffic():Long
getEndStopCode open fun getEndStopCode():String!
getFrequency open fun getFrequency():Int
getFrom open fun getFrom():Location!
getId open fun getId():Long
getLightTransportIcon open fun getLightTransportIcon(resources: Resources): Drawable!
getLocalCost open fun getLocalCost():LocalCost?
getMetres open fun getMetres():Int
getMetresSafe open fun getMetresSafe():Int
getMetresUnsafe open fun getMetresUnsafe():Int
getModeInfo open fun getModeInfo():ModeInfo?
getNotes NOTE: For unscheduled segments, if we want to show notes on views, don't call this. Call getDisplayNotes instead.open fun getNotes():String!
getOperator open fun getOperator():String!
getPairIdentifier open fun getPairIdentifier():String!
getPlatform open fun getPlatform():String?
getRealTimeStatusText open fun getRealTimeStatusText(resources: Resources!):String!
getRealTimeVehicle open fun getRealTimeVehicle():RealTimeVehicle!
getServiceColor open fun getServiceColor():ServiceColor?
getServiceDirection open fun getServiceDirection():String!
getServiceName open fun getServiceName():String!
getServiceNumber open fun getServiceNumber():String!
getServiceOperator open fun getServiceOperator():String!
getServiceTripId open fun getServiceTripId():String!
getShapes open fun getShapes():MutableList<Shape!>?
getSingleLocation open fun getSingleLocation():Location!
getStartStopCode open fun getStartStopCode():String!
getStopCount open fun getStopCount():Int
getStreets open fun getStreets():MutableList<Street!>!
getTemplateHashCode open fun getTemplateHashCode():Long
getTerms open fun getTerms():String!
getTimeZone open fun getTimeZone():String?
getTo open fun getTo():Location!
getTransportModeId Segments having type as [`SegmentType#DEPARTURE`](../-segment-type/-d-e-p-a-r-t-u-r-e.md),SegmentType#ARRIVAL, and `[SegmentType#STATIONARY](../-segment-type/-s-t-a-t-i-o-n-a-r-y.md) will have this property as null.open fun getTransportModeId(): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?`
getTrip open fun getTrip():Trip!
getTurnByTurn open fun getTurnByTurn():TurnByTurn?
getType open fun getType():SegmentType?
getVisibility open fun getVisibility():String!
getWheelchairAccessible open fun getWheelchairAccessible():Boolean
getWheelchairFriendliness open fun getWheelchairFriendliness():Int
hasTimeTable open fun hasTimeTable():Boolean
isContinuation open fun isContinuation():Boolean
isCycling open fun isCycling():Boolean
isFrequencyBased open fun isFrequencyBased():Boolean
open fun isFrequencyBased(isFrequencyBased:Boolean):Unit
isPlane open fun isPlane():Boolean
isRealTime open fun isRealTime():Boolean
isStationary open fun isStationary():Boolean
isVisibleInContext open fun isVisibleInContext(contextVisibility:String!):Boolean
isWalking open fun isWalking():Boolean
isWheelchair open fun isWheelchair():Boolean
lineColor open fun lineColor():Int
setAction open fun setAction(action:String!):Unit
setAlertHashCodes open fun setAlertHashCodes(alertHashCodes:LongArray!):Unit
setAlerts open fun setAlerts(alerts:ArrayList<RealtimeAlert!>!):Unit
setBooking open fun setBooking(booking:Booking!):Unit
setContinuation open fun setContinuation(isContinuation:Boolean):Unit
setDirection open fun setDirection(direction:Int):Unit
setDurationWithoutTraffic open fun setDurationWithoutTraffic(durationWithoutTraffic:Long):Unit
setEndStopCode open fun setEndStopCode(endStopCode:String!):Unit
setEndTimeInSecs NOTE: You should only use this setter for testing purpose.open fun setEndTimeInSecs(newEndTimeInSecs:Long):Unit
setFrequency open fun setFrequency(frequency:Int):Unit
setFrom open fun setFrom(from:Location!):Unit
setId open fun setId(id:Long):Unit
setMetres open fun setMetres(metres:Int):Unit
setMetresSafe open fun setMetresSafe(metresSafe:Int):Unit
setMetresUnsafe open fun setMetresUnsafe(metresUnsafe:Int):Unit
setModeInfo open fun setModeInfo(modeInfo:ModeInfo!):Unit
setNotes open fun setNotes(notes:String!):Unit
setPlatform open fun setPlatform(platform:String!):Unit
setRealTime open fun setRealTime(isRealTime:Boolean):Unit
setRealTimeVehicle open fun setRealTimeVehicle(realTimeVehicle:RealTimeVehicle!):Unit
setServiceColor open fun setServiceColor(serviceColor:ServiceColor!):Unit
setServiceDirection open fun setServiceDirection(serviceDirection:String!):Unit
setServiceName open fun setServiceName(serviceName:String!):Unit
setServiceNumber open fun setServiceNumber(serviceNumber:String!):Unit
setServiceOperator open fun setServiceOperator(serviceOperator:String!):Unit
setServiceTripId open fun setServiceTripId(serviceTripId:String!):Unit
setShapes open fun setShapes(shapes:ArrayList<Shape!>?):Unit
setSingleLocation open fun setSingleLocation(singleLocation:Location!):Unit
setStartStopCode open fun setStartStopCode(startStopCode:String!):Unit
setStartTimeInSecs NOTE: You should only use this setter for testing purpose.open fun setStartTimeInSecs(newStartTimeInSecs:Long):Unit
setStopCount open fun setStopCount(stopCount:Int):Unit
setStreets open fun setStreets(streets:ArrayList<Street!>!):Unit
setTemplateHashCode open fun setTemplateHashCode(templateHashCode:Long):Unit
setTerms open fun setTerms(terms:String!):Unit
setTo open fun setTo(to:Location!):Unit
setTransportModeId open fun setTransportModeId(transportModeId:String!):Unit
setTrip open fun setTrip(trip:Trip!):Unit
setType open fun setType(type:SegmentType!):Unit
setVisibility open fun setVisibility(visibility:String!):Unit
setWheelchairAccessible open fun setWheelchairAccessible(wheelchairAccessible:Boolean):Unit

Extension Properties

Name Summary
actionAlert valTripSegment.actionAlert:RealtimeAlert?
endDateTime Get an end date-time with time-zone.valTripSegment.endDateTime: DateTime
noActionAlerts valTripSegment.noActionAlerts:List<RealtimeAlert!>?
startDateTime Gets a start date-time with time-zone.valTripSegment.startDateTime: DateTime