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

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

name | class, % | method, % | block, % | line, %
--- | --- | --- | --- | ---
ReportBlock.java | 100% (1/1) | 86% (19/22) | 61% (218/355) | 72% (48,1/67)

### COVERAGE BREAKDOWN BY CLASS AND METHOD

name | class, % | method, % | block, % | line, %
--- | --- | --- | --- | ---
class ReportBlock | 100% (1/1) | 86% (19/22) | 61% (218/355) | 72% (48,1/67)
hashCode (): int |  | 0% (0/1) | 0% (0/28) | 0% (0/4)
setFractionLost (double): void |  | 0% (0/1) | 0% (0/8) | 0% (0/2)
toString (): String |  | 0% (0/1) | 0% (0/34) | 0% (0/6)
generate (byte [], int): int |  | 100% (1/1) | 50% (64/128) | 62% (9,2/15)
<static initializer> |  | 100% (1/1) | 88% (7/8) | 87% (0,9/1)
equals (Object): boolean |  | 100% (1/1) | 96% (46/48) | 90% (9/10)
ReportBlock (): void |  | 100% (1/1) | 100% (3/3) | 100% (1/1)
getCumulativeNumofPackLost (): long |  | 100% (1/1) | 100% (3/3) | 100% (1/1)
getDLSR (): long |  | 100% (1/1) | 100% (3/3) | 100% (1/1)
getExHIseqNumRec (): long |  | 100% (1/1) | 100% (3/3) | 100% (1/1)
getFractionLost (): int |  | 100% (1/1) | 100% (3/3) | 100% (1/1)
getInterArrJitter (): long |  | 100% (1/1) | 100% (3/3) | 100% (1/1)
getLSR (): long |  | 100% (1/1) | 100% (3/3) | 100% (1/1)
getSSRC (): long |  | 100% (1/1) | 100% (3/3) | 100% (1/1)
parse (byte [], int, int): int |  | 100% (1/1) | 100% (49/49) | 100% (8/8)
setCumulativeNumofPackLost (long): void |  | 100% (1/1) | 100% (4/4) | 100% (2/2)
setDLSR (long): void |  | 100% (1/1) | 100% (4/4) | 100% (2/2)
setExHIseqNumRec (long): void |  | 100% (1/1) | 100% (4/4) | 100% (2/2)
setFractionLost (int): void |  | 100% (1/1) | 100% (4/4) | 100% (2/2)
setInterArrJitter (long): void |  | 100% (1/1) | 100% (4/4) | 100% (2/2)
setLSR (long): void |  | 100% (1/1) | 100% (4/4) | 100% (2/2)
setSSRC (long): void |  | 100% (1/1) | 100% (4/4) | 100% (2/2)

1 | package cz.vutbr.feec.packets.rtcp;
2 |
3 | import cz.vutbr.feec.packets.IPacket;
4 | import cz.vutbr.feec.packets.PacketGenerateException;
5 | import cz.vutbr.feec.packets.PacketParseException;
6 | import cz.vutbr.feec.packets.PacketUtils;
7 |
8 | import org.apache.commons.lang.builder.ToStringBuilder;
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
14 | * Reception Report that needs to be handed to the Application
15 | * when a Reception Report is received.
16 | */
17 | public class ReportBlock implements IPacket{
18 | private long SSRC;
19 | private int fractionLost;
20 | private long cumulativeNumofPackLost;
21 | private long exHIseqNumRec;
22 | private long interArrJitter;
23 | private long LSR;
24 | private long DLSR;
25 |
26 | public int generate(byte[] buffer, int offset)
27 | throws PacketGenerateException {
28 | assert PacketUtils.checkSize(getSSRC(), 32);
29 | assert PacketUtils.checkSize(getFractionLost(), 8);
30 | assert PacketUtils.checkSize(getCumulativeNumofPackLost(), 24);
31 | assert PacketUtils.checkSize(getExHIseqNumRec(), 32);
32 | assert PacketUtils.checkSize(getInterArrJitter(), 32);
33 | assert PacketUtils.checkSize(getLSR(), 32);
34 | assert PacketUtils.checkSize(getDLSR(), 32);
35 |
36 | PacketUtils.setOctet4(buffer, offset, getSSRC());
37 | PacketUtils.setOctet1(buffer, offset+4, getFractionLost());
38 | PacketUtils.setOctet3(buffer, offset+5, getCumulativeNumofPackLost());
39 | PacketUtils.setOctet4(buffer, offset+8, getExHIseqNumRec());
40 | PacketUtils.setOctet4(buffer, offset+12, getInterArrJitter());
41 | PacketUtils.setOctet4(buffer, offset+16, getLSR());
42 | PacketUtils.setOctet4(buffer, offset+20, getDLSR());
43 |
44 | return 6*4;
45 | }
46 | public int parse(byte[] buffer, int offset, int length)
47 | throws PacketParseException {
48 | setSSRC(PacketUtils.getOctet4(buffer, offset));
49 | setFractionLost(PacketUtils.getOctet1(buffer, offset+4));
50 | setCumulativeNumofPackLost(PacketUtils.getOctet3(buffer, offset+5));
51 | setExHIseqNumRec(PacketUtils.getOctet4(buffer, offset+8));
52 | setInterArrJitter(PacketUtils.getOctet4(buffer, offset+12));
53 | setLSR(PacketUtils.getOctet4(buffer, offset+16));
54 | setDLSR(PacketUtils.getOctet4(buffer, offset+20));
55 | return 6*4;
56 | }
57 |
58 |
59 | public long getSSRC() {
60 | return SSRC;
61 | }
62 | public void setSSRC(long ssrc) {
63 | SSRC = ssrc;
64 | }
65 | public int getFractionLost() {
66 | return fractionLost;
67 | }
68 | public void setFractionLost(double fraction_lost) {
69 | this.fractionLost = (byte)(fraction_lost*256);
70 | }
71 | public void setFractionLost(int fraction_lost) {
72 | this.fractionLost = fraction_lost;
73 | }
74 | public long getCumulativeNumofPackLost() {
75 | return cumulativeNumofPackLost;
76 | }
77 | public void setCumulativeNumofPackLost(long cumulativeNumofPackLost) {
78 | this.cumulativeNumofPackLost = cumulativeNumofPackLost;
79 | }
80 | public long getExHIseqNumRec() {
81 | return exHIseqNumRec;
82 | }
83 | public void setExHIseqNumRec(long exHIseqNumRec) {
84 | this.exHIseqNumRec = exHIseqNumRec;
85 | }
86 | public long getInterArrJitter() {
87 | return interArrJitter;
88 | }
89 | public void setInterArrJitter(long interArrJitter) {
90 | this.interArrJitter = interArrJitter;
91 | }
92 | public long getLSR() {
93 | return LSR;
94 | }
95 | public void setLSR(long lsr) {
96 | LSR = lsr;
97 | }
98 | public long getDLSR() {
99 | return DLSR;
100 | }
101 | public void setDLSR(long dlsr) {
102 | DLSR = dlsr;
103 | }
104 | /**
105 | * @see java.lang.Object#toString()
106 | */
107 | public String toString() {
108 | return new ToStringBuilder(this).append("SSRC",
109 | this.SSRC).append("fraction_lost",
110 | this.fractionLost).append("exHIseqNumRec", this.exHIseqNumRec)
111 | .append("DLSR", this.DLSR).append("cumulativeNumofPackLost",
112 | this.cumulativeNumofPackLost).append("LSR", this.LSR)
113 | .append("interArrJitter", this.interArrJitter).toString();
114 | }
115 | /**
116 | * @see java.lang.Object#equals(Object)
117 | */
118 | public boolean equals(Object object) {
119 | if (!(object instanceof ReportBlock)) {
120 | return false;
121 | }
122 | ReportBlock rhs = (ReportBlock) object;
123 | return new EqualsBuilder().append(this.SSRC, rhs.SSRC).append(
124 | this.exHIseqNumRec, rhs.exHIseqNumRec).append(
125 | this.fractionLost, rhs.fractionLost).append(
126 | this.interArrJitter, rhs.interArrJitter).append(this.LSR,
127 | rhs.LSR).append(this.cumulativeNumofPackLost,
128 | rhs.cumulativeNumofPackLost)
129 | .append(this.DLSR, rhs.DLSR).isEquals();
130 | }
131 | /**
132 | * @see java.lang.Object#hashCode()
133 | */
134 | public int hashCode() {
135 | return new HashCodeBuilder(-1397927009, -1527314573).append(this.fractionLost).append(
136 | this.exHIseqNumRec).append(this.interArrJitter)
137 | .append(this.LSR).append(this.cumulativeNumofPackLost).append(
138 | this.SSRC).append(this.DLSR).toHashCode();
139 | }
140 |
141 | }

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