Class ConcurrentSkipListMap.SnapshotEntry<K,​V>

  • All Implemented Interfaces:
    java.util.Map.Entry<K,​V>
    Enclosing class:
    ConcurrentSkipListMap<K,​V>

    static class ConcurrentSkipListMap.SnapshotEntry<K,​V>
    extends java.lang.Object
    implements java.util.Map.Entry<K,​V>
    An immutable representation of a key-value mapping as it existed at some point in time. This class does not support the Map.Entry.setValue method.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private K key  
      private V value  
    • Constructor Summary

      Constructors 
      Constructor Description
      SnapshotEntry​(K key, V value)
      Creates a new entry representing the given key and value.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      K getKey()
      Returns the key corresponding to this entry.
      V getValue()
      Returns the value corresponding to this entry.
      int hashCode()  
      V setValue​(V value)
      Always fails, throwing UnsupportedOperationException.
      java.lang.String toString()
      Returns a String consisting of the key followed by an equals sign ("=") followed by the associated value.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • key

        private final K key
      • value

        private final V value
    • Constructor Detail

      • SnapshotEntry

        SnapshotEntry​(K key,
                      V value)
        Creates a new entry representing the given key and value.
        Parameters:
        key - the key
        value - the value
    • Method Detail

      • getKey

        public K getKey()
        Returns the key corresponding to this entry.
        Specified by:
        getKey in interface java.util.Map.Entry<K,​V>
        Returns:
        the key corresponding to this entry.
      • getValue

        public V getValue()
        Returns the value corresponding to this entry.
        Specified by:
        getValue in interface java.util.Map.Entry<K,​V>
        Returns:
        the value corresponding to this entry.
      • setValue

        public V setValue​(V value)
        Always fails, throwing UnsupportedOperationException.
        Specified by:
        setValue in interface java.util.Map.Entry<K,​V>
        Throws:
        java.lang.UnsupportedOperationException - always.
      • equals

        public boolean equals​(java.lang.Object o)
        Specified by:
        equals in interface java.util.Map.Entry<K,​V>
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Map.Entry<K,​V>
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Returns a String consisting of the key followed by an equals sign ("=") followed by the associated value.
        Overrides:
        toString in class java.lang.Object
        Returns:
        a String representation of this entry.