scala.ref

# WeakReference

#### class WeakReference[+T <: AnyRef] extends ReferenceWrapper[T]

A wrapper class for java.lang.ref.WeakReference The new functionality is (1) results are Option values, instead of using null. (2) There is an extractor that maps the weak reference itself into an option.

Linear Supertypes
ReferenceWrapper[T], Proxy, Reference[T], () ⇒ T, AnyRef, Any
Type Hierarchy Learn more about scaladoc diagrams
Ordering

1. Alphabetic
2. By inheritance

Inherited

1. WeakReference
2. ReferenceWrapper
3. Proxy
4. Reference
5. Function0
6. AnyRef
7. Any

Implicitly

1. by any2stringadd
2. by StringFormat
3. by Ensuring
4. by ArrowAssoc

1. Hide All
2. Show all

Learn more about member selection
Visibility

1. Public
2. All

### Instance Constructors

1. #### new WeakReference(value: T)

2. #### new WeakReference(value: T, queue: ReferenceQueue[T])

### Value Members

1. #### final def !=(arg0: Any): Boolean

   Definition Classes
     AnyRef → Any

2. #### final def ##(): Int

   Definition Classes
     AnyRef → Any

3. #### def +(other: String): String

   Implicit information
     This member is added by an implicit conversion from WeakReference[T] to any2stringadd[WeakReference[T]] performed by method any2stringadd in scala.Predef.
   Definition Classes
     any2stringadd

4. #### def ->[B](y: B): (WeakReference[T], B)

   Implicit information
     This member is added by an implicit conversion from WeakReference[T] to ArrowAssoc[WeakReference[T]] performed by method ArrowAssoc in scala.Predef.
   Definition Classes
     ArrowAssoc
   Annotations
     @inline()

5. #### final def ==(arg0: Any): Boolean

   Definition Classes
     AnyRef → Any

6. #### def apply(): T

   return the underlying value

   return the underlying value

   returns

     the result of function application.

   Definition Classes
     ReferenceWrapper → Reference → Function0

7. #### final def asInstanceOf[T0]: T0

   Definition Classes
     Any

8. #### def clear(): Unit

   Definition Classes
     ReferenceWrapper → Reference

9. #### def clone(): AnyRef

   Attributes
     protected[java.lang]
   Definition Classes
     AnyRef
   Annotations
     @throws( ... )

10. #### def enqueue(): Boolean

    Definition Classes
      ReferenceWrapper → Reference

11. #### def ensuring(cond: (WeakReference[T]) ⇒ Boolean, msg: ⇒ Any): WeakReference[T]

    Implicit information
      This member is added by an implicit conversion from WeakReference[T] to Ensuring[WeakReference[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
      Ensuring

12. #### def ensuring(cond: (WeakReference[T]) ⇒ Boolean): WeakReference[T]

    Implicit information
      This member is added by an implicit conversion from WeakReference[T] to Ensuring[WeakReference[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
      Ensuring

13. #### def ensuring(cond: Boolean, msg: ⇒ Any): WeakReference[T]

    Implicit information
      This member is added by an implicit conversion from WeakReference[T] to Ensuring[WeakReference[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
      Ensuring

14. #### def ensuring(cond: Boolean): WeakReference[T]

    Implicit information
      This member is added by an implicit conversion from WeakReference[T] to Ensuring[WeakReference[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
      Ensuring

15. #### final def eq(arg0: AnyRef): Boolean

    Definition Classes
      AnyRef

16. #### def equals(that: Any): Boolean

    Definition Classes
      Proxy → Any

17. #### def finalize(): Unit

    Attributes
      protected[java.lang]
    Definition Classes
      AnyRef
    Annotations
      @throws( classOf[java.lang.Throwable] )

18. #### def formatted(fmtstr: String): String

    Returns string formatted according to given `format` string.

    Returns string formatted according to given `format` string. Format strings are as for `String.format` (@see java.lang.String.format).

    Implicit information
      This member is added by an implicit conversion from WeakReference[T] to StringFormat[WeakReference[T]] performed by method StringFormat in scala.Predef.
    Definition Classes
      StringFormat
    Annotations
      @inline()

19. #### def get: Option[T]

    return `Some` underlying if it hasn't been collected, otherwise `None`

    return `Some` underlying if it hasn't been collected, otherwise `None`

    Definition Classes
      ReferenceWrapper → Reference

20. #### final def getClass(): Class[_]

    Definition Classes
      AnyRef → Any

21. #### def hashCode(): Int

    Definition Classes
      Proxy → Any

22. #### def isEnqueued(): Boolean

    Definition Classes
      ReferenceWrapper → Reference

23. #### final def isInstanceOf[T0]: Boolean

    Definition Classes
      Any

24. #### final def ne(arg0: AnyRef): Boolean

    Definition Classes
      AnyRef

25. #### final def notify(): Unit

    Definition Classes
      AnyRef

26. #### final def notifyAll(): Unit

    Definition Classes
      AnyRef

27. #### def self: java.lang.ref.Reference[_ <: T]

    Definition Classes
      ReferenceWrapper → Proxy

28. #### final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
      AnyRef

29. #### def toString(): String

    Definition Classes
      Proxy → Any

30. #### val underlying: java.lang.ref.WeakReference[_ <: T]

    Definition Classes
      WeakReference → ReferenceWrapper

31. #### final def wait(): Unit

    Definition Classes
      AnyRef
    Annotations
      @throws( ... )

32. #### final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
      AnyRef
    Annotations
      @throws( ... )

33. #### final def wait(arg0: Long): Unit

    Definition Classes
      AnyRef
    Annotations
      @throws( ... )

34. #### def →[B](y: B): (WeakReference[T], B)

    Implicit information
      This member is added by an implicit conversion from WeakReference[T] to ArrowAssoc[WeakReference[T]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
      ArrowAssoc

### Inherited from ReferenceWrapper[T]

### Inherited from Proxy

### Inherited from Reference[T]

### Inherited from () ⇒ T

### Inherited from AnyRef

### Inherited from Any

### Inherited by implicit conversion any2stringadd from WeakReference[T] to any2stringadd[WeakReference[T]]

### Inherited by implicit conversion StringFormat from WeakReference[T] to StringFormat[WeakReference[T]]

### Inherited by implicit conversion Ensuring from WeakReference[T] to Ensuring[WeakReference[T]]

### Inherited by implicit conversion ArrowAssoc from WeakReference[T] to ArrowAssoc[WeakReference[T]]

### Ungrouped