Package madkit.message

# Class MapMessage<K,V>

java.lang.Object
madkit.kernel.Message
madkit.message.ObjectMessage<Map<K,V>>
madkit.message.MapMessage<K,V>

All Implemented Interfaces:
  `Serializable`, `Cloneable`

public class MapMessage<K,V> extends ObjectMessage<Map<K,V>>
This class could be used to build message conveying `Map` objects between MaDKit agents.

Since:
  MaDKit 5.1.2
Version:
  0.9
Author:
  Fabien Michel
See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MapMessage()`
  /** Builds a `MapMessage` containing an empty `HashMap`}
  `MapMessage(Map<K,V> map)`
  Builds a `MapMessage` containing the specified map

- ## Method Summary

  Modifier and Type
  Method
  Description
  `V`
  `get(K key)`
  invoke `Map.get(Object)` on the map contained in this message
  `V`
  `put(K key, V value)`
  invoke `Map.put(Object, Object)` on the map contained in this message.

  ### Methods inherited from class madkit.message.ObjectMessage

  `getContent, max, min, sort, toString`

  ### Methods inherited from class madkit.kernel.Message

  `clone, getConversationID, getReceiver, getSender`

  ### Methods inherited from class java.lang.Object

  `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### MapMessage

    public MapMessage(Map<K,V> map)
    Builds a `MapMessage` containing the specified map
    Parameters:
      `map` - the original map

  - ### MapMessage

    public MapMessage()
    /** Builds a `MapMessage` containing an empty `HashMap`}

- ## Method Details

  - ### put

    public V put(K key, V value)
    invoke `Map.put(Object, Object)` on the map contained in this message.
    Parameters:
      `key` - key with which the specified value is to be associated
      `value` - value to be associated with the specified key
    Returns:
      the previous value associated with `key`, or `null` if there was no mapping for `key`. (A `null` return can also indicate that the map previously associated `null` with `key`, if the implementation supports `null` values.)
    See Also:
      - `Map`

  - ### get

    public V get(K key)
    invoke `Map.get(Object)` on the map contained in this message