Class InvocableMapHelper.SimpleEntry<K,​V>

    • Field Detail

      • m_map

        protected Map<K,​V> m_map
        The map.
    • Constructor Detail

      • SimpleEntry

        public SimpleEntry​(Map<K,​V> map,
                           K oKey,
                           boolean fReadOnly)
        Construct a SimpleEntry for a given map and a key.
        Parameters:
        map - the parent Map for this entry
        oKey - the entry's key
        fReadOnly - if true, the entry will be marked as read-only, preventing the setValue() and remove() methods from modifying the underlying map's content
      • SimpleEntry

        public SimpleEntry​(Map<K,​V> map,
                           K oKey,
                           V oValue,
                           boolean fReadOnly)
        Construct a SimpleEntry for a given key and value.
        Parameters:
        map - the parent Map for this entry
        oKey - the entry's key
        oValue - the entry's value
        fReadOnly - if true, the entry will be marked as read-only, preventing the setValue() and remove() methods from modifying the underlying map's content
      • SimpleEntry

        public SimpleEntry​(K oKey,
                           V oValue)
        Construct a SimpleEntry for a given key and value. The entry will be marked as read-only.
        Parameters:
        oKey - the entry's key
        oValue - the entry's value
    • Method Detail

      • getValue

        public V getValue()
        Returns the value corresponding to this entry. If the mapping has been removed from the backing map (by the iterator's remove operation), the results of this call are undefined.
        Specified by:
        getValue in interface InvocableMap.Entry<K,​V>
        Specified by:
        getValue in interface Map.Entry<K,​V>
        Overrides:
        getValue in class SimpleMapEntry<K,​V>
        Returns:
        the value corresponding to this entry.
      • setValue

        public V setValue​(V oValue)
        Replaces the value corresponding to this entry with the specified value (optional operation). (Writes through to the map.) The behavior of this call is undefined if the mapping has already been removed from the map (by the iterator's remove operation).
        Specified by:
        setValue in interface InvocableMap.Entry<K,​V>
        Specified by:
        setValue in interface Map.Entry<K,​V>
        Overrides:
        setValue in class SimpleMapEntry<K,​V>
        Parameters:
        oValue - new value to be stored in this entry
        Returns:
        old value corresponding to the entry
      • setValue

        public void setValue​(V oValue,
                             boolean fSynthetic)
        Store the value corresponding to this entry. If the entry does not exist, then the entry will be created by invoking this method, even with a null value (assuming the Map supports null values).

        Unlike the other form of setValue, this form does not return the previous value, and as a result may be significantly less expensive (in terms of cost of execution) for certain Map implementations.

        Specified by:
        setValue in interface InvocableMap.Entry<K,​V>
        Overrides:
        setValue in class SimpleMapEntry<K,​V>
        Parameters:
        oValue - the new value for this Entry
        fSynthetic - pass true only if the insertion into or modification of the Map should be treated as a synthetic event
      • remove

        public void remove​(boolean fSynthetic)
        Remove this Entry from the Map if it is present in the Map.

        This method supports both the operation corresponding to Map.remove(java.lang.Object) as well as synthetic operations such as eviction. If the containing Map does not differentiate between the two, then this method will always be identical to InvocableMap.this.remove(getKey()).

        Specified by:
        remove in interface InvocableMap.Entry<K,​V>
        Overrides:
        remove in class SimpleMapEntry<K,​V>
        Parameters:
        fSynthetic - pass true only if the removal from the Map should be treated as a synthetic event
      • equals

        public boolean equals​(Object o)
        Compare this SimpleEntry with another object for equality.
        Specified by:
        equals in interface Map.Entry<K,​V>
        Overrides:
        equals in class SimpleMapEntry<K,​V>
        Parameters:
        o - an object reference or null
        Returns:
        true iff the passed object reference is a SimpleEntry object with the same key
      • hashCode

        public int hashCode()
        Return a hash code value for the SimpleEntry object.
        Specified by:
        hashCode in interface Map.Entry<K,​V>
        Overrides:
        hashCode in class SimpleMapEntry<K,​V>
        Returns:
        the hash code value for this map entry.
      • toString

        public String toString()
        Provide a human-readable representation of the SimpleEntry object.
        Overrides:
        toString in class SimpleMapEntry<K,​V>
        Returns:
        a String representation of this SimpleEntry object
      • checkMutable

        protected void checkMutable()
        Verify that this SimpleEntry is mutable.