Source code: hsr/ipm/storing/AsSequence.java
1 package hsr.ipm.storing;
2
3 import java.util.ArrayList;
4
5 /*
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21
22 /**
23 * Structures HopSequences which have same order of Autonomous Systems.
24 *
25 * @author Christian Niklaus
26 * @author Daniel Kamm
27 * @version 1.0
28 */
29 public class AsSequence
30 {
31 // constants
32
33
34 // constructors
35 public AsSequence()
36 {
37
38 }
39
40
41 // properties / helping methods
42 /**
43 * Primary key of database
44 */
45 private long id;
46 public long getId()
47 {
48 return id;
49 }
50 public void setId(long id)
51 {
52 this.id = id;
53 }
54
55 /**
56 * List contains objects of As to present an AS.
57 */
58 private ArrayList asList;
59 public ArrayList getAsList()
60 {
61 return asList;
62 }
63 public void setAsList(ArrayList list)
64 {
65 asList = list;
66 }
67
68 /**
69 * List with round trip times between two AS, measures the link in between those
70 * ASses.
71 */
72 private ArrayList asLinkRTTs;
73 public ArrayList getAsLinkRTTs()
74 {
75 return asLinkRTTs;
76 }
77 public void setAsLinkRTTs(ArrayList list)
78 {
79 asLinkRTTs = list;
80 }
81
82 /**
83 * Average round trip time of all traceroutes within this AsSequence.
84 */
85 private float avgRTT;
86 public float getAvgRTT()
87 {
88 return avgRTT;
89 }
90 public void setAvgRTT(float rtt)
91 {
92 avgRTT = rtt;
93 }
94
95 /**
96 * Minimal round trip time of all traceroutes within this AsSequence.
97 */
98 private float minRTT;
99 public float getMinRTT()
100 {
101 return minRTT;
102 }
103 public void setMinRTT(float rtt)
104 {
105 minRTT = rtt;
106 }
107
108 /**
109 * Maximal round trip time of all traceroutes within this AsSequence.
110 */
111 private float maxRTT;
112 public float getMaxRTT()
113 {
114 return maxRTT;
115 }
116 public void setMaxRTT(float rtt)
117 {
118 maxRTT = rtt;
119 }
120
121 /**
122 * List contains all HopSequences belonging to a specific AsSequence.
123 */
124 private ArrayList hopSequences = new ArrayList();
125 public ArrayList getHopSequences()
126 {
127 return hopSequences;
128 }
129 public void setHopSequences(ArrayList seq)
130 {
131 hopSequences = seq;
132 }
133 /**
134 * Adds the given HopSequence to the intern List of HopSequences and increments
135 * the HopSequence counter.
136 * @param hopSeq
137 */
138 public void addHopSequence(HopSequence hopSeq)
139 {
140 hopSequences.add(hopSeq);
141 hopSequencesCount++;
142 }
143
144 /**
145 * Sum of all HopSequences belonging to this AsSequence
146 */
147 private int hopSequencesCount;
148 public int getHopSequencesCount()
149 {
150 return hopSequencesCount;
151 }
152 public void setHopSequencesCount(int value)
153 {
154 hopSequencesCount = value;
155 }
156
157 /**
158 * Sum of all Traces belonging to this AsSequence
159 */
160 private int traceCount;
161 public int getTraceCount()
162 {
163 return traceCount;
164 }
165 public void setTraceCount(int in)
166 {
167 traceCount = in;
168 }
169
170 /**
171 * Indicates the preferred HopSequence, thats the HopSequence which is used by
172 * the most traces
173 */
174 private HopSequence preferredHopSequence;
175 public HopSequence getPreferredHopSequence()
176 {
177 return preferredHopSequence;
178 }
179 public void setPreferredHopSequence(HopSequence in)
180 {
181 preferredHopSequence = in;
182 }
183
184 // public methods
185
186 /**
187 * Test main to test whois parsing.
188 */
189 public static void main(String args[])
190 {
191 AsSequence seq = new AsSequence();
192 }
193
194
195 }