1 package org.openflow.protocol.statistics;
3 import java.nio.ByteBuffer;
6 * Represents an ofp_aggregate_stats_reply structure
7 * @author David Erickson (daviderickson@cs.stanford.edu)
9 public class OFAggregateStatisticsReply implements OFStatistics {
10 protected long packetCount;
11 protected long byteCount;
12 protected int flowCount;
15 * @return the packetCount
17 public long getPacketCount() {
22 * @param packetCount the packetCount to set
24 public void setPacketCount(long packetCount) {
25 this.packetCount = packetCount;
29 * @return the byteCount
31 public long getByteCount() {
36 * @param byteCount the byteCount to set
38 public void setByteCount(long byteCount) {
39 this.byteCount = byteCount;
43 * @return the flowCount
45 public int getFlowCount() {
50 * @param flowCount the flowCount to set
52 public void setFlowCount(int flowCount) {
53 this.flowCount = flowCount;
57 public int getLength() {
62 public void readFrom(ByteBuffer data) {
63 this.packetCount = data.getLong();
64 this.byteCount = data.getLong();
65 this.flowCount = data.getInt();
70 public void writeTo(ByteBuffer data) {
71 data.putLong(this.packetCount);
72 data.putLong(this.byteCount);
73 data.putInt(this.flowCount);
74 data.putInt(0); // pad
78 public int hashCode() {
79 final int prime = 397;
81 result = prime * result + (int) (byteCount ^ (byteCount >>> 32));
82 result = prime * result + flowCount;
83 result = prime * result + (int) (packetCount ^ (packetCount >>> 32));
88 public boolean equals(Object obj) {
95 if (!(obj instanceof OFAggregateStatisticsReply)) {
98 OFAggregateStatisticsReply other = (OFAggregateStatisticsReply) obj;
99 if (byteCount != other.byteCount) {
102 if (flowCount != other.flowCount) {
105 if (packetCount != other.packetCount) {