You are on page 1of 1

MessageStatistics.

java
1 packagestatistics;
2
3 importcore.DTNHost;
5
6 publicclassMessageStatistics{
7
privateDTNHostto;
8
privateDTNHostfrom;
9
privateMessagem;
10
privateDoublecost;/****ADDED****/
11
privatebooleantransfer;
12
13
publicMessageStatistics(DTNHostto,DTNHostfrom,Messagem,Doublecost,/**CHANGED**/
14
booleantransfer){
15
super();
16
this.to=to;
17
this.from=from;
18
this.m=m;
19
this.cost=cost;
20
this.transfer=transfer;
21
}
22
23
publicDTNHostgetTo(){
24
returnto;
25
}
26
27
publicvoidsetTo(DTNHostto){
28
this.to=to;
29
}
30
31
publicDTNHostgetFrom(){
32
returnfrom;
33
}
34
35
publicvoidsetFrom(DTNHostfrom){
36
this.from=from;
37
}
38
39
publicMessagegetM(){
40
returnm;
41
}
42
43
publicvoidsetM(Messagem){
44
this.m=m;
45
}
46
47
publicDoublegetCost(){/**CHANGED**/
48
returncost;
49
}
50
51
publicvoidsetCost(Doublecost){/**CHANGED**/
52
this.cost=cost;
53
}
54
55
publicbooleanisTransfer(){
56
returntransfer;
57
}
58
59
publicvoidsetTransfer(booleantransfer){
60
this.transfer=transfer;
61
}
62
63
@Override
64
publicStringtoString(){
65
returnto.getGroupName()+","+from.getGroupName()+","
66
+m.getCreationTime()+","+m.getReceiveTime()+","
67
+(m.getReceiveTime()m.getCreationTime())+","+cost;
68
}
69
70 }
71

Page1

You might also like