Class Route
java.lang.Object
id.klacak.bus_navigator.Route
- Direct Known Subclasses:
Feeder
A transit route with an ordered, circular sequence of stops.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAppends a stop to the route and associates this route with that stop.getColor()Gets the background color used to display this route.Gets the full descriptive name of this route.Formats the route code and name with ANSI terminal colors.Gets the short code identifying this route.getStops()Gets the stops associated with this route, in travel order.Gets the text color used to display this route.intstopPosition(Stop targetStop) Finds the first position of a stop in this route.toString()
-
Constructor Details
-
Route
Creates a route with its identifying names and display colors.- Parameters:
shortName- route codelongName- descriptive route namecolor- route background color in hexadecimal formattextColor- route text color in hexadecimal format
-
-
Method Details
-
getShortName
-
getLongName
Gets the full descriptive name of this route.- Returns:
- the descriptive route name
-
getColor
Gets the background color used to display this route.- Returns:
- the route background color in hexadecimal format
-
getTextColor
Gets the text color used to display this route.- Returns:
- the route text color in hexadecimal format
-
getNameFormatted
Formats the route code and name with ANSI terminal colors.- Returns:
- colored route code and name
-
getStops
-
toString
-