Constructor
new Favorite(type, sequence, parameters, optionsopt)
- Source:
Create a new Favorite with the specified information
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
type |
int | Favorite Type |
||
sequence |
int | Favorite Sequence (1, 2, etc...) |
||
parameters |
Object | |||
options |
Object |
<optional> |
{}
|
Members
(static, constant) FAVORITE_TYPE_STATION :number
- Source:
- Default Value:
- 1
Favorite Type: Station
Type:
- number
(static, constant) FAVORITE_TYPE_TRANSIT :number
- Source:
- Default Value:
- 3
Favorite Type: Transit
Type:
- number
(static, constant) FAVORITE_TYPE_TRIP :number
- Source:
- Default Value:
- 2
Favorite Type: Trip
Type:
- number
options :Object
- Source:
The Favorite's Options
Type:
- Object
parameters :Object
- Source:
The Favorite's Parameters
Type:
- Object
sequence :int
- Source:
The sequence of the Favorite in the User's list
Type:
- int
type :int
- Source:
Value indicating the Favorite type
Type:
- int
Methods
(static) createStation(stop, sequence, optsopt) → {Favorite}
- Source:
Favorite Factory: create a Favorite Station
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
stop |
Stop | The Stop to save as a Favorite Station |
||
sequence |
int | The Favorite sequence |
||
opts |
Object |
<optional> |
{}
|
Returns:
Favorite Station
- Type
- Favorite
(static) createTransit(agency, division, line, sequence, optsopt) → {Favorite}
- Source:
Favorite Factory: create a Favorite Transit Agency/Division/Line
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
agency |
TransitAgency | The Transit Agency of the Favorite Transit |
||
division |
TransitDivision | undefined | The Transit Division of the Favorite Transit |
||
line |
TransitLine | undefined | The Transit Line of the Favorite Transit |
||
sequence |
int | The Favorite sequence |
||
opts |
Object |
<optional> |
{}
|
Returns:
Favorite Transit
- Type
- Favorite
(static) createTrip(origin, destination, sequence, optsopt) → {Favorite}
- Source:
Favorite Factory: create a Favorite Trip
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
origin |
Stop | The origin of the Favorite Trip |
||
destination |
Stop | The destination of the Favorite Trip |
||
sequence |
int | The Favorite sequence |
||
opts |
Object |
<optional> |
{}
|
Returns:
Favorite Trip
- Type
- Favorite
(static) sortBySequence(a, b) → {number}
- Source:
Sort Favorites by sequence (ascending)
Parameters:
Name | Type | Description |
---|---|---|
a |
Favorite | first Favorite |
b |
Favorite | second Favorite |
Returns:
compare integer
- Type
- number
isStation() → {boolean}
- Source:
Check if the Favorite is a Favorite Station
Returns:
true if Station
- Type
- boolean
isTransit() → {boolean}
- Source:
Check if the Favorite is a Favorite Transit
Returns:
true if Transit
- Type
- boolean
isTrip() → {boolean}
- Source:
Check if the Favorite is a Favorite Trip
Returns:
true if Trip
- Type
- boolean
Type Definitions
FavoriteStationOptions
- Source:
The Options for a Favorite Station
Type:
- Object
FavoriteStationParameters
- Source:
Properties:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
stop |
Stop | The Favorite Station Properties
|
The Parameters for a Favorite Station
Type:
- Object
FavoriteTransitOptions
- Source:
The Options for a Favorite Transit
Type:
- Object
FavoriteTransitParameters
- Source:
Properties:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
agency |
TransitAgency | The Transit Agency Properties
|
|||||||||
division |
TransitDivision | The Transit Division Properties
|
|||||||||
line |
TransitLine | The Transit Line Properties
|
The Parameters for a Favorite Transit
Type:
- Object
FavoriteTripOptions
- Source:
Properties:
Name | Type | Description |
---|---|---|
allowTransfers |
boolean | Allow the Trip Result to include transfers |
The Options for a Favorite Trip
Type:
- Object
FavoriteTripParameters
- Source:
Properties:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
origin |
Stop | The Origin Stop Properties
|
|||||||||
destination |
Stop | The Destination Stop Properties
|
The Parameters for a Favorite Trip
Type:
- Object