java_gen: renamed OFPortMap to OFPortBitMap
We could call it OFPortSet to emphasize that it is really a
set of ports. Map is definitely the wrong name though
as it evokes a Key->Value mapping.
diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/OFPortMap.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/OFPortBitMap.java
similarity index 82%
rename from java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/OFPortMap.java
rename to java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/OFPortBitMap.java
index 8ec056e..dd88ea6 100644
--- a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/OFPortMap.java
+++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/OFPortBitMap.java
@@ -1,9 +1,9 @@
package org.projectfloodlight.openflow.types;
-public class OFPortMap extends Masked<OFBitMask128> {
+public class OFPortBitMap extends Masked<OFBitMask128> {
- private OFPortMap(OFBitMask128 mask) {
+ private OFPortBitMap(OFBitMask128 mask) {
super(OFBitMask128.NONE, mask);
}
@@ -11,7 +11,7 @@
return !(this.mask.isOn(port.getPortNumber()));
}
- public static OFPortMap ofPorts(OFPort... ports) {
+ public static OFPortBitMap ofPorts(OFPort... ports) {
Builder builder = new Builder();
for (OFPort port: ports) {
builder.set(port);
@@ -21,9 +21,9 @@
@Override
public boolean equals(Object obj) {
- if (!(obj instanceof OFPortMap))
+ if (!(obj instanceof OFPortBitMap))
return false;
- OFPortMap other = (OFPortMap)obj;
+ OFPortBitMap other = (OFPortBitMap)obj;
return (other.value.equals(this.value) && other.mask.equals(this.mask));
}
@@ -67,8 +67,8 @@
return this;
}
- public OFPortMap build() {
- return new OFPortMap(OFBitMask128.of(raw1, raw2));
+ public OFPortBitMap build() {
+ return new OFPortBitMap(OFBitMask128.of(raw1, raw2));
}
}
diff --git a/java_gen/pre-written/src/test/java/org/projectfloodlight/openflow/types/OFPortMapTest.java b/java_gen/pre-written/src/test/java/org/projectfloodlight/openflow/types/OFPortBitMapTest.java
similarity index 86%
rename from java_gen/pre-written/src/test/java/org/projectfloodlight/openflow/types/OFPortMapTest.java
rename to java_gen/pre-written/src/test/java/org/projectfloodlight/openflow/types/OFPortBitMapTest.java
index 7a75248..b18d0eb 100644
--- a/java_gen/pre-written/src/test/java/org/projectfloodlight/openflow/types/OFPortMapTest.java
+++ b/java_gen/pre-written/src/test/java/org/projectfloodlight/openflow/types/OFPortBitMapTest.java
@@ -5,16 +5,16 @@
import org.junit.Test;
-public class OFPortMapTest extends TestCase {
+public class OFPortBitMapTest extends TestCase {
@Test
- public void testOFPortMap() {
+ public void testOFPortBitMap() {
Boolean[] on = new Boolean[128];
for (int i = 0; i < 128; i++) {
on[i] = false;
}
- OFPortMap.Builder builder = new OFPortMap.Builder();
+ OFPortBitMap.Builder builder = new OFPortBitMap.Builder();
for (int i = 0; i < 128; i += 3) {
OFPort p = OFPort.of(i);
@@ -23,7 +23,7 @@
}
// Test that all ports that were added are actually on, and all other ports are off
- OFPortMap portmap = builder.build();
+ OFPortBitMap portmap = builder.build();
//System.out.println(portmap);
Boolean[] actual = new Boolean[128];
for (int i = 0; i < 128; i++) {