-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLeave.java
More file actions
45 lines (34 loc) · 1005 Bytes
/
Leave.java
File metadata and controls
45 lines (34 loc) · 1005 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
40
41
42
43
44
45
class Leave implements Event {
private final Customer customer;
private final double time;
private static final int priority = 3;
private final boolean toPrint;
private static final EventType type = EventType.LEAVE;
Leave(Customer customer) {
this.customer = customer;
this.time = this.customer.getTime();
this.toPrint = true;
}
public Pair<Event, ImList<Servable>> process(ImList<Servable> server) {
return new Pair<Event, ImList<Servable>>(this, server);
}
public Customer getCustomer() {
return this.customer;
}
public double getTime() {
return this.time;
}
public EventType getType() {
return Leave.type;
}
public int getPriority() {
return Leave.priority;
}
public boolean canPrint() {
return this.toPrint;
}
@Override
public String toString() {
return String.format("%.3f %s leaves", this.getTime(), this.customer);
}
}