transport
Class Line
java.lang.Object
transport.TransportationObject
transport.Line
public class Line
- extends TransportationObject
Represents a public transportation line.
Method Summary |
Station |
getStationForName(java.lang.String name)
Returns the station with the given name on the line, if there is such
a station, or null otherwise. |
java.util.List<Station> |
getStations()
Returns the ordered list of stations belonging to the line. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
getStations
public java.util.List<Station> getStations()
- Returns the ordered list of stations belonging to the line.
- Returns:
- the list of stations
getStationForName
public Station getStationForName(java.lang.String name)
- Returns the station with the given name on the line, if there is such
a station, or
null
otherwise.
- Parameters:
name
- the name of the station (case-insensitive)
- Returns:
- the
Station
object
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object