|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ModelInterface Public interface to be used with Model object. PLEASE EMAIL INTERFACE CHANGE REQUESTS TO MIKAM TRIBE: margaux, ianli, kkchen, alexcho, meilye
| Method Summary | |
Date |
addCustomer(Customer customer)
Adds a customer in system. PRECONDITION: Customer must have the following information set already: - call-in time - pickup address - pickup time - destination address POSTCONDITION: customer's information is set scheduler now has customer within domain datastore knows of ride request |
boolean |
cabIsScheduled(Cab cab)
Mark cab as scheduled. |
void |
cabRefusedRide(int cab_id,
int zone_id)
Called when the cab refuses a ride we must update the cab in the model to be placed in the back PRECONDITION: POSTCONDITION: |
void |
cancelCab(int cab_id,
Customer cancelledCustomer)
Cancels scheduled cab, assumes customer field in cab is set scheduler calls when cancelled customer not found in waiting customer queue and msg needs to be relayed to cab console, cab will be placed back into front of zone which cab is found in assume customer's cab field will be set elsewhere (by scheduler) PRECONDITION: customer corresponding to cab has been canceled POSTCONDITION: cab is still in busy cab list, everything but zone is set correctly |
Boolean |
cancelCustomer(String customerPhone,
String customerLastName,
String customerFirstName)
Cancel the customer, returns true for successful cancellation |
Date |
changeCustomer(Customer oldCust,
Customer newCust)
Changes customer in the system For Dispatcher UI |
Vector |
getAllBusyCabs()
Returns the list of busy cabs. PRECONDITION: none POSTCONDITION: none |
Vector |
getArrivingCabs(int zone_id)
Returns all arriving cabs to specified zone; to be used when no cabs available in desired zone. Assumes that the customer field in the cab is set correctly |
Cab |
getBusyCab(int cab_id)
Gets (but does NOT remove) the cab with cab_id from the busy list. -used during actual customer pick-up PRECONDITION: none POSTCONDITION: none |
Vector |
getBusyCabsInZone(int zone_id)
Returns list of busy cabs in specified zone (destination zone of busy cab) PRECONDITION: none POSTCONDITION: none |
Cab |
getCab(int cab_id)
Returns referenced Cab object from zone list--does not remove cab PRECONDITION: cab is waiting in a zone POSTCONDITION: none |
Customer |
getCustomer(String customerPhone,
String customerLastName,
String customerFirstName)
Returns the Customer identified by the phone number and last name PRECONDITION: scheduler contains the target customer POSTCONDITION: none |
ManagerReport |
getManagerReport(int typeOfReport,
int specificity,
int timeInterval,
Date from,
Date to)
Passes ManagerReport request from ManagerUI to DataStore |
Vector |
getOpenCabs(int zone_id)
Returns all open cabs within specified zone. PRECONDITION: none POSTCONDITION: none |
Zone |
getZone(int zone_id)
Returns specified zone. PRECONDITION: zone_id is a legal zone POSTCONDITION: none |
boolean |
isCreditCardAccepted(double chargedAmount,
String creditCardNumber)
"Approve" credit card -- passes the charge amount and creditCardNumber to bank and sees if the card is approved PRECONDITION: none POSTCONDITION: none |
boolean |
manualDispatchCab(Cab cab,
Customer customer)
Dispatches specified cab to specified customer (NOT YET IMPLEMENTED). |
Boolean |
registerCabToModel(CabConsoleInterface cabConsole,
int cab_id,
int driver_id,
String gps)
registers the cab in the model if cab_id and driver_id are valid (in database) PRECONDITION: both cab and driver identified by cab_id and driver_id registers for the first time. POSTCONDITION: a cab object corresponding to the cab console has been created and placed in its respective zone in the model |
void |
rescheduleCustomer(Customer failedScheduling)
Passes a customer object to a DispatcherUI object for rescheduling. |
boolean |
rideRequest(Customer iWannaRide,
int cab_id)
For Scheduler Relays ride request from scheduler to cab console Responsible only for relaying messages PRECONDITION: valid cab id cab currently in the model POSTCONDITION: none |
boolean |
updateModelCabInfo(String cust_info)
For Cab Console: Called after console updates referenced cab object, this method triggers necessary model updates Case 0: customer dropped off Case 2: customer has been picked up Case 3: customer has canceled and cab has been canceled PRECONDITION: cab console has changed its status and needs to be updated in the model case 0: cab is busy case 2: none case 3: cab has been emptied of its customer and is in the busy cab list POSTCONDITION: case 0: cab is waiting in its appropriate zone case 2: pickup time for customer in database has been updated case 3: cab waiting at front of zone's cab list |
| Method Detail |
public Date addCustomer(Customer customer)
customer - customer object to be added
public Boolean cancelCustomer(String customerPhone,
String customerLastName,
String customerFirstName)
customer_id - customerLastName -
public Date changeCustomer(Customer oldCust,
Customer newCust)
old - customer - copynew - customer
public Customer getCustomer(String customerPhone,
String customerLastName,
String customerFirstName)
customerPhone - customerLastName - public Cab getCab(int cab_id)
public Cab getBusyCab(int cab_id)
public Vector getBusyCabsInZone(int zone_id)
public Vector getAllBusyCabs()
public Zone getZone(int zone_id)
zone_id - ID of requested zone
public boolean manualDispatchCab(Cab cab,
Customer customer)
cab - the cab to be dispatchedcustomer - the customer that will be picked uppublic Vector getOpenCabs(int zone_id)
zone_id - zone to get cabs frompublic Vector getArrivingCabs(int zone_id)
zone_id - the ID of the zone from which to get arriving cabs
public boolean rideRequest(Customer iWannaRide,
int cab_id)
Customer - who requests ridecab_id - of cab to requestpublic boolean cabIsScheduled(Cab cab)
cab - is the busy cab (reservation)
public void cancelCab(int cab_id,
Customer cancelledCustomer)
cab_id - of cab to cancel
public void cabRefusedRide(int cab_id,
int zone_id)
cab_id - ID of cab that refusedzone_id - ID of zone where cab is locatedpublic boolean updateModelCabInfo(String cust_info)
must - be in this format:
public Boolean registerCabToModel(CabConsoleInterface cabConsole,
int cab_id,
int driver_id,
String gps)
public boolean isCreditCardAccepted(double chargedAmount,
String creditCardNumber)
chargedAmount - amount to chargecreditCardNumber - credit card number
public ManagerReport getManagerReport(int typeOfReport,
int specificity,
int timeInterval,
Date from,
Date to)
typeOfReport - - type of reportspecificity - timeInterval - from - - starting date for queryto - - ending date for querypublic void rescheduleCustomer(Customer failedScheduling)
Customer - - Customer who needs to be manually scheduled.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||