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

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

name | class, % | method, % | block, % | line, %
--- | --- | --- | --- | ---
FTSGroupBlock.java | 100% (1/1) | 95% (18/19) | 67% (181/272) | 75% (39,9/53)

### COVERAGE BREAKDOWN BY CLASS AND METHOD

name | class, % | method, % | block, % | line, %
--- | --- | --- | --- | ---
class FTSGroupBlock | 100% (1/1) | 95% (18/19) | 67% (181/272) | 75% (39,9/53)
toString (): String |  | 0% (0/1) | 0% (0/34) | 0% (0/8)
generate (byte [], int): int |  | 100% (1/1) | 53% (63/119) | 65% (9/14)
<static initializer> |  | 100% (1/1) | 88% (7/8) | 87% (0,9/1)
FTSGroupBlock (): void |  | 100% (1/1) | 100% (3/3) | 100% (1/1)
getFeedbackTargerIP (): long |  | 100% (1/1) | 100% (3/3) | 100% (1/1)
getFeedbackTargetPort (): long |  | 100% (1/1) | 100% (3/3) | 100% (1/1)
getGroupSize (): long |  | 100% (1/1) | 100% (3/3) | 100% (1/1)
getLMidVector (): long |  | 100% (1/1) | 100% (3/3) | 100% (1/1)
getLenght (): int |  | 100% (1/1) | 100% (3/3) | 100% (1/1)
getReservedEnd (): int |  | 100% (1/1) | 100% (3/3) | 100% (1/1)
getVectorSpecification (): long |  | 100% (1/1) | 100% (3/3) | 100% (1/1)
parse (byte [], int, int): int |  | 100% (1/1) | 100% (59/59) | 100% (9/9)
setFeedbackTargerIP (long): void |  | 100% (1/1) | 100% (4/4) | 100% (2/2)
setFeedbackTargetPort (long): void |  | 100% (1/1) | 100% (4/4) | 100% (2/2)
setGroupSize (long): void |  | 100% (1/1) | 100% (4/4) | 100% (2/2)
setLMidVector (long): void |  | 100% (1/1) | 100% (4/4) | 100% (2/2)
setLenght (int): void |  | 100% (1/1) | 100% (4/4) | 100% (2/2)
setReservedEnd (int): void |  | 100% (1/1) | 100% (4/4) | 100% (2/2)
setVectorSpecification (long): void |  | 100% (1/1) | 100% (4/4) | 100% (2/2)

1 | package cz.vutbr.feec.packets.ttp;
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 |
10 | public class FTSGroupBlock implements IPacket {
11 |
12 | private long feedbackTargerIP;
13 | private long feedbackTargetPort;
14 | private long groupSize;
15 | private long vectorSpecification;
16 | private int lenght;
17 | private int reservedEnd;
18 | private long LMidVector;
19 |
20 | public int generate(byte[] buffer, int offset)
21 | throws PacketGenerateException {
22 | assert PacketUtils.checkSize(getFeedbackTargerIP(), 32);
23 | assert PacketUtils.checkSize(getFeedbackTargetPort(), 16);
24 | assert PacketUtils.checkSize(getGroupSize(), 16);
25 | assert PacketUtils.checkSize(getVectorSpecification(), 16);
26 | assert PacketUtils.checkSize(getLenght(), 6);
27 | assert PacketUtils.checkSize(getReservedEnd(), 10);
28 |
29 | PacketUtils.setOctet4(buffer, offset, getFeedbackTargerIP());
30 | PacketUtils.setOctet2(buffer, offset + 4, getFeedbackTargetPort());
31 | PacketUtils.setOctet2(buffer, offset + 6, getGroupSize());
32 | PacketUtils.setOctet2(buffer, offset + 8,getVectorSpecification());
33 | PacketUtils.setOctet2(buffer, offset + 10,
34 | (((getLenght() << 10) & 0xFC00) | (getReservedEnd() & 0x03FF)));
35 | PacketUtils.setOctet4(buffer, offset + 12, getLMidVector());
36 |
37 | return 16;
38 | }
39 |
40 | public int parse(byte[] buffer, int offset, int length)
41 | throws PacketParseException {
42 |
43 | setFeedbackTargerIP(PacketUtils.getOctet4(buffer, offset));
44 | setFeedbackTargetPort(PacketUtils.getOctet2(buffer, 4 + offset));
45 | setGroupSize(PacketUtils.getOctet2(buffer, 6 + offset));
46 | setVectorSpecification(PacketUtils.getOctet2(buffer, 8 + offset));
47 |
48 | long first = PacketUtils.getOctet2(buffer, 10 + offset);
49 | setLenght((int)(first & 0xFC00)>>10);
50 | setReservedEnd((int)(first & 0x03FF));
51 | setLMidVector(PacketUtils.getOctet4(buffer, 12 + offset));
52 | return 16;
53 | }
54 |
55 | public long getFeedbackTargerIP() {
56 | return feedbackTargerIP;
57 | }
58 |
59 | public void setFeedbackTargerIP(long feedbackTargerIP) {
60 | this.feedbackTargerIP = feedbackTargerIP;
61 | }
62 |
63 | public long getFeedbackTargetPort() {
64 | return feedbackTargetPort;
65 | }
66 |
67 | public void setFeedbackTargetPort(long feedbackTargetPort) {
68 | this.feedbackTargetPort = feedbackTargetPort;
69 | }
70 |
71 | public long getGroupSize() {
72 | return groupSize;
73 | }
74 |
75 | public void setGroupSize(long groupSize) {
76 | this.groupSize = groupSize;
77 | }
78 |
79 | public long getVectorSpecification() {
80 | return vectorSpecification;
81 | }
82 |
83 | public void setVectorSpecification(long vectorSpecification) {
84 | this.vectorSpecification = vectorSpecification;
85 | }
86 |
87 | public int getLenght() {
88 | return lenght;
89 | }
90 |
91 | public void setLenght(int lenght) {
92 | this.lenght = lenght;
93 | }
94 |
95 | public int getReservedEnd() {
96 | return reservedEnd;
97 | }
98 |
99 | public void setReservedEnd(int reservedEnd) {
100 | this.reservedEnd = reservedEnd;
101 | }
102 |
103 | public long getLMidVector() {
104 | return LMidVector;
105 | }
106 |
107 | public void setLMidVector(long midVector) {
108 | LMidVector = midVector;
109 | }
110 |
111 | /**
112 | * @see java.lang.Object#toString()
113 | */
114 | public String toString() {
115 | return new ToStringBuilder(this).append("feedbackTargetPort",
116 | this.feedbackTargetPort)
117 | .append("reservedEnd", this.reservedEnd).append("groupSize",
118 | this.groupSize).append("lenght", this.lenght).append(
119 | "feedbackTargerIP", this.feedbackTargerIP).append(
120 | "LMidVector", this.LMidVector).append(
121 | "vectorSpecification", this.vectorSpecification)
122 | .toString();
123 | }
124 |
125 | }

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