nl.tudelft.simulation.event.ref
Class WeakReference
java.lang.Object
nl.tudelft.simulation.event.ref.WeakReference
- All Implemented Interfaces:
- Reference, java.io.Serializable
- public class WeakReference
- extends java.lang.Object
- implements Reference
A WeakReference. The weakreference extends the
java.lang.ref.WeakReference and besides implementing the
Reference interface no changes are defined.
(c) copyright 2003 Delft
University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl
License of use: General Public
License (GPL) , no warranty
- Since:
- 1.2
- Version:
- 1.2 2004-03-18
- Author:
- Peter
Jacobs
- See Also:
- Serialized Form
|
Constructor Summary |
WeakReference(java.lang.Object referent)
Creates a new weak reference that refers to the given object. |
|
Method Summary |
java.lang.Object |
get()
Returns this reference object's referent. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WeakReference
public WeakReference(java.lang.Object referent)
- Creates a new weak reference that refers to the given object. The new
reference is not registered with any queue.
- Parameters:
referent - object the new weak reference will refer to
get
public java.lang.Object get()
- Description copied from interface:
Reference
- Returns this reference object's referent. If this reference object has
been cleared, either by the program or by the garbage collector, then
this method returns
null.
- Specified by:
get in interface Reference
- Returns:
- The object to which this reference refers, or
null
if this reference object has been cleared - See Also:
Reference.get()
Copyright © 2002-2004 Delft University of Technology, the Netherlands. All Rights Reserved.