Class MapCollectionWrapper<K,​V>

  • Type Parameters:
    K - the type of the key
    V - the type of element content in the collection

    public class MapCollectionWrapper<K,​V>
    extends Object
    implement a Map with Collection as value.
    Author:
    Patrick Vandermaesen
    • Constructor Detail

      • MapCollectionWrapper

        public MapCollectionWrapper()
    • Method Detail

      • getValues

        public List<V> getValues​(K key,
                                 List<V> defaultValue)
      • get

        public List<V> get​(K key)
        get the list
        Parameters:
        key -
        Returns:
        return a list and never null
      • get

        public V get​(K key,
                     V defaultValue)
      • contains

        public boolean contains​(K key)
      • add

        public List<V> add​(K key,
                           V value)
      • addOrChange

        public List<V> addOrChange​(K key,
                                   V value)
        update the value, if hashcode allready exist in the List the oldest is removed.
        Parameters:
        key -
        value -
        Returns:
      • remove

        public List<V> remove​(K key,
                              V value)
      • addValues

        public void addValues​(K key,
                              List<V> newValues)
      • addAll

        public void addAll​(Map<? extends K,​? extends List<V>> m)
      • removeValues

        public List<V> removeValues​(K key)
      • keySet

        public Set<K> keySet()
      • main

        public static void main​(String[] args)
      • clear

        public void clear()