47 lines
1.0 KiB
Java
47 lines
1.0 KiB
Java
package fr.ntr;
|
|
|
|
public class Packets {
|
|
static final int packetSize = 100;
|
|
private int startTimeSending;
|
|
private int endTimeSending;
|
|
private int durationSending;
|
|
private int bitsNumberRemaining;
|
|
|
|
public Packets(int startTimeSending){
|
|
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;
|
|
}
|
|
|
|
|
|
} |