Class WeakHashtable.Referenced

  • Enclosing class:
    WeakHashtable

    private static final class WeakHashtable.Referenced
    extends java.lang.Object
    Wrapper giving correct symantics for equals and hashcode
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int hashCode  
      private java.lang.ref.WeakReference reference  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Referenced​(java.lang.Object referant)  
      private Referenced​(java.lang.Object key, java.lang.ref.ReferenceQueue queue)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      private java.lang.Object getValue()  
      int hashCode()  
      • Methods inherited from class java.lang.Object

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

      • reference

        private final java.lang.ref.WeakReference reference
      • hashCode

        private final int hashCode
    • Constructor Detail

      • Referenced

        private Referenced​(java.lang.Object referant)
        Throws:
        java.lang.NullPointerException - if referant is null
      • Referenced

        private Referenced​(java.lang.Object key,
                           java.lang.ref.ReferenceQueue queue)
        Throws:
        java.lang.NullPointerException - if key is null
    • Method Detail

      • hashCode

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

        private java.lang.Object getValue()
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object