Class Multimap<K,V>

java.lang.Object
com.brightcove.player.util.collection.Multimap<K,V>
Type Parameters:
K - Key type
V - Values type

public class Multimap<K,V> extends Object
Structure that handles singleKey-multipleValues map.
  • Constructor Details

    • Multimap

      public Multimap()
  • Method Details

    • get

      @NonNull public List<V> get(K key)
      Parameters:
      key - of the values to be retrieved
      Returns:
      A list of values for the given key. If no values are found, an empty list is returned
    • put

      public void put(K key, V value)
      Add the value to the map.
      Parameters:
      key - of the value.
      value - to be added.
    • size

      public int size()
      Returns:
      the size of all the values in the map. If n values have the same key, then n is added to the size.
    • isEmpty

      public boolean isEmpty()
      Returns:
      Whether the map is empty.