Class DefaultMapWidgetModel<K,​V>

    • Constructor Detail

      • DefaultMapWidgetModel

        public DefaultMapWidgetModel()
    • Method Detail

      • get

        public V get​(K key)
        Description copied from interface: MapWidgetModel
        Returns the value associated with the specified key.
        Specified by:
        get in interface MapWidgetModel<K,​V>
        Parameters:
        key - mapping key
        Returns:
        the value associated with the specified key or null if no mapping is found
      • put

        public boolean put​(K key,
                           V value)
        Description copied from interface: MapWidgetModel
        Adds the key-value pair to the model.

        Any previous value associated with the key will be overwritten.

        Specified by:
        put in interface MapWidgetModel<K,​V>
        Parameters:
        key - mapping key
        value - mapping value
        Returns:
        true if a change was made, false otherwise
      • setMap

        public boolean setMap​(java.util.Map<K,​V> map)
        Description copied from interface: MapWidgetModel
        Sets the internal map used by this model.
        Specified by:
        setMap in interface MapWidgetModel<K,​V>
        Parameters:
        map - the map
        Returns:
        true if a change was made, false otherwise
      • getMap

        public java.util.Map<K,​V> getMap()
        Description copied from interface: MapWidgetModel
        Returns the internal map used by this model.
        Specified by:
        getMap in interface MapWidgetModel<K,​V>
        Returns:
        map containing all the mappings held by this model
      • remove

        public V remove​(K key)
        Description copied from interface: MapWidgetModel
        Removes the mapping with the specified key.
        Specified by:
        remove in interface MapWidgetModel<K,​V>
        Parameters:
        key - the key
        Returns:
        the removed value or null if no mapping is found