Class PassengerSource

java.lang.Object
  extended by PassengerSource

public class PassengerSource
extends java.lang.Object

Simulate passengers requesting rides from a taxi company. Passengers should be generated at random intervals.

Version:
2006.03.30
Author:
David J. Barnes and Michael Kolling

Constructor Summary
PassengerSource(TaxiCompany company)
          Constructor for objects of class PassengerSource.
 
Method Summary
 boolean requestPickup()
          Have the source generate a new passenger and request a pickup from the company.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PassengerSource

public PassengerSource(TaxiCompany company)
Constructor for objects of class PassengerSource.

Parameters:
company - The company to be used. Must not be null.
Throws:
java.lang.NullPointerException - if company is null.
Method Detail

requestPickup

public boolean requestPickup()
Have the source generate a new passenger and request a pickup from the company.

Returns:
true If the request succeeds, false otherwise.