1 package org.openflow.codec.protocol.statistics;
3 import org.openflow.codec.io.IDataBuffer;
6 * Represents an ofp_aggregate_stats_reply structure
8 * @author David Erickson (daviderickson@cs.stanford.edu)
10 public class OFPAggregateStatisticsReply implements OFPStatistics {
11 protected long packetCount;
12 protected long byteCount;
13 protected int flowCount;
16 * @return the packetCount
18 public long getPacketCount() {
24 * the packetCount to set
26 public void setPacketCount(long packetCount) {
27 this.packetCount = packetCount;
31 * @return the byteCount
33 public long getByteCount() {
39 * the byteCount to set
41 public void setByteCount(long byteCount) {
42 this.byteCount = byteCount;
46 * @return the flowCount
48 public int getFlowCount() {
54 * the flowCount to set
56 public void setFlowCount(int flowCount) {
57 this.flowCount = flowCount;
61 public int getLength() {
66 public void readFrom(IDataBuffer data) {
67 this.packetCount = data.getLong();
68 this.byteCount = data.getLong();
69 this.flowCount = data.getInt();
74 public void writeTo(IDataBuffer data) {
75 data.putLong(this.packetCount);
76 data.putLong(this.byteCount);
77 data.putInt(this.flowCount);
78 data.putInt(0); // pad
82 public int hashCode() {
83 final int prime = 397;
85 result = prime * result + (int) (byteCount ^ (byteCount >>> 32));
86 result = prime * result + flowCount;
87 result = prime * result + (int) (packetCount ^ (packetCount >>> 32));
92 public boolean equals(Object obj) {
99 if (!(obj instanceof OFPAggregateStatisticsReply)) {
102 OFPAggregateStatisticsReply other = (OFPAggregateStatisticsReply) obj;
103 if (byteCount != other.byteCount) {
106 if (flowCount != other.flowCount) {
109 if (packetCount != other.packetCount) {