Class ArrayListMultimap<K,V>

java.lang.Object
org.spongepowered.collections.inheritance.ArrayListMultimap<K,V>
All Implemented Interfaces:
ListMultimap<K,V>, ListMultimap.Mutable<K,V>, Multimap<K,V>, Multimap.Mutable<K,V>

public final class ArrayListMultimap<K,V> extends Object implements ListMultimap.Mutable<K,V>
  • Constructor Details

    • ArrayListMultimap

      public ArrayListMultimap()
  • Method Details

    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Multimap<K,V>
    • size

      public int size()
      Specified by:
      size in interface Multimap<K,V>
    • get

      public List<V> get(K key)
      Description copied from interface: ListMultimap
      Gets the collection of paired values for the provided key. It is expected that regardless whether a key has any valus matched, the returned collection is never null but possibly empty.

      Unlike other possible implementations, this Collection returned is of a List. It is not guaranteed that the insertion order is retained, or that the provided list is sorted.

      Specified by:
      get in interface ListMultimap<K,V>
      Specified by:
      get in interface Multimap<K,V>
      Parameters:
      key - The key
      Returns:
      The collection of values
    • put

      public boolean put(K key, V value)
      Specified by:
      put in interface Multimap.Mutable<K,V>
    • remove

      public Collection<V> remove(K key)
      Specified by:
      remove in interface Multimap.Mutable<K,V>