Murat Parlakisik | 3486338 | 2016-12-05 00:53:17 -0800 | [diff] [blame^] | 1 | |
| 2 | /** |
| 3 | * Compares the two messages for equality, ignoring the XID field. |
| 4 | * |
| 5 | * @param obj the other message to compare |
| 6 | * @return true if the messages are equal, ignoring the XID; false otherwise |
| 7 | */ |
| 8 | boolean equalsIgnoreXid(Object obj); |
| 9 | |
| 10 | /** |
| 11 | * Computes the hashcode of the message, ignoring the XID field. |
| 12 | * This can be useful in hashing OFMessages where an OFMessage |
| 13 | * is "the same as" another OFMessage if all fields are equal |
| 14 | * except for possibly the XIDs, which may or may not be equal. |
| 15 | * |
| 16 | * The obvious problem is that existing hash data structure |
| 17 | * implementations will use OFMessage's hashCode() function instead. |
| 18 | * In order to use the functionality of hashCodeIgnoreXid(), one |
| 19 | * must wrap the OFMessage within a user-defined class, where this |
| 20 | * user-defined class is used as the key within a hash data structure, |
| 21 | * e.g. HashMap. The user-defined class' overrideen hashCode() |
| 22 | * function must explicitly invoke hashCodeIgnoreXid() when computing |
| 23 | * the hash of the OFMessage member instead of computing it using |
| 24 | * OFMessage's hashCode(). |
| 25 | * |
| 26 | * @return the hashcode of the message, ignoring the XID |
| 27 | */ |
| 28 | int hashCodeIgnoreXid(); |