Documentation of 'info.monitorenter.util.collections.Entry' Java class
Entry
info.monitorenter.util.collections

Class Entry<V,K>

  • Type Parameters:
    V - the key type.
    K - the value type.
    All Implemented Interfaces:
    java.util.Map.Entry<V,K>


    public final class Entry<V,K>
    extends java.lang.Object
    implements java.util.Map.Entry<V,K>

    I have written implementations of java.util.Map.Entry in form of

    • Static inner classes.
    • Non-static inner classes.
    • Non-public classes.
    • Anonymous classes.

    Almost all implementations were plainforward and not hiding any complexity. One could not downcast them to get more methods, and they were replaceable.
    That's it! Finally i decided to hardcode it here... .

    But don't you start writing methods like:

     public Entry getEntry(String name);
     
     public void setEntry(Entry entry);
     
    Try sticking to the interface java.util.Map.Entry.

    See Also:
    Map.Entry
    • Constructor Summary

      Constructors 
      Constructor and Description
      Entry(V key, K value)
      Creates an instance with the given key and value.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean equals(java.lang.Object obj) 
      V getKey()
      Maybe null!
      K getValue()
      Maybe null!
      int hashCode() 
      K setValue(K value)
      Sets a new value instance overwriting the old value which is returned.
      • Methods inherited from class java.lang.Object

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

        comparingByKey, comparingByKey, comparingByValue, comparingByValue
    • Constructor Detail

      • Entry

        public Entry(V key,
                     K value)
        Creates an instance with the given key and value.

        Parameters:
        key - the key instance to use.
        value - the value instance to use.
    • Method Detail

      • equals

        public boolean equals(java.lang.Object obj)
        Specified by:
        equals in interface java.util.Map.Entry<V,K>
        Overrides:
        equals in class java.lang.Object
        See Also:
        Object.equals(java.lang.Object)
      • getKey

        public V getKey()
        Maybe null!
        Specified by:
        getKey in interface java.util.Map.Entry<V,K>
        See Also:
        Map.Entry.getKey()
      • getValue

        public K getValue()
        Maybe null!
        Specified by:
        getValue in interface java.util.Map.Entry<V,K>
        See Also:
        Map.Entry.getValue()
      • hashCode

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

        public K setValue(K value)
        Sets a new value instance overwriting the old value which is returned.

        You may use null. But you will get it back next call!

        Specified by:
        setValue in interface java.util.Map.Entry<V,K>
        Returns:
        the previous value instance.
        See Also:
        Map.Entry.setValue(java.lang.Object)

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.