-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCustomer.java
More file actions
55 lines (44 loc) · 1.29 KB
/
Copy pathCustomer.java
File metadata and controls
55 lines (44 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
The Customer class represents a customer in the checkout queue simulation. Each
customer has a number of items to checkout and timing information for their journey
through the queue system.
*/
import java.util.*;
public class Customer {
// Number of items the customer has
private final int items;
// When the customer enters the line
private final int arrivalTime;
// When the customer starts checkout
private int startTime;
// When the customer finishes checkout
private int endTime;
public Customer(int items, int arrivalTime) {
this.items = items;
this.arrivalTime = arrivalTime;
this.startTime = -1;
this.endTime = -1;
}
public int getItems() {
return items;
}
public int getArrivalTime() {
return arrivalTime;
}
public int getStartTime() {
return startTime;
}
public int getEndTime() {
return endTime;
}
public void setStartTime(int startTime) {
this.startTime = startTime;
}
public void setEndTime(int endTime) {
this.endTime = endTime;
}
@Override
public String toString() {
return "Customer{items=" + items + ", arrivalTime=" + arrivalTime + ", startTime=" + startTime + ", endTime=" + endTime + "}";
}
}