Renamed the Pair.left and Pair.right fields to Pair.first and Pair.second
This is done for consistency with the C++ "std::pair" class template
from the STL (Standard Template Library).
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
index 01cca31..9601ff9 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
@@ -416,8 +416,8 @@
// Process all entries
//
for (Pair<IOFSwitch, FlowEntry> entry : entries) {
- IOFSwitch sw = entry.left;
- FlowEntry flowEntry = entry.right;
+ IOFSwitch sw = entry.first;
+ FlowEntry flowEntry = entry.second;
//
// Mark the Flow Entry that it has been pushed to the switch
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowPusher.java b/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowPusher.java
index 853591a..c3c7107 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowPusher.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowPusher.java
@@ -458,7 +458,7 @@
new LinkedList<Pair<IOFSwitch, FlowEntry>>();
for (Pair<IOFSwitch, FlowEntry> entry : entries) {
- if (add(entry.left, entry.right)) {
+ if (add(entry.first, entry.second)) {
pushedEntries.add(entry);
}
}
diff --git a/src/main/java/net/onrc/onos/ofcontroller/util/Pair.java b/src/main/java/net/onrc/onos/ofcontroller/util/Pair.java
index a617839..2245758 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/util/Pair.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/util/Pair.java
@@ -3,18 +3,18 @@
/**
* A generic class representing a pair of two values.
*/
-public class Pair<L, R> {
- public L left; // The first value in the pair
- public R right; // The second value in the pair
+public class Pair<F, S> {
+ public F first; // The first value in the pair
+ public S second; // The second value in the pair
/**
* Constructor for a pair of two values.
*
- * @param left the first value in the pair.
- * @param right the second value in the pair.
+ * @param first the first value in the pair.
+ * @param second the second value in the pair.
*/
- public Pair(L left, R right) {
- this.left = left;
- this.right = right;
+ public Pair(F first, S second) {
+ this.first = first;
+ this.second = second;
}
}