taxisrus.implementation
Class Customer

java.lang.Object
  |
  +--taxisrus.implementation.Customer
All Implemented Interfaces:
Serializable

public class Customer
extends Object
implements Serializable

Customer object Represents a human customer.

Author:
MIKAM Tribe Team Last Update $Date$ Please contact author for change/inquiry requests.
See Also:
Serialized Form

Field Summary
protected  Date _actualPickupTime
           
protected  Cab _cab
           
protected  Date _callInTime
           
protected  String _corporateAccountName
           
protected  String _destinationAddress
           
protected  Zone _destinationZone
           
protected  Date _ETA
           
protected  String _firstName
           
protected  String _id
           
protected  boolean _isCorporateAccount
           
protected  String _lastName
           
protected  int _numberOfRiders
           
protected  String _phoneNumber
           
protected  String _pickupAddress
           
protected  Date _pickupTime
           
protected  Zone _pickupZone
           
protected  int _priority
           
protected  int _status
           
static int COMMUNICATING
           
static int DEFAULT_STATUS
           
static int FAILED_PLACEMENT
           
static int HIGH_PRIORITY
           
static int PICKED_UP
           
static int RIDE_CANCELLED
           
static int SCHEDULED
           
static int WAITING
           
 
Constructor Summary
Customer()
          Default constructor.
Customer(String firstName, String lastName)
          Constructor with just first and last name of customer Number of riders of this customer is default to 1.
Customer(String firstName, String lastName, String phoneNumber)
          Constructor with name and phone number of customer Number of riders of this customer is default to 1.
Customer(String firstName, String lastName, String phoneNumber, Date callInTime, String pickupAddress, String destinationAddress, Date pickupTime, int priority)
          Constructor with all possible information of a customer Number of riders of this customer is default to 1.
Customer(String firstName, String lastName, String phoneNumber, Date callInTime, String pickupAddress, String destinationAddress, Date pickupTime, int priority, int numberOfRiders, String corporateAccountName)
          Constructor with all possible information of a corporate account
 
Method Summary
 Date getActualPickupTime()
          Returns the actual pickup time of the customer.
 Cab getCab()
          Gets the cab assigned to this customer.
 Date getCallInTime()
          Gets the time of customer call for the cab.
 String getCorporateAccountName()
          Returns the name of corporate account.
 String getDestinationAddress()
          Gets the destination address.
 Zone getDestinationZone()
          Gets destination zone.
 Date getETA()
          Gets the ETA corresponding to the customer for the data store.
 String getFirstName()
          Gets first name of customer.
 String getId()
          Gets the ID of this customer.
 String getLastName()
          Gets last name of customer.
 int getNumberOfRiders()
          Gets the number of riders of this customer.
 String getPhoneNumber()
          Gets customer's phone number
 String getPickupAddress()
          Gets the pickup address.
 Date getPickupTime()
          Gets the customer's requested pickup time.
 Zone getPickupZone()
          Gets pickup zone.
 int getPriority()
          Gets the customer priority.
 int getStatus()
          Gets the status of this customer WAITING = 0 SCHEDULED = 1 PICKED_UP = 2
 boolean isCorporateAccount()
          Returns whether customer is a corporate account.
 void setActualPickupTime(Date actualPickupTime)
          Sets actual pickup time.
 void setCab(Cab cab)
          Sets the cab for this customer.
 void setCallInTime(Date callInTime)
          Sets the time of customer call for the cab.
 void setCorporateAccountName(String corporateAccountName)
          Sets the corporate account name.
 void setDestinationAddress(String destinationAddress)
          Sets the destination address of customer.
 void setDestinationZone(Zone destinationZone)
          Sets destination zone.
 void setETA(Date date)
          Sets the ETA for the customer corresponding ETA for storage in the data store.
 void setIsCorporateAccount(boolean corp)
          Sets whether customer is a corporate account
 void setName(String firstName, String lastName)
          Sets name of customer.
 void setNumberOfRiders(int numberOfRiders)
          Sets the number of riders of this customer.
 void setPhoneNumber(String phoneNumber)
          Sets customer's phone number.
 void setPickupAddress(String pickupAddress)
          Sets the pickup address of customer.
 void setPickupTime(Date pickupTime)
          Sets the customer's requested pickup time.
 void setPickupZone(Zone pickupZone)
          Sets pickup zone.
 void setPriority(int priority)
          Sets the customer priority.
 void setStatus(int status)
          Sets the status of this customer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_firstName

protected String _firstName

_lastName

protected String _lastName

_corporateAccountName

protected String _corporateAccountName

_isCorporateAccount

protected boolean _isCorporateAccount

_phoneNumber

protected String _phoneNumber

_callInTime

protected Date _callInTime

_pickupAddress

protected String _pickupAddress

_pickupZone

protected Zone _pickupZone

_destinationAddress

protected String _destinationAddress

_destinationZone

protected Zone _destinationZone

_pickupTime

protected Date _pickupTime

_priority

protected int _priority

_cab

protected Cab _cab

_numberOfRiders

protected int _numberOfRiders

_status

protected int _status

_id

protected String _id

_ETA

protected Date _ETA

_actualPickupTime

protected Date _actualPickupTime

DEFAULT_STATUS

public static final int DEFAULT_STATUS

WAITING

public static final int WAITING

COMMUNICATING

public static final int COMMUNICATING

SCHEDULED

public static final int SCHEDULED

HIGH_PRIORITY

public static final int HIGH_PRIORITY

RIDE_CANCELLED

public static final int RIDE_CANCELLED

PICKED_UP

public static final int PICKED_UP

FAILED_PLACEMENT

public static final int FAILED_PLACEMENT
Constructor Detail

Customer

public Customer()
Default constructor. Should never be used. All fields are left as default values.

Customer

public Customer(String firstName,
                String lastName)
Constructor with just first and last name of customer Number of riders of this customer is default to 1. Other fields are left as default values: null or -1, except the parameter(s).
Parameters:
firstName - customer's first name
lastName - customer's last name

Customer

public Customer(String firstName,
                String lastName,
                String phoneNumber)
Constructor with name and phone number of customer Number of riders of this customer is default to 1. Other fields are left as default values: null or -1, except the parameter(s).
Parameters:
firstName - customer's first name
lastName - customer's last name
phoneNumber - customer's phone number

Customer

public Customer(String firstName,
                String lastName,
                String phoneNumber,
                Date callInTime,
                String pickupAddress,
                String destinationAddress,
                Date pickupTime,
                int priority)
Constructor with all possible information of a customer Number of riders of this customer is default to 1.
Parameters:
firstName -  
lastName -  
phoneNumber -  
pickupAddress -  
destinationAddress -  
pickupTime - customer's requested pickup time
priority -  

Customer

public Customer(String firstName,
                String lastName,
                String phoneNumber,
                Date callInTime,
                String pickupAddress,
                String destinationAddress,
                Date pickupTime,
                int priority,
                int numberOfRiders,
                String corporateAccountName)
Constructor with all possible information of a corporate account
Parameters:
firstName -  
lastName -  
phoneNumber -  
pickupAddress -  
destinationAddress -  
pickupTime -  
priority -  
numberOfRiders -  
corporateAccountName -  
Method Detail

setName

public void setName(String firstName,
                    String lastName)
Sets name of customer.
Parameters:
firstName -  
lastName -  

getFirstName

public String getFirstName()
Gets first name of customer.
Returns:
String or null if not set.

getLastName

public String getLastName()
Gets last name of customer.
Returns:
String or null if not set.

setPhoneNumber

public void setPhoneNumber(String phoneNumber)
Sets customer's phone number.
Parameters:
phoneNumber -  

getPhoneNumber

public String getPhoneNumber()
Gets customer's phone number
Returns:
String or null if not set.

setPickupAddress

public void setPickupAddress(String pickupAddress)
Sets the pickup address of customer.
Parameters:
pickupAddress -  

getPickupAddress

public String getPickupAddress()
Gets the pickup address.
Returns:
String or null if not set.

setPickupZone

public void setPickupZone(Zone pickupZone)
Sets pickup zone.
Parameters:
pickupZone -  

getPickupZone

public Zone getPickupZone()
Gets pickup zone.
Returns:
Zone or null if not set.

setDestinationAddress

public void setDestinationAddress(String destinationAddress)
Sets the destination address of customer.
Parameters:
destinationAddress -  

getDestinationAddress

public String getDestinationAddress()
Gets the destination address.
Returns:
String or null if not set.

setDestinationZone

public void setDestinationZone(Zone destinationZone)
Sets destination zone.
Parameters:
destinationZone -  

getDestinationZone

public Zone getDestinationZone()
Gets destination zone.
Returns:
Zone or null if not set.

setPickupTime

public void setPickupTime(Date pickupTime)
Sets the customer's requested pickup time.
Parameters:
pickupTime -  

getPickupTime

public Date getPickupTime()
Gets the customer's requested pickup time.
Returns:
Date or null if not set.

setPriority

public void setPriority(int priority)
Sets the customer priority.
Parameters:
priority -  

getPriority

public int getPriority()
Gets the customer priority.
Returns:
int or -1 if not set.

setCab

public void setCab(Cab cab)
Sets the cab for this customer.
Parameters:
cab -  

getCab

public Cab getCab()
Gets the cab assigned to this customer.
Returns:
Cab or null if not set.

setNumberOfRiders

public void setNumberOfRiders(int numberOfRiders)
Sets the number of riders of this customer.
Parameters:
numberOfRiders -  

getNumberOfRiders

public int getNumberOfRiders()
Gets the number of riders of this customer.
Returns:
int or -1 if not set.

setCallInTime

public void setCallInTime(Date callInTime)
Sets the time of customer call for the cab.
Parameters:
callInTime; -  

getCallInTime

public Date getCallInTime()
Gets the time of customer call for the cab.
Returns:
Date or null if not set.

getId

public String getId()
Gets the ID of this customer.
Returns:
String or null if not set.

setStatus

public void setStatus(int status)
Sets the status of this customer. WAITING = 0 SCHEDULED = 1 PICKED_UP = 2
Parameters:
status -  

getStatus

public int getStatus()
Gets the status of this customer WAITING = 0 SCHEDULED = 1 PICKED_UP = 2
Returns:
int or -1 if not set.

getETA

public Date getETA()
Gets the ETA corresponding to the customer for the data store.
Returns:
the ETA for the customer

setETA

public void setETA(Date date)
Sets the ETA for the customer corresponding ETA for storage in the data store.
Parameters:
ETA - from Scheduler to DataStore

isCorporateAccount

public boolean isCorporateAccount()
Returns whether customer is a corporate account.
Returns:
true, if is corporate account; false, otherwise.

setIsCorporateAccount

public void setIsCorporateAccount(boolean corp)
Sets whether customer is a corporate account
Parameters:
corp - true or false; whether the customer is a corporate account

getCorporateAccountName

public String getCorporateAccountName()
Returns the name of corporate account. There is no guarantee that this name is set; users should check that the customer is a corporate account
Returns:
the name of the corporate account

setCorporateAccountName

public void setCorporateAccountName(String corporateAccountName)
Sets the corporate account name.
Parameters:
corporateAccountName - the name of the corporate account

getActualPickupTime

public Date getActualPickupTime()
Returns the actual pickup time of the customer.
Returns:
the actual pickup time for the customer

setActualPickupTime

public void setActualPickupTime(Date actualPickupTime)
Sets actual pickup time.
Parameters:
actualPickupTime - Date object containing the time at which the customer was picked up.


API documentation for build 958