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

package fr.ntr;
public class Packets {
static final int PACKET_SIZE = 100;
private int startTimeSending;
private int endTimeSending;
private int durationSending;
private int bitsNumberRemaining;
public Packets(int startTimeSending){
this.bitsNumberRemaining = PACKET_SIZE;
this.startTimeSending = startTimeSending;
}
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) {
this.endTimeSending = endTimeSending+1;
}
public void setDurationSending(int ticks){
this.durationSending = ticks - startTimeSending;
}
public int getDurationSending() {
return durationSending;
}
public void decreaseBitsNumberRemaining(int d) {
this.bitsNumberRemaining -= d;
}
}