import java.util.Random; /** * Class that models a bank customer, with a specific ID number, * arrival time, and (random) transaction length. * * @author Dave Reed * @version 4/15/05 */ public class Customer { private static final int MAX_LENGTH = 8; private static final Random rand = new Random(); private static int nextID = 1; private int customerID; private int arrivalTime; private int jobLength; /** * Constructs a customer with the next available ID number, * the specified arrival time, and a random job length. * @param arrTime the time at which the customer arrives */ public Customer(int arrTime) { customerID = nextID; nextID++; arrivalTime = arrTime; jobLength = rand.nextInt(MAX_LENGTH)+1; } /** * Accessor method for getting the customer's ID number. * @return the customer ID */ public int getID() { return customerID; } /** * Accessor method for getting the customer's arrival time. * @return the time at which the customer arrived */ public int getArrivalTime() { return arrivalTime; } /** * Accessor method for getting the length of the job * @return the job length (in minutes) */ public int getJobLength() { return jobLength; } }