source: xssim/trunk/src/simulator/stats/implementation/NetworkReservationStats.java @ 104

Revision 104, 2.1 KB checked in by wojtekp, 13 years ago (diff)
  • Property svn:mime-type set to text/plain
Line 
1package simulator.stats.implementation;
2
3import java.util.ArrayList;
4import java.util.List;
5
6import simulator.stats.implementation.out.StatsSerializer;
7
8/**
9 *
10 * @author Marcin Krystek
11 *
12 */
13public class NetworkReservationStats implements StatsInterface {
14
15        protected int reservationID;
16        protected List<String> route;
17        protected long startTime;
18        protected long endTime;
19        protected double flowsSize;
20        protected double bandwidth;
21        protected double load;
22        protected String status;
23
24        private String[] headers = { "reservation ID", "links", "start date", "end date",
25                        "bandwidth(bits)", "size of transmitted data(in bytes)", "load",
26                        "status" };
27
28        NetworkReservationStats(int reservationID) {
29                this.reservationID = reservationID;
30                init();
31        }
32
33        public void init() {
34                this.route = new ArrayList<String>();
35                this.startTime = 0;
36                this.endTime = 0;
37                this.flowsSize = 0;
38                this.bandwidth = 0;
39                this.load = 0;
40                this.status = new String();
41        }
42
43        public Object serialize(StatsSerializer serializer) {
44                return serializer.visit(this);
45        }
46
47        public int getReservationID() {
48                return reservationID;
49        }
50
51        public void setReservationID(int reservationID) {
52                this.reservationID = reservationID;
53        }
54
55        public List<String> getRoute() {
56                return route;
57        }
58
59        public void setRoute(List<String> route) {
60                this.route = route;
61        }
62
63        public long getStartTime() {
64                return startTime;
65        }
66
67        public void setStartTime(long startTime) {
68                this.startTime = startTime;
69        }
70
71        public long getEndTime() {
72                return endTime;
73        }
74
75        public void setEndTime(long endTime) {
76                this.endTime = endTime;
77        }
78
79        public double getFlowsSize() {
80                return flowsSize;
81        }
82
83        public void setFlowsSize(double flowsSize) {
84                this.flowsSize = flowsSize;
85        }
86
87        public double getBandwidth() {
88                return bandwidth;
89        }
90
91        public void setBandwidth(double bandwidth) {
92                this.bandwidth = bandwidth;
93        }
94
95        public double getLoad() {
96                return load;
97        }
98
99        public void setLoad(double load) {
100                this.load = load;
101        }
102
103        public String getStatus() {
104                return status;
105        }
106
107        public void setStatus(String status) {
108                this.status = status;
109        }
110
111        public String[] getHeaders() {
112                return headers;
113        }
114}
Note: See TracBrowser for help on using the repository browser.