Package randoop.util

Class MultiMap.EmptyMultiMap<K extends @Signed Object,​V extends @Signed Object>

  • All Implemented Interfaces:
    IMultiMap<K,​V>
    Enclosing class:
    MultiMap<K extends @Signed Object,​V extends @Signed Object>

    private static class MultiMap.EmptyMultiMap<K extends @Signed Object,​V extends @Signed Object>
    extends MultiMap<K,​V>
    An immutable, empty multimap.
    • Constructor Detail

      • EmptyMultiMap

        private EmptyMultiMap()
        Creates an immutable, empty multimap. Should only be called once, because all EmptyMultiMaps are the same.
    • Method Detail

      • put

        public void put​(K key,
                        Collection<? extends V> values)
        Description copied from class: MultiMap
        Adds a key-values mapping to this multimap.
        Overrides:
        put in class MultiMap<K extends @Signed Object,​V extends @Signed Object>
        Parameters:
        key - the key
        values - the values
      • add

        public boolean add​(K key,
                           V value)
        Description copied from interface: IMultiMap
        Precondition: the mapping key→value is not already in the map.
        Specified by:
        add in interface IMultiMap<K extends @Signed Object,​V extends @Signed Object>
        Overrides:
        add in class MultiMap<K extends @Signed Object,​V extends @Signed Object>
        Parameters:
        key - cannot be null
        value - cannot be null
        Returns:
        true if the call modifies this object
      • remove

        public boolean remove​(K key,
                              V value)
        Description copied from interface: IMultiMap
        Precondition: the mapping key→value is in the map.
        Specified by:
        remove in interface IMultiMap<K extends @Signed Object,​V extends @Signed Object>
        Overrides:
        remove in class MultiMap<K extends @Signed Object,​V extends @Signed Object>
        Parameters:
        key - cannot be null
        value - cannot be null
        Returns:
        true if the call modifies this object
      • getValues

        public Set<V> getValues​(K key)
        Description copied from interface: IMultiMap
        Returns the values that the given key maps to.
        Specified by:
        getValues in interface IMultiMap<K extends @Signed Object,​V extends @Signed Object>
        Overrides:
        getValues in class MultiMap<K extends @Signed Object,​V extends @Signed Object>
        Parameters:
        key - cannot be null
        Returns:
        the set of values for the given key
      • keySet

        public Set<K> keySet()
        Description copied from interface: IMultiMap
        Returns the set of keys in this map (the domain).
        Specified by:
        keySet in interface IMultiMap<K extends @Signed Object,​V extends @Signed Object>
        Overrides:
        keySet in class MultiMap<K extends @Signed Object,​V extends @Signed Object>
        Returns:
        the set of keys in this map
      • size

        public int size()
        Description copied from interface: IMultiMap
        Returns the size of this map: the number of mappings.
        Specified by:
        size in interface IMultiMap<K extends @Signed Object,​V extends @Signed Object>
        Overrides:
        size in class MultiMap<K extends @Signed Object,​V extends @Signed Object>
        Returns:
        the number of entries in this map