Class References.SoftValueReference<V>

  • All Implemented Interfaces:
    References.InternalReference<V>
    Enclosing class:
    References

    static final class References.SoftValueReference<V>
    extends java.lang.ref.SoftReference<V>
    implements References.InternalReference<V>
    The value in a cache that holds values softly. This class retains a reference to the key in the advent that the value is reclaimed so that the entry can be removed from the cache in constant time.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.Object keyReference  
    • Constructor Summary

      Constructors 
      Constructor Description
      SoftValueReference​(java.lang.Object keyReference, V value, java.lang.ref.ReferenceQueue<V> queue)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object object)  
      java.lang.Object getKeyReference()
      Returns the key that is associated to the cache entry holding this reference.
      int hashCode()  
      • Methods inherited from class java.lang.ref.SoftReference

        get
      • Methods inherited from class java.lang.ref.Reference

        clear, clone, enqueue, isEnqueued, reachabilityFence
      • Methods inherited from class java.lang.Object

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

      • keyReference

        private final java.lang.Object keyReference
    • Constructor Detail

      • SoftValueReference

        public SoftValueReference​(@Nonnull
                                  java.lang.Object keyReference,
                                  @Nullable
                                  V value,
                                  @Nullable
                                  java.lang.ref.ReferenceQueue<V> queue)
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object object)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object