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

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

name | class, % | method, % | block, % | line, %
--- | --- | --- | --- | ---
ReceiverReportPacket.java | 100% (1/1) | 62% (5/8) | 62% (94/152) | 60% (18/30)

### COVERAGE BREAKDOWN BY CLASS AND METHOD

name | class, % | method, % | block, % | line, %
--- | --- | --- | --- | ---
class ReceiverReportPacket | 100% (1/1) | 62% (5/8) | 62% (94/152) | 60% (18/30)
equals (Object): boolean |  | 0% (0/1) | 0% (0/18) | 0% (0/5)
hashCode (): int |  | 0% (0/1) | 0% (0/10) | 0% (0/1)
toString (): String |  | 0% (0/1) | 0% (0/30) | 0% (0/6)
ReceiverReportPacket (): void |  | 100% (1/1) | 100% (3/3) | 100% (1/1)
generate (byte [], int): int |  | 100% (1/1) | 100% (16/16) | 100% (3/3)
generateRestRR (byte [], int): int |  | 100% (1/1) | 100% (25/25) | 100% (4/4)
parse (byte [], int, int): int |  | 100% (1/1) | 100% (18/18) | 100% (3/3)
parseRestRR (byte [], int, int): int |  | 100% (1/1) | 100% (32/32) | 100% (7/7)

1 | package cz.vutbr.feec.packets.rtcp;
2 |
3 |
4 | //import org.apache.commons.lang.builder.EqualsBuilder;
5 | import org.apache.commons.lang.builder.ToStringBuilder;
6 |
7 | import cz.vutbr.feec.packets.PacketGenerateException;
8 | import cz.vutbr.feec.packets.PacketParseException;
9 | import org.apache.commons.lang.builder.EqualsBuilder;
10 | import org.apache.commons.lang.builder.HashCodeBuilder;
11 |
12 | /**
13 | * This class encapsulates all the necessary parameters of a Receiver Report
14 | * that needs to be handed to the Application when a Receiver Report is
15 | * received. Note: this class derives from RTCPPacket
16 | */
17 | public class ReceiverReportPacket extends ReportPacket {
18 | @Override
19 | public int generate(byte[] buffer, int offset)
20 | throws PacketGenerateException {
21 | int length = super.generate(buffer, offset);
22 | length += generateRestRR(buffer, offset + length);
23 |
24 | return length;
25 | }
26 |
27 | private int generateRestRR(byte[] buffer, int offset)
28 | throws PacketGenerateException {
29 | int len = 0;
30 | for (ReportBlock block : reportBlockList) {
31 | len += block.generate(buffer, offset + len);
32 | }
33 | return len;
34 | }
35 |
36 | @Override
37 | public int parse(byte[] buffer, int offset, int length)
38 | throws PacketParseException {
39 | int len = super.parse(buffer, offset, length);
40 | len += this.parseRestRR(buffer, offset + len, length);
41 | return len;
42 | }
43 |
44 | private int parseRestRR(byte[] buffer, int offset, int length)
45 | throws PacketParseException {
46 | int len = 0;
47 | reportBlockList.clear();
48 | for (int i = 0; i < super.reportCount; i++) {
49 | ReportBlock block = new ReportBlock();
50 | len += block.parse(buffer, offset + len, length);
51 | this.addReportBlock(block);
52 | }
53 |
54 | return len;
55 | }
56 |
57 | /**
58 | * To string.
59 | *
60 | * @return the string
61 | *
62 | * @see java.lang.Object#toString()
63 | */
64 | public String toString() {
65 | return new ToStringBuilder(this).append("length", super.getLength())
66 | .append("version", super.getVersion()).append(
67 | "receptionReportCount", super.getReportCount()).append(
68 | "padding", super.getPadding()).append("payloadType",
69 | super.getPayloadtype()).append("SSRC", super.getSSRC())
70 | .toString();
71 | }
72 |
73 | /**
74 | * @see java.lang.Object#equals(Object)
75 | */
76 | public boolean equals(Object object) {
77 | if (!(object instanceof ReceiverReportPacket)) {
78 | return false;
79 | }
80 | ReceiverReportPacket rhs = (ReceiverReportPacket) object;
81 | return new EqualsBuilder().append(this.reportBlockList, rhs.reportBlockList)
82 | .isEquals();
83 | }
84 |
85 | /**
86 | * @see java.lang.Object#hashCode()
87 | */
88 | public int hashCode() {
89 | return new HashCodeBuilder(1721573301, 148150795).append(this.reportBlockList).toHashCode();
90 | }
91 |
92 | }

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