Revision 104,
873 bytes
checked in by wojtekp, 13 years ago
(diff) |
|
-
Property svn:mime-type set to
text/plain
|
Line | |
---|
1 | package schedframe.net.pce.topology; |
---|
2 | |
---|
3 | import java.util.Iterator; |
---|
4 | |
---|
5 | public class ExtendedDataLink extends DataLink { |
---|
6 | |
---|
7 | protected double latency; |
---|
8 | |
---|
9 | public ExtendedDataLink(String id, Node endpoint1, Node endpoint2, |
---|
10 | long bandwidth, double latency) { |
---|
11 | super(id, endpoint1, endpoint2, bandwidth); |
---|
12 | this.latency = latency; |
---|
13 | } |
---|
14 | |
---|
15 | public double getLatency() { |
---|
16 | return latency; |
---|
17 | } |
---|
18 | |
---|
19 | public void setLatency(double latency) { |
---|
20 | this.latency = latency; |
---|
21 | } |
---|
22 | |
---|
23 | public long getCalendarValue(long time) { |
---|
24 | long bandwidth = getBandwidth(); |
---|
25 | Iterator<AvailableBandwidth> it = calendar.iterator(); |
---|
26 | while (it.hasNext()) { |
---|
27 | AvailableBandwidth availableBandwidth = (AvailableBandwidth) it.next(); |
---|
28 | if (time < availableBandwidth.getTimestamp()) { |
---|
29 | bandwidth = availableBandwidth.getValue(); |
---|
30 | return bandwidth; |
---|
31 | } |
---|
32 | } |
---|
33 | return bandwidth; |
---|
34 | } |
---|
35 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.