Class ImmutableMapState<K,​V>

    • Method Detail

      • get

        public V get​(K key)
        Description copied from interface: MapState
        Returns the current value associated with the given key.
        Specified by:
        get in interface MapState<K,​V>
        Parameters:
        key - The key of the mapping
        Returns:
        The value of the mapping with the given key
      • put

        public void put​(K key,
                        V value)
        Description copied from interface: MapState
        Associates a new value with the given key.
        Specified by:
        put in interface MapState<K,​V>
        Parameters:
        key - The key of the mapping
        value - The new value of the mapping
      • putAll

        public void putAll​(Map<K,​V> map)
        Description copied from interface: MapState
        Copies all of the mappings from the given map into the state.
        Specified by:
        putAll in interface MapState<K,​V>
        Parameters:
        map - The mappings to be stored in this state
      • remove

        public void remove​(K key)
        Description copied from interface: MapState
        Deletes the mapping of the given key.
        Specified by:
        remove in interface MapState<K,​V>
        Parameters:
        key - The key of the mapping
      • contains

        public boolean contains​(K key)
        Description copied from interface: MapState
        Returns whether there exists the given mapping.
        Specified by:
        contains in interface MapState<K,​V>
        Parameters:
        key - The key of the mapping
        Returns:
        True if there exists a mapping whose key equals to the given key
      • iterator

        public Iterator<Map.Entry<K,​V>> iterator()
        Iterates over all the mappings in the state. The iterator cannot remove elements.
        Specified by:
        iterator in interface MapState<K,​V>
        Returns:
        A read-only iterator over all the mappings in the state.
      • isEmpty

        public boolean isEmpty()
        Description copied from interface: MapState
        Returns true if this state contains no key-value mappings, otherwise false.
        Specified by:
        isEmpty in interface MapState<K,​V>
        Returns:
        True if this state contains no key-value mappings, otherwise false.
      • clear

        public void clear()
        Description copied from interface: State
        Removes the value mapped under the current key.
        Specified by:
        clear in interface State