-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCustomer.java
More file actions
39 lines (33 loc) · 885 Bytes
/
Customer.java
File metadata and controls
39 lines (33 loc) · 885 Bytes
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
class Customer {
private final double arrivalTime;
private final double serviceTime;
private final int index;
Customer(double arrivalTime, double serviceTime, int index) {
this.arrivalTime = arrivalTime;
this.serviceTime = serviceTime;
this.index = index;
}
public double getArrivalTime() {
return this.arrivalTime;
}
public double getServiceTime() {
return this.serviceTime;
}
public int getIndex() {
return this.index;
}
@Override
public String toString() {
return String.valueOf(index);
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
} else if (obj instanceof Customer customer) {
return this.index == customer.index;
} else {
return false;
}
}
}