Class MapEntry<K,​V>

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

    public class MapEntry<K,​V>
    extends java.lang.Object
    implements java.util.Map.Entry<K,​V>
    Replacement for Map.Entry which cannot be instantiated :-(
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected K k  
      protected V v  
    • Constructor Summary

      Constructors 
      Constructor Description
      MapEntry​(K k, V v)
      Create a new map entry.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)
      Test if equal.
      K getKey()
      Get the key.
      V getValue()
      Get the value.
      int hashCode()
      Get the hashcode.
      V setValue​(V value)
      Set the value.
      • Methods inherited from class java.lang.Object

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

      • k

        protected K k
      • v

        protected V v
    • Constructor Detail

      • MapEntry

        public MapEntry​(K k,
                        V v)
        Create a new map entry.
        Parameters:
        k - The key.
        v - The value.
    • Method Detail

      • getKey

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

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

        public V setValue​(V value)
        Set the value.
        Specified by:
        setValue in interface java.util.Map.Entry<K,​V>
      • hashCode

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

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