2023-03-03 10:38:35 +01:00
|
|
|
package fr.ntr;
|
|
|
|
|
|
|
|
public class Packets {
|
2023-03-03 11:10:21 +01:00
|
|
|
static final int packetSize = 100;
|
2023-03-17 11:36:27 +01:00
|
|
|
private int startTimeSending;
|
2023-03-03 11:10:21 +01:00
|
|
|
private int endTimeSending;
|
2023-03-17 11:36:27 +01:00
|
|
|
private int durationSending;
|
2023-03-24 12:12:18 +01:00
|
|
|
private int bitsNumberRemaining;
|
2023-03-03 11:10:21 +01:00
|
|
|
|
2023-03-17 11:36:27 +01:00
|
|
|
public Packets(int startTimeSending){
|
2023-03-28 09:51:20 +02:00
|
|
|
this.bitsNumberRemaining = packetSize;
|
2023-03-17 11:36:27 +01:00
|
|
|
this.startTimeSending = startTimeSending;
|
|
|
|
}
|
|
|
|
|
2023-03-24 12:12:18 +01:00
|
|
|
public double getBitsNumberRemaining() {
|
|
|
|
return bitsNumberRemaining;
|
|
|
|
}
|
|
|
|
|
2023-03-17 11:36:27 +01:00
|
|
|
public int getStartTimeSending() {
|
|
|
|
return startTimeSending;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setStartTimeSending(int startTimeSending) {
|
|
|
|
this.startTimeSending = startTimeSending;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getEndTimeSending() {
|
|
|
|
return endTimeSending;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setEndTimeSending(int endTimeSending) {
|
2023-03-24 12:12:18 +01:00
|
|
|
this.endTimeSending = endTimeSending+1;
|
2023-03-03 11:10:21 +01:00
|
|
|
}
|
2023-03-17 11:36:27 +01:00
|
|
|
|
2023-03-24 12:12:18 +01:00
|
|
|
public void setDurationSending(int ticks){
|
|
|
|
this.durationSending = ticks - startTimeSending;
|
2023-03-17 11:36:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public int getDurationSending() {
|
|
|
|
return durationSending;
|
|
|
|
}
|
|
|
|
|
2023-03-24 12:12:18 +01:00
|
|
|
public void decreaseBitsNumberRemaining(int d) {
|
|
|
|
this.bitsNumberRemaining -= d;
|
|
|
|
}
|
|
|
|
|
2023-03-17 11:36:27 +01:00
|
|
|
|
2023-03-10 09:17:15 +01:00
|
|
|
}
|