NPTLab
Class MessageWrapperMap

java.lang.Object
  extended by NPTLab.MessageWrapperMap

public class MessageWrapperMap
extends java.lang.Object

Class that contains a map to mantain the one to one realtionship between a Message and his MessageWrapper implemented with a singleton pattern

Author:
Andrea Campanella, NPTLab, Public university of Milan, 2014

Method Summary
static MessageWrapperMap getInstance()
          Returns the instance of the map.
 java.util.Map<core.Message,MessageWrapper> returnMap()
          Returns the Map of the singleton instance of the MEssageWrapperMap
 void set(core.Message m, Trace MessageDestTrace)
          Adds to the map an entrance matching a Message and his MessageWrapper from the Map or a new one if it didn't exist.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static MessageWrapperMap getInstance()
Returns the instance of the map. if the map doesn't exist the method creates it.

Returns:
Map

set

public void set(core.Message m,
                Trace MessageDestTrace)
Adds to the map an entrance matching a Message and his MessageWrapper from the Map or a new one if it didn't exist. sets the destination mobility trace and the similarity.

Parameters:
m - Message the message
MessageDestTrace - the destination mobility trace choosen for this message.

returnMap

public java.util.Map<core.Message,MessageWrapper> returnMap()
Returns the Map of the singleton instance of the MEssageWrapperMap