-
Notifications
You must be signed in to change notification settings - Fork 0
/
Packet.java
78 lines (61 loc) · 1.99 KB
/
Packet.java
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
public class Packet {
private String name;
private int id;
private int arrivalTime; // Χρονική σχισμή κατά την οποία το πακέτο έφτασε στο σταθμό
private int transmissionTime; // Time slot when the packet started transmitting
private int deliveryTime; // Χρονική σχισμή κατά την οποία το πακέτο παραδόθηκε στον προορισμό
private String sourceStation;
private String destination;
public Packet(String name, int id, int arrivalTime, String sourceStation, String destination) {
this.name = name;
this.id = id;
this.arrivalTime = arrivalTime;
this.sourceStation = sourceStation;
this.destination = destination;
this.transmissionTime = -1;
this.deliveryTime = -1;
}
// Getters and Setters
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getArrivalTime() {
return arrivalTime;
}
public void setArrivalTime(int arrivalTime) {
this.arrivalTime = arrivalTime;
}
public int getTransmissionTime() {
return transmissionTime;
}
public void setTransmissionTime(int transmissionTime) {
this.transmissionTime = transmissionTime;
}
public int getDeliveryTime() {
return deliveryTime;
}
public void setDeliveryTime(int deliveryTime) {
this.deliveryTime = deliveryTime;
}
public String getSourceStation() {
return sourceStation;
}
public void setSourceStation(String sourceStation) {
this.sourceStation = sourceStation;
}
public String getDestination() {
return destination;
}
public void setDestination(String destination) {
this.destination = destination;
}
}