EMMA Coverage Report (generated Tue Dec 18 20:38:46 CET 2007)
[all classes][cz.vutbr.feec.packets.rsi]

## COVERAGE SUMMARY FOR SOURCE FILE [StatisticsBlock.java]

name | class, % | method, % | block, % | line, %
--- | --- | --- | --- | ---
StatisticsBlock.java | 100% (1/1) | 91% (10/11) | 70% (114/162) | 79% (28,6/36)

### COVERAGE BREAKDOWN BY CLASS AND METHOD

name | class, % | method, % | block, % | line, %
--- | --- | --- | --- | ---
class StatisticsBlock | 100% (1/1) | 91% (10/11) | 70% (114/162) | 79% (28,6/36)
toString (): String |  | 0% (0/1) | 0% (0/26) | 0% (0/5)
parse (byte [], int, int): int |  | 100% (1/1) | 74% (37/50) | 81% (6,5/8)
generate (byte [], int): int |  | 100% (1/1) | 79% (31/39) | 87% (5,2/6)
<static initializer> |  | 100% (1/1) | 88% (7/8) | 87% (0,9/1)
StatisticsBlock (): void |  | 100% (1/1) | 100% (18/18) | 100% (7/7)
getHighestCummulativeLost (): long |  | 100% (1/1) | 100% (3/3) | 100% (1/1)
getMedianFractionLost (): int |  | 100% (1/1) | 100% (3/3) | 100% (1/1)
getMedianJitter (): long |  | 100% (1/1) | 100% (3/3) | 100% (1/1)
setHighestCummulativeLost (long): void |  | 100% (1/1) | 100% (4/4) | 100% (2/2)
setMedianFractionLost (int): void |  | 100% (1/1) | 100% (4/4) | 100% (2/2)
setMedianJitter (long): void |  | 100% (1/1) | 100% (4/4) | 100% (2/2)

1 | package cz.vutbr.feec.packets.rsi;
2 |
3 | import cz.vutbr.feec.packets.PacketGenerateException;
4 | import cz.vutbr.feec.packets.PacketParseException;
5 | import cz.vutbr.feec.packets.PacketUtils;
6 | import org.apache.commons.lang.builder.ToStringBuilder;
7 |
8 | public class StatisticsBlock extends SubReportBlock {
9 | private int medianFractionLost = -1;
10 | private long highestCummulativeLost = -1;
11 | private long medianJitter = -1;
12 |
13 | public StatisticsBlock() {
14 | length = 4*3;
15 | setType(generalStatistics);
16 | }
17 |
18 | public int parse(byte[] array, int offset, int pktLength)
19 | throws PacketParseException {
20 | if (array.length < offset + 4 * 3) {
21 | throw new PacketParseException("array too short!");
22 | }
23 | // SBRT + Length
24 | super.parse(array, offset, pktLength);
25 | assert this.getType() == generalStatistics;
26 |
27 | // MFL
28 | this.medianFractionLost = PacketUtils.getOctet1(array, offset + 4);
29 |
30 | // HCNL
31 | this.highestCummulativeLost = PacketUtils.getOctet3(array, offset + 5);
32 |
33 | // Jitter
34 | this.medianJitter = PacketUtils.getOctet4(array, offset + 8);
35 |
36 | return 4 * 3;
37 | }
38 |
39 | public int generate(byte[] array, int offset)
40 | throws PacketGenerateException {
41 | assert this.getType() == generalStatistics;
42 |
43 | // SRBT + length
44 | super.generate(array, offset);
45 | // MFL
46 | array[offset + 4] = (byte) medianFractionLost;
47 | // HCNL
48 | PacketUtils.setOctet3(array, offset + 5, highestCummulativeLost);
49 | // Median jitter
50 | PacketUtils.setOctet4(array, offset+8, medianJitter);
51 | return 4 * 3;
52 | }
53 |
54 | public int getMedianFractionLost() {
55 | return medianFractionLost;
56 | }
57 |
58 | public void setMedianFractionLost(int medianFractionLost) {
59 | this.medianFractionLost = medianFractionLost;
60 | }
61 |
62 | public long getHighestCummulativeLost() {
63 | return highestCummulativeLost;
64 | }
65 |
66 | public void setHighestCummulativeLost(long highestCummulativeLost) {
67 | this.highestCummulativeLost = highestCummulativeLost;
68 | }
69 |
70 | public long getMedianJitter() {
71 | return medianJitter;
72 | }
73 |
74 | public void setMedianJitter(long medianJitter) {
75 | this.medianJitter = medianJitter;
76 | }
77 |
78 | /**
79 | * @see java.lang.Object#toString()
80 | */
81 | public String toString() {
82 | return new ToStringBuilder(this).append("type", this.getType()).append(
83 | "medianFractionLost", this.medianFractionLost).append("length",
84 | this.length).append("medianJitter", this.medianJitter).append(
85 | "highestCummulativeLost", this.highestCummulativeLost)
86 | .toString();
87 | }
88 |
89 | }

[all classes][cz.vutbr.feec.packets.rsi]
EMMA 2.0.5312 EclEmma Fix 1 (C) Vladimir Roubtsov