Package 

Interface MutableListMap

  • All Implemented Interfaces:
    kotlin.collections.Iterable , org.veupathdb.lib.s3.s34k.util.ListMap

    
    public interface MutableListMap<K extends Object, V extends Object>
     implements ListMap<K, V>
                        

    Mutable version of the immutable type ListMap

    Implementations of this interface should be thread safe.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • Method Detail

      • add

         abstract Unit add(K key, V value)

        Adds the given value to this MutableListMap.

        If the given key already exists in this map, the given value will be appended to the list at that key.

        Example

        listMap == {
          "foo" = ["bar", "fizz", "buzz"]
        }
        
        key   == "foo"
        value == "happy"
        
        listMap.add(key, value)
        
        listMap == {
          "foo" = ["bar", "fizz", "buzz", "happy"]
        }
        Parameters:
        key - Key of the value to add.
        value - Value to add.
      • add

         abstract Unit add(K key, V values)

        Adds the given values to this MutableListMap.

        If the given key already exists in this map, the given values will be appended to the list at that key.

        Example

        listMap == {
          "foo" = ["bar", "fizz", "buzz"]
        }
        
        key    == "foo"
        values == ["happy", "sad"]
        
        listMap.add(key, values)
        
        listMap == {
          "foo" = ["bar", "fizz", "buzz", "happy", "sad"]
        }
        Parameters:
        key - Key of the value to add.
        values - Values to add.
      • add

         abstract Unit add(K key, Iterable<V> values)

        Adds the given values to this MutableListMap.

        If the given key already exists in this map, the given values will be appended to the list at that key.

        Example

        listMap == {
          "foo" = ["bar", "fizz", "buzz"]
        }
        
        key    == "foo"
        values == ["happy", "sad"]
        
        listMap.add(key, values)
        
        listMap == {
          "foo" = ["bar", "fizz", "buzz", "happy", "sad"]
        }
        Parameters:
        key - Key of the value to add.
        values - Values to add.
      • add

         abstract Unit add(Map<K, Iterable<V>> values)

        Adds the given values to this MutableListMap.

        If any key in the given Map overlaps with a key in this MutableListMap, the values in the input map will be appended to the list at the overlapping key in this map.

        Example

        listMap == {
          "foo" = ["bar", "fizz", "buzz"]
        }
        
        input == {
          "foo" = ["happy", "sad"]
        }
        
        listMap.add(input)
        
        listMap == {
          "foo" = ["bar", "fizz", "buzz", "happy", "sad"]
        }
        Parameters:
        values - Map of values to add to this MutableListMap
      • set

         abstract Unit set(K key, V value)

        Sets the given value to this MutableListMap.

        If the given key already exists in this map it will be overwritten with a new list containing only the given value.

        Example

        listMap == {
          "foo" = ["bar", "fizz", "buzz"]
        }
        
        key   == "foo"
        value == "happy"
        
        listMap.add(key, value)
        
        listMap == {
          "foo" = ["happy"]
        }
        Parameters:
        key - Key of the value to add.
        value - Value to add.
      • set

         abstract Unit set(K key, V values)

        Sets the given values to this MutableListMap.

        If the given key already exists in this map, it will be overwritten with the given array of values.

        Example

        listMap == {
          "foo" = ["bar", "fizz", "buzz"]
        }
        
        key    == "foo"
        values == ["happy", "sad"]
        
        listMap.add(key, values)
        
        listMap == {
          "foo" = ["happy", "sad"]
        }
        Parameters:
        key - Key of the value to add.
        values - Values to add.
      • set

         abstract Unit set(K key, Iterable<V> values)

        Sets the given values to this MutableListMap.

        If the given key already exists in this map, it will be overwritten with the given collection of values.

        Example

        listMap == {
          "foo" = ["bar", "fizz", "buzz"]
        }
        
        key    == "foo"
        values == ["happy", "sad"]
        
        listMap.add(key, values)
        
        listMap == {
          "foo" = ["happy", "sad"]
        }
        Parameters:
        key - Key of the value to add.
        values - Values to add.
      • set

         abstract Unit set(Map<K, Iterable<V>> values)

        Sets the given values to this MutableListMap.

        If any key in the given Map overlaps with a key in this MutableListMap, the values in this MutableListMap will be replaced by value in the input map the list at the overlapping key.

        Example

        listMap == {
          "foo" = ["bar", "fizz", "buzz"]
        }
        
        input == {
          "foo" = ["happy", "sad"]
        }
        
        listMap.add(input)
        
        listMap == {
          "foo" = ["happy", "sad"]
        }
        Parameters:
        values - Map of values to add to this MutableListMap