This repository has been archived on 2023-08-28. You can view files and clone it, but cannot push or open issues or pull requests.
ntr-interferences/src/main/java/fr/ntr/Packets.java

48 lines
1.1 KiB
Java
Raw Permalink Normal View History

2023-03-03 10:38:35 +01:00
package fr.ntr;
public class Packets {
static final int PACKET_SIZE = 100;
private int startTimeSending;
2023-03-03 11:10:21 +01:00
private int endTimeSending;
private int durationSending;
2023-03-24 12:12:18 +01:00
private int bitsNumberRemaining;
2023-03-03 11:10:21 +01:00
public Packets(int startTimeSending){
this.bitsNumberRemaining = PACKET_SIZE;
this.startTimeSending = startTimeSending;
}
2023-03-24 12:12:18 +01:00
public double getBitsNumberRemaining() {
return bitsNumberRemaining;
}
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-24 12:12:18 +01:00
public void setDurationSending(int ticks){
this.durationSending = ticks - startTimeSending;
}
public int getDurationSending() {
return durationSending;
}
2023-03-24 12:12:18 +01:00
public void decreaseBitsNumberRemaining(int d) {
this.bitsNumberRemaining -= d;
}
2023-03-10 09:17:15 +01:00
}