Class Customer

java.lang.Object
  extended by Customer

public class Customer
extends java.lang.Object

Class for simulation customers. They will use servers. Each customer has an ID and a timestamp. The ID is automatically assigned at the time of customer creation and cannot be changed. The timestamp can be used by any simulation entity that needs to track the time that a significant event for this customer occurred, such as the time a line was entered, or the time that service began.
COMP 2100
Project 3
October 2014


Field Summary
static int NO_TIMESTAMP
           
 
Constructor Summary
Customer()
          Create a new customer.
 
Method Summary
 void clearTimestamp()
          Remove any timestamp.
 int getID()
          Retrieve customer's ID
 int getTimestamp()
          Retrieve the current timestamp.
 void setTimestamp(int time)
          Record timestamp for any relevent event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_TIMESTAMP

public static final int NO_TIMESTAMP
See Also:
Constant Field Values
Constructor Detail

Customer

public Customer()
Create a new customer. The customer has an integer ID assigned automatically. First customer created has ID of 1, second is 2, etc.

Method Detail

getID

public int getID()
Retrieve customer's ID

Returns:
Customer ID, an integer >= 1.

setTimestamp

public void setTimestamp(int time)
Record timestamp for any relevent event. A customer can be only one place at a time in the simulation so this can be re-used without conflict.


getTimestamp

public int getTimestamp()
Retrieve the current timestamp. If no timestamp has been set

Returns:
Current timestamp, or NO_TIMESTAMP if none has been set.

clearTimestamp

public void clearTimestamp()
Remove any timestamp. GetTimestamp() will return NO_TIMESTAMP.