/* * IBusStop.java * * Created on August 8, 2003, 11:36 PM * * @author Zuo Yan */ package mvc143; import java.util.Collection; /** The interface to a bus stop in the bus system model. *

* A bus stop object contains data about a particular bus stop in the bus * system model. A bus stop is created with a latitude and longitude postion * from the model. Each bus stop contains data about the people currently * waiting at the bus stop. *

* Note that instantiation of a new bus stop should only be done in the model, * because each model can have a different internal representation. */ public interface IBusStop { /** Gets the model dependent object identifying this bus stop. *
* Note: it is not a requirement that ids have to be unique * * @return the object identifying this bus stop */ Object getID(); /** Indicates whether a bus stop is "equal" to this one * * @param other the bus stop to compare to * @return true if they are the same; false otherwise */ boolean equals(IBusStop other); /** Gets the collection of IPerson currently waiting at this bus stop *
* Note: changes to the collection is directly reflected in the model. * * @return the collection of people waiting */ Collection getWaiting(); /** Adds a person to wait at this bus stop * * @param p the person to add */ void add(IPerson p); /** Gets the next person in the waiting line of this bus stop * * @return the next person or null if there is no one waiting */ IPerson getNext(); /** Removes the next person in line from this bus stop * * @return the person previously next in line or * null if there was no one waiting */ IPerson removeNext(); /** Gets the latitude coordinate of this bus stop * * @return the latitude position */ double getLatitude(); /** Gets the longitude coordinate of this bus stop * * @return the longitude position */ double getLongitude(); }