TripSearchResult

TripSearchResult

Trip Search Result

This Class represents a single Trip Search Result. It consists of one or more Trip Search Result Segments, which are the individual Trips a rider would take to get from their original Origin Stop to their final Destination Stop.

Module: search/TripSearchResult

Constructor

new TripSearchResult(segments)

Source:

Create a new Trip Search Result from the provided segment(s)

Parameters:
Name Type Description
segments TripSearchResultSegment | Array.<TripSearchResultSegment>

Trip Search Result Segment(s)

Members

destination :StopTime

Source:

The StopTime of the Trip Search's Destination Stop

Type:

length :int

Source:

The number of Trip Search Result Segments in this Result

Type:
  • int

origin :StopTime

Source:

The StopTime of the Trip Search's Origin Stop

Type:

segments :Array.<TripSearchResultSegment>

Source:

The Trip Search Result Segments

Type:

transfers :Array.<TripSearchResultTransfer>

Source:

List of Transfers

Type:

travelTime :int

Source:

Total Travel Time (in minutes) - includes all segments and layovers

Type:
  • int

Methods

(static) sortByDeparture(a, b) → {number}

Source:

Sort Trip Search Results by their departure from the Origin

Parameters:
Name Type Description
a TripSearchResult

first TripSearchResult

b TripSearchResult

second TripSearchResult

Returns:

compare integer

Type
number