Class AbstractEntry<TypeK,​TypeV>

  • Type Parameters:
    TypeK - the type of keys maintained by this map
    TypeV - the type of mapped values
    All Implemented Interfaces:
    java.util.Map.Entry<TypeK,​TypeV>
    Direct Known Subclasses:
    NonBlockingHashMap.NBHMEntry, NonBlockingHashMapLong.NBHMLEntry, NonBlockingIdentityHashMap.NBHMEntry

    abstract class AbstractEntry<TypeK,​TypeV>
    extends java.lang.Object
    implements java.util.Map.Entry<TypeK,​TypeV>
    A simple implementation of Map.Entry. Does not implement Map.Entry.setValue(V), that is done by users of the class.
    Since:
    1.5
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected TypeK _key
      Strongly typed key
      protected TypeV _val
      Strongly typed value
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static boolean eq​(java.lang.Object o1, java.lang.Object o2)  
      boolean equals​(java.lang.Object o)
      Equal if the underlying key & value are equal
      TypeK getKey()
      Return key
      TypeV getValue()
      Return val
      int hashCode()
      Compute "key.hashCode() ^ val.hashCode()"
      java.lang.String toString()
      Return "key=val" string
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Map.Entry

        setValue
    • Field Detail

      • _key

        protected final TypeK _key
        Strongly typed key
      • _val

        protected TypeV _val
        Strongly typed value
    • Constructor Detail

      • AbstractEntry

        public AbstractEntry​(TypeK key,
                             TypeV val)
      • AbstractEntry

        public AbstractEntry​(java.util.Map.Entry<TypeK,​TypeV> e)
    • Method Detail

      • toString

        public java.lang.String toString()
        Return "key=val" string
        Overrides:
        toString in class java.lang.Object
      • getKey

        public TypeK getKey()
        Return key
        Specified by:
        getKey in interface java.util.Map.Entry<TypeK,​TypeV>
      • getValue

        public TypeV getValue()
        Return val
        Specified by:
        getValue in interface java.util.Map.Entry<TypeK,​TypeV>
      • equals

        public boolean equals​(java.lang.Object o)
        Equal if the underlying key & value are equal
        Specified by:
        equals in interface java.util.Map.Entry<TypeK,​TypeV>
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Compute "key.hashCode() ^ val.hashCode()"
        Specified by:
        hashCode in interface java.util.Map.Entry<TypeK,​TypeV>
        Overrides:
        hashCode in class java.lang.Object
      • eq

        private static boolean eq​(java.lang.Object o1,
                                  java.lang.Object o2)