|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--TransitSystem
This class builds and manages the transit system for homework 5.
Constructor Summary | |
TransitSystem()
Create a set of buses for this transit system. |
Method Summary | |
void |
addBus(TransitBus bus)
Add a bus to the busList. |
TransitBus |
findClosestBus(Locatable obj)
Find the bus closest to the given Locatable object |
TransitBus |
findClosestBusOnRoute(int route,
Locatable obj)
Find the bus on a particular route that is closest to the given Locatable object |
void |
printBusList()
Print out all the buses in the bus list. |
void |
printBusOnRouteList(int r)
Print out all the buses in the bus list that are on a given route. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TransitSystem()
Method Detail |
public void addBus(TransitBus bus)
bus
- the TransitBus to add to the list.public void printBusList()
public void printBusOnRouteList(int r)
r
- the route to look forpublic TransitBus findClosestBus(Locatable obj)
obj
- a Locatable object
public TransitBus findClosestBusOnRoute(int route, Locatable obj)
route
- the route of interestobj
- a Locatable object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |