Class ComparableSoftReference<T>

  • Type Parameters:
    T - is the type of the referenced object.
    All Implemented Interfaces:
    Comparable<Object>

    public class ComparableSoftReference<T>
    extends SoftReference<T>
    implements Comparable<Object>
    This class is a WeakReference that allows to be compared on its pointed value.
    Version:
    17.0 2020-01-04 14:41:38
    Author:
    Stéphane GALLAND
    Maven Group Id:
    org.arakhne.afc.core
    Maven Artifact Id:
    references
    • Constructor Detail

      • ComparableSoftReference

        public ComparableSoftReference​(T referent)
        Constructor.
        Parameters:
        referent - is the referenced object.
      • ComparableSoftReference

        public ComparableSoftReference​(T referent,
                                       ReferenceQueue<? super T> queue)
        Constructor.
        Parameters:
        referent - is the referenced object.
        queue - is the object that will be notified of the memory released for the referenced object.
    • Method Detail

      • equals

        @Pure
        public boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • hashCode

        @Pure
        public int hashCode()
        Overrides:
        hashCode in class Object
      • compareTo

        @Pure
        public int compareTo​(Object obj)
        Compare this reference to the specified object based on the Object.hashCode() if the references are not equals.
        Specified by:
        compareTo in interface Comparable<T>
        Parameters:
        obj -
        Returns: