org.objectweb.dream.message
Class MessageUtil

java.lang.Object
  extended by org.objectweb.dream.message.MessageUtil

public final class MessageUtil
extends Object

Utility methods for content based message comparison.


Method Summary
static boolean equals(Message message1, MessageManager messageManager1Itf, Message message2, MessageManager messageManager2Itf)
          Returns true if the two messages has the same content.
static int hashCode(Message message, MessageManager messageManagerItf)
          Returns an hashCode of the given message based on its content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

equals

public static boolean equals(Message message1,
                             MessageManager messageManager1Itf,
                             Message message2,
                             MessageManager messageManager2Itf)
Returns true if the two messages has the same content. This method requires that every chunks implements correctly the Object.equals(Object) method.

Parameters:
message1 - a message
messageManager1Itf - the message manager in which the message1 is
message2 - an other message
messageManager2Itf - the message manager in which the message2 is
Returns:
true if the two messages has the same content.

hashCode

public static int hashCode(Message message,
                           MessageManager messageManagerItf)
Returns an hashCode of the given message based on its content. This Object.hashCode() method is coherent with the equals method. This means that if equals(m1, m2) == true then hashCode(m1) == hashCode(m2).

Parameters:
message - a message.
messageManagerItf - the message manager in which the message is
Returns:
an hashCode of the given message.


Copyright © 2003, 2005 - INRIA Rhone-Alpes - All Rights Reserved.