1 package org.openflow.protocol.statistics;
3 import java.io.Serializable;
4 import java.nio.ByteBuffer;
6 import org.openflow.protocol.factory.OFActionFactory;
7 import org.openflow.protocol.factory.OFActionFactoryAware;
10 * The base class for vendor implemented statistics
11 * @author David Erickson (daviderickson@cs.stanford.edu)
13 public class OFVendorStatistics implements OFStatistics, OFActionFactoryAware, Serializable {
14 protected transient OFActionFactory actionFactory;
16 protected byte[] body;
19 protected int length = 0;
22 public void readFrom(ByteBuffer data) {
23 this.vendor = data.getInt();
25 body = new byte[length - 4];
30 public void writeTo(ByteBuffer data) {
31 data.putInt(this.vendor);
37 public int hashCode() {
38 final int prime = 457;
40 result = prime * result + vendor;
45 public boolean equals(Object obj) {
52 if (!(obj instanceof OFVendorStatistics)) {
55 OFVendorStatistics other = (OFVendorStatistics) obj;
56 if (vendor != other.vendor) {
63 public int getLength() {
67 public void setLength(int length) {
72 * @param actionFactory the actionFactory to set
75 public void setActionFactory(OFActionFactory actionFactory) {
76 this.actionFactory = actionFactory;
79 public OFActionFactory getActionFactory() {
80 return this.actionFactory;